Can I programmatically and remotely create and delete Windows User accounts via WCF (self hosted) and C#? This works locally, but not via WCF... Ideas?
DirectoryEntry localDirectory = new DirectoryEntry("WinNT://" + Environment.MachineName.ToString());
DirectoryEntries users = localDirectory.Children;
try
{
DirectoryEntry user = users.Find(usernameAccount);
users.Remove(user);
}catch(SystemException)
{
System.Console.WriteLine("Error: User account not found in the system");
}
}