0
我正嘗試使用以下代碼連接到ldap服務器。如何使用c#使用其憑據連接到LDAP服務器
Dim xd As New XmlDocument()
Dim domainAndUsername As String = String.Empty
Dim userName As String = String.Empty
Dim passWord As String = String.Empty
Dim at As AuthenticationTypes = AuthenticationTypes.Anonymous
Dim sb As New StringBuilder()
domainAndUsername = "LDAP://MARS-AD\kumaravi:[email protected]:389/OU=EXD,OU=People,OU=EMEAI,OU=Mars,OU=IT-Services,DC=Mars-AD,DC=Net"
userName = "username"
passWord = "password"
at = AuthenticationTypes.Secure
'Create the object necessary to read the info from the LDAP directory
Dim entry As New DirectoryEntry(domainAndUsername, userName, passWord, at)
Dim mySearcher As New DirectorySearcher(entry)
Dim results As SearchResultCollection
mySearcher.Filter = filter
它給出以下錯誤信息。 「服務器不可操作」。
LDAP服務器的什麼樣的最好利用的新功能?活動目錄??你的LDAP路徑肯定是無效的 - 它應該是這樣的:'LDAP:// domain/OU = EXD,OU = People,OU = EMEAI,OU = Mars,OU = IT-Services,DC = Mars-AD,DC = Net'或類似的東西 - 肯定沒有在該LDAP字符串中的用戶名/密碼.... – 2011-12-21 10:21:30