Directory Services Unknown Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rayne

    #1

    Directory Services Unknown Error

    I'm creating an application (VB 2005) that I want to use Directory
    Services with. I've got 2 class functions - 1 checks for a group. the
    other is supposed to retrieve the user's full name.

    My code is as follows:

    Dim entry As New DirectoryEntry( "LDAP://[domain]")
    Dim search As DirectorySearch er = New DirectorySearch er(entry)
    search.Filter = "SAMAccountName =" & _userName
    ** search.Properti esToLoad.Add("d isplayName")
    Dim result As SearchResult = search.FindOne( )
    ....

    This generates an Unknown Error (0x80005000) on search.FindOne( ). I
    have another function that calls the same code as above but with
    search.Properti esToLoad.Add("M emberOf") instead of displayName (line
    above marked **). The group function works fine.

    Why does the above error out when my other function runs fine? Is
    there a problem with "displayNam e"?

Working...