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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top