我想要完成的所有操作都是在LDAP組中有任何成員時返回。所以,我有一個組列表,我想查詢每個組的列表,以確保每個組中至少有一個成員。如何使用不在MS Active Directory中使用Powershell查詢LDAP組的成員
我正在使用powershell,這不是活動目錄。
這是目前我試圖
$user = "username"
$pwd = "password"
$de = "LDAP://[SERVERNAME]/cn=user,ou=people,o=company"
$deObject = New-Object -TypeName System.DirectoryServices.DirectoryEntry($de,$user,$pwd,'FastBind')
這會返回一個DirectoryEntry對象(至少據我可以告訴)。我實在看不出任何屬性或任何東西,除了如果我做到以下幾點:
$deObject.Name
這將返回「用戶」的CN,就是這樣。有什麼建議麼?
我已經試過:
$deObject.Properties
$deObject.Properties['member']
$deObject.Properties.Values['member']
提前感謝!
一些提示:HTTP://www.vistax64 .com/powershell/29100-bind-ldap-directory.html –