Powershell 的 LDAP 搜索不返回扩展架构属性



我正在尝试搜索具有扩展架构的LDAP服务器(不是活动目录服务器(。搜索返回结果,但不返回扩展对象类(扩展 inetOrgPerson 对象(中的任何扩展属性。我应该在下面的 PS 脚本中添加什么才能返回这些属性?

   $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="(mail=someone@somewhere.com)"
   $ourSearcher.PropertiesToLoad.Add("*")
   $ourSearcher.PropertiesToLoad.Add("mycustomattribute")
   $ourUser=$ourSearcher.FindAll() 
   $ourUser.Properties

它给了我所有属性,但只来自inetOrgPerson类。我已经查看了有关此主题的问题,但其中一些问题涉及Active Directory而不是其他LDAP服务器。

No.我们仍然没有得到扩展属性。我们在没有这些语句的情况下获得属性后向加载行添加了属性

最新更新