473,385 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to add an usr account to Administrators

ad
Hi,
How can I add an user account into Administrators?
and how to remove the account from Administrators?
Aug 16 '06 #1
4 1535
Hello, ad!

aHi,
aHow can I add an user account into Administrators?
aand 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
Aug 16 '06 #2
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
ad wrote:
Hi,
How can I add an user account into Administrators?
and how to remove the account from Administrators?
Aug 16 '06 #3


"ad" <fl****@wfes.tcc.edu.twwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
| 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/de...ectoryadsi.asp
and search MSDN for more samples.

Willy.
Aug 23 '06 #4

"ad" <fl****@wfes.tcc.edu.twwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
| 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.
Aug 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gary L. Drescher | last post by:
Quick user question. I changed an XP Pro user account from Administrator to Limited, and then found I cannot not sign in to .NET 1.1 (via MSN Messenger 6.1 or via Money 2003, for example) from...
2
by: DotNet Ed | last post by:
Hi, I have an issue I have not found a way to get around. First of all, I use Windows XP Professional. I have a user account for administrative & security purposes (install software, share things,...
6
by: Evgeny Zoldin | last post by:
Hi ALL. I have the configuration: 1. WinXP PRO with MS IIS 5.0 and installed ASP.NET 2. ASP.NET application A configured to authenticate only users from local Users group. I would like to de...
1
by: Bronsdijk | last post by:
Here is the story: The application performs different administrative tasks. But now users who aren't part of the administrators group have to perform these tasks as well. Just giving them the...
4
by: Tim Sapp | last post by:
Folks, I am working on a .Net web site that connects to SQL Server 2000 on another box. The DBA has given me a Domain user account with rights to the database and table. I have confirmed with...
2
by: Simon Hart | last post by:
Hi, I have written a Windows Service component in C# which manages processes on the server. The code is required to terminate these processes when they timeout. The Windows Service runs under...
1
by: Andrés G. Aragoneses | last post by:
Hello. I have a Windows Service which I want to execute a file. The service is running under the local system account but when the file is executed it seems to be run with the profile of the...
5
by: Michael Howes | last post by:
I'm writing a utility to manage a machines *local* accounts in c# I am getting all the users in a specific Group just fine but when I want to get some of the information on each user from their...
1
by: Alex | last post by:
Hi everybody Is creating of the service, which must be ran under the "user account" something really tricky? I mean if in ServiceProcessInstaller properties I'm using account: Local System...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.