Hi,
How can I add an user account into Administrators?
and how to remove the account from Administrators?
Vadym Stetsyak - 16 Aug 2006 13:54 GMT
Hello, ad!
a> Hi,
a> How can I add an user account into Administrators?
a> and how to remove the account from Administrators?
You can use Win32 API for that, namely NetGroupAddUser and NetGroupDelUser both defined in
Netapi32.dll.
You will have to use P/Invoke to call them from C#
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
simida - 16 Aug 2006 14:51 GMT
plz refer to here.
http://www.pinvoke.net
you will find more information about how to use WIN32 API in the .NET
platform.
Good luck.
Sincerely,
simida
> Hi,
> How can I add an user account into Administrators?
> and how to remove the account from Administrators?
Willy Denoyette [MVP] - 23 Aug 2006 23:36 GMT
| Hi,
| How can I add an user account into Administrators?
| and how to remove the account from Administrators?
Take a look at the System.DirectoryServices namespace, these classes are
build to provide this functionality, no need to take the PInvoke tour.
Start here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbco
nwhatyouneedtoknowaboutactivedirectoryadsi.asp
and search MSDN for more samples.
Willy.
Willy Denoyette [MVP] - 23 Aug 2006 23:46 GMT
| Hi,
| How can I add an user account into Administrators?
| and how to remove the account from Administrators?
http://msdn2.microsoft.com/en-us/library/ms180833.aspx has a lot of samples
(AD only).
Willy.