-
Sep 9th, 2014, 11:01 AM
#1
Thread Starter
Junior Member
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
-
Sep 9th, 2014, 11:17 AM
#2
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?
-
Sep 9th, 2014, 11:23 AM
#3
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|