Results 1 to 3 of 3

Thread: show users in active directory error message.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    17

    show users in active directory error message.

    Why am I getting an exception error when trying to show all users in active directory. What does this mean?

    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in System.DirectoryServices.dll

    Additional information: The server is not operational.


    Code:
        'Show all users in the domain
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    
       Dim domain As DirectoryEntry = New DirectoryEntry("LDAP://domain.com/CN=Users,DC=Domain,DC=com")
    
            For Each child As DirectoryEntry In domain.Children
    
                ListView2.Items.Add(child.Name) 'populate results to a ListView
    
            Next
    
        End Sub
    Last edited by dday9; Sep 9th, 2014 at 11:13 AM. Reason: He left out the last [/CODE] tag

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,715

    Re: show users in active directory error message.

    The exception "The server is not operational" is normally returned when server is not in network or switched off or you have the server name spelled wrong.

    By the way, I'm assuming that this is an ASP.Net question, am I right?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2014
    Posts
    17

    Re: show users in active directory error message.

    yes, asp.net

    ok, so I checked the domain name and yes , I didn't have it incorrectly stated in the code.

    here is my next error.

    An unhandled exception of type 'System.DirectoryServices.DirectoryServicesCOMException' occurred in System.DirectoryServices.dll

    Additional information: A referral was returned from the server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width