Dear,
I'm trying to remove a user from active directory... unfortunately this doesn't work....I'm using the code below but this failes... I use the administrator as DirectoryEntry but for some reason it doesn't find the other user in it's child objects....
using System.DirectoryServicesprivate
DeleteUserFromActiveDirectory(DataRow in_Gebruiker){
DirectoryEntry AD = new DirectoryEntry(strPathActiveDirectory ,
strUsername, strPassword)
DirectoryEntry NewUser =
AD.Children.Find("CN=TheUserName", "User");
AD.Children.Remove(NewUser);
AD.CommitChanges();
AD.Close();
}
When I use a filter, I DO find the the child object. but then I still can't remove the user... (I think because the remove uses the same search method as the build in "Find")
help is more then welcome,
thank you,