Hello,
I wrote a c# code that creates new local user
DirectoryEntry localMachine = new DirectoryEntry("WinNT://" + Environment.MachineName + ",computer");
DirectoryEntry group = localMachine.Children.Find("administrators", "group");
DirectoryEntry user = localMachine.Children.Find(accountName, "user");
Console.WriteLine(user.Properties.ToString());
I tried to set the logon script for that user by doing:
localMachine.Properties["scriptPath"].Insert(0, "logonScript.vbs"); localMachine.CommitChanges();
same with group or user instances.but the property doesn't exist in any of theses instances (localMachine, group or user). I know that because I did:
System.Collections.ICollection col = localMachine.Properties.PropertyNames;
foreach (Object ob in col) { Console.WriteLine(ob.ToString()); }
Any idea of how to do that in other way?Cheers,