Try:
DirectoryEntry directoryEntry = new DirectoryEntry("WinNT://ComputerName" & ",computer", "AdminUN", "AdminPW");
DirectoryEntry user = directoryEntry.Children.Add("username", "user");
user.Invoke("SetPassword", new object[] { "password"});
ser.CommitChanges();
If you need to go through the Active Directory route, you can change the directoryEntry path to something like this: LDAP: // CN = computer_name, DC = MySample, DC = com
source
share