Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

How to add an usr account to Administrators

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ad - 16 Aug 2006 11:56 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.