2

vb.netと次のコードを使用していますが、エラーが発生します。私はvb.netとActiveDirectoryを初めて使用しますが、plsはこの問題の解決に役立ちます。

私のコード:

Dim dirEntry As DirectoryEntry = New DirectoryEntry()
    dirEntry.Path = "ldap://sunbs.in:389/CN=Schema,CN=Configuration,DC=sunbs,DC=in"
    dirEntry.Username = "sunbs.in\sbsldap"
    dirEntry.Password = "sbs@123"
    Dim searcher As New DirectorySearcher
    searcher.SearchRoot = dirEntry

コードをデバッグすると、2行目にエラーが発生します。不明なエラー(0X80005000)

4

1 に答える 1

1

に大文字のLDAP://接頭辞を使用してみてくださいdirEntry.Path:

Dim dirEntry As DirectoryEntry = New DirectoryEntry()

' use LDAP:// - not ldap://
dirEntry.Path = "LDAP://sunbs.in:389/CN=Schema,CN=Configuration,DC=sunbs,DC=in" 

dirEntry.Username = "sunbs.in\sbsldap"
dirEntry.Password = "sbs@123"
Dim searcher As New DirectorySearcher
searcher.SearchRoot = dirEntry
于 2012-10-04T05:23:42.650 に答える