Announcement

Collapse
No announcement yet.

ADSI mit DotNet

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • ADSI mit DotNet

    Hallo!
    Ich möchte über .Net aufs Active Directory zugreifen!
    ----
    Dim strPath As String = ("LDAP://rechnername /ou=Mitarbeiter,ou=Benutzer,o=fh-ulm.de") Dim root As New DirectoryEntry(strPath) root.Username = "cn=liberto,ou=people,o=fh-ulm.de" root.Password = txtPass1.Text Dim results As SearchResultCollection Dim searcher As New DirectorySearcher(root) searcher.Filter = ("objectClass = people") searcher.PropertiesToLoad.Add("CN") searcher.PropertiesToLoad.Add("givenName") searcher.PropertiesToLoad.Add("sn") results = searcher.FindAll()

    Dim result As SearchResult For Each result In results Console.WriteLine(result.Properties("cn")(0)) Console.WriteLine(result.Properties("givenName")(0 )) Console.WriteLine(result.Properties("sn")(0)) Next result
    -----

    Beim Ausführen diesen Codes, bekomme ich eine Fehlermeldung, mit der ich leider nicht viel anfangen kann:

    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in system.directoryservices.dll
    Additional information: The server is not operational

    Der LDAP-Server läuft, den hab ich überprüft und die "system.directoryservices.dll" habe über die References eingebunden!!! ich habe keine Ahnung, was jetzt noch los sein könnte!!!! Hat jemand eine Idee????
    Vielen Dank schon mal!!!!!
Working...
X