Powershell:通过SSL向非Microsoft(?)服务器进行匿名LDAP查询
我正在尝试使用Powershell v4通过SSL查询LDAP服务器。服务器位于受信任的域中 -服务器名称为xxx.xxx.intranet -使用服务器名和端口636,我可以使用JXplorer和LDAPAdmin连接并查询服务器 -当我在没有搜索库的情况下查询服务器时,它返回包含“vendorName=Sun Microsystems”“vendorVersion=Directory Proxy server 11.1.1.7.1”的模式信息,所以我猜我不是在和MS机器说话 -我尝试使用System.DirectoryServices.Protocols进行查询,因为这似乎是一种独立于供应商的方式来使用Powershell进行查询-对吗 -现在,我被这个困扰着:Powershell:通过SSL向非Microsoft(?)服务器进行匿名LDAP查询,powershell,ssl,ldap,Powershell,Ssl,Ldap,我正在尝试使用Powershell v4通过SSL查询LDAP服务器。服务器位于受信任的域中 -服务器名称为xxx.xxx.intranet -使用服务器名和端口636,我可以使用JXplorer和LDAPAdmin连接并查询服务器 -当我在没有搜索库的情况下查询服务器时,它返回包含“vendorName=Sun Microsystems”“vendorVersion=Directory Proxy server 11.1.1.7.1”的模式信息,所以我猜我不是在和MS机器说话 -我尝试使用Sy
Find-LdapObject -SearchFilter:"(attributeOrigin=HR)" -LdapServer:"xxx.xxx.intranet:636" -searchBase "ou=People,o=Company"
这将返回以下错误:
The Distinguished Name Contains Invalid Syntax
接下来,我尝试在变量中定义LDAP服务器:
$ldapSrv=new-object System.DirectoryServices.Protocols.LdapConnection(new-object System.DirectoryServices.Protocols.LdapDirectoryIdentifier(xxx.xxx.intranet, 636))
然后,使用-ught将auth type设置为“basic”,但似乎有效:
$ldapSrv.AuthType = New-Object System.DirectoryServices.Protocols.AuthType
这就是我的结局:
The LDAP server is unavailable
谢谢你的帮助
问候,,
迈克尔