DirectoryEntry.Find method question.

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I have some code wherein I am trying to see if a user
already exists before I add them to the AD. I originally
had it set up as a series of webpages that mimic the AD
Users & Computers add user screens and the code never
threw an exception. I decided to lump all the pages into
one to make it faster to enter data and now the code to
check if a user exists is throwing an exception that the
object doesn't exist in the directory. Am I doing
something wrong or is there another method I can use to
check if a user already exists?

Here is the line of code I used to check for a user:
Dim UserExists As DirectoryEntry = deGroups.Children.Find
("CN=testa", "user")

TIA
 
Back
Top