如何通过 SID 获取(AD)LDAP 人员条目?

mtm*_*mtm 4 active-directory ldap sid

给定用户或组的 SID,如何找到属于它的 LDAP 对象?
LDAP 服务器是 Active Directory (Windows Server 2008)。

LDAP 查询字符串会很有用。

quu*_*uux 6

另一种方法是放弃 LDAP 并使用 WMIC:

H:\>wmic useraccount where (sid = "S-1-5-21-1698188384-1693678267-1543859470-6637") get * /format:list    

AccountType=512
Caption=MYDOMAIN\quux
Description=some guy's account
Disabled=FALSE
Domain=MYDOMAIN
FullName=Some Guy
InstallDate=
LocalAccount=FALSE
Lockout=FALSE
Name=quux
PasswordChangeable=TRUE
PasswordExpires=FALSE
PasswordRequired=TRUE
SID=S-1-5-21-1698188384-1693678267-1543859470-6637
SIDType=1
Status=OK
Run Code Online (Sandbox Code Playgroud)

现在您有几个属性,如果您仍然需要,这些属性应该很容易通过 LDAP 进行搜索。