I am doing a C# application targeting WinXP, Vista, and 7 Operating Systems.
One feature is, I can Add, Remove, Modify the Group set to a user programmatically.
Can I ask for help how to make this happen?
Will it be possible to do this in WMI? My codes mainly using WMI to get the users..
Currently am using Windows7
I am trying to test this code
DirectoryEntry localMachine = new DirectoryEntry("WinNT://" + Environment.MachineName + ",Computer");
localMachine.Properties["member"].Add("Chevi");
localMachine.CommitChanges();
localMachine.Close();
and it's spitting this error
The directory property cannot be found in the cache.
I tried enumerating the Property collection and I got this
OperatingSystem
OperatingSystemVersion
Owner
Division
ProcessorCount
Processor
Name