Cannot remove Active Directory user
Posted on 2007-11-15
I am trying to remove a user from Active Directory. adConn is my DirectoryEntry with admin rights. I keep getting an error that says that there is no such object on the server. I know the object is there because earlier in the program i can retrieve it as a search result. What am I doing wrong?
'Locate the actual account in AD that is to be deleted
Dim tempUser As DirectoryServices.DirectoryEntry = adConn.Children.Find("CN=John Smith", "Users")
'Delete the account