0
我正在嘗試搜索擴展了架構的LDAP服務器(非Active Directory服務器)。搜索返回結果,但是沒有擴展對象類的擴展屬性(擴展inetOrgPerson對象)返回。我應該添加到下面的PS腳本來返回這些屬性?Powershell的LDAP搜索未返回擴展架構屬性
$ourServer="LDAP://myserver:9999"
$ourPath="/somedn"
$ourAuth = [System.DirectoryServices.AuthenticationTypes]::FastBind
$Domain = New-Object System.DirectoryServices.DirectoryEntry ($ourDN,"usersfulldn","password",$ourAuth)
$ourSearcher=New-Object System.DirectoryServices.DirectorySearcher
$ourSearcher.filter="([email protected])"
$ourSearcher.PropertiesToLoad.Add("*")
$ourSearcher.PropertiesToLoad.Add("mycustomattribute")
$ourUser=$ourSearcher.FindAll()
$ourUser.Properties
它給我所有的屬性,但只有inetOrgPerson類。我已經看過有關此主題的問題,但其中一些涉及Active Directory,而不是其他LDAP服務器。
最後,我終於調用應用程序(Identity Manager的)Web服務來獲取此額外屬性值,但如果有人能夠提供洞察一個本地PS調用的解決方案 – sohail
如果您只是將兩行'$ ourSearcher.PropertiesToLoad.Add'註釋掉了,您是否具有該條目的所有屬性? – Esteban