Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Adding new user to admin group

Reply
Thread Tools

Adding new user to admin group

 
 
Ching-Lung
Guest
Posts: n/a
 
      01-07-2004
Hi,

Is there any way to add new user to local admin group in
C# ASP.NET?

Thanks,
-CL
 
Reply With Quote
 
 
 
 
Coucou toutes et tous
Guest
Posts: n/a
 
      01-09-2004

Here is one method that you could use to accomplish this:

You can invoke a DOS batch script which will add the user to the group. The
DOS command would be as follows:
net localgroup administrators DOMAIN\username /add

Then, generate a text file containing the above commands/usernames and save
the file as adduser.bat.

Then, add the following code to whatever event you wanted to use to add the
user:

System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName="c:\\foldername\\adduser.b at";
proc.Start();

If you also need to create the user, you can add that command to your batch
file using the proper syntax for the addusers utility.

Chris

--------------------
>Content-Class: urn:content-classes:message
>From: "Ching-Lung" <(E-Mail Removed)>
>Sender: "Ching-Lung" <(E-Mail Removed)>
>Subject: Adding new user to admin group
>Date: Wed, 7 Jan 2004 12:21:13 -0800
>Lines: 7
>Message-ID: <026601c3d55b$cbb9af70$(E-Mail Removed)>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Thread-Index: AcPVW8u58oboNYH9Rj2maM6colIwCQ==
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Path: cpmsftngxa07.phx.gbl
>Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:200399
>NNTP-Posting-Host: tk2msftngxa12.phx.gbl 10.40.1.164
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
>Hi,
>
>Is there any way to add new user to local admin group in
>C# ASP.NET?
>
>Thanks,
>-CL
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent : Direct Client is looking for Informatica Admin &Developer(Admin must) sarah Fernandes Java 0 11-01-2010 05:03 PM
WCF service install on 2003 fails using new ADMIN user but works as user ADMINISTRATOR Scott ASP .Net 2 11-13-2008 04:03 PM
Add domain user to local group via web application running under local admin account Chad Dressler ASP .Net 0 12-30-2006 01:27 AM
Tablet PC User Group introduction (and Windows Mobile User Group reminder) Mauricio Freitas NZ Computing 0 07-09-2005 09:19 PM
Cannot access aspx page if user is not in Admin group Mathew Uthup ASP .Net Security 1 06-22-2005 02:57 AM



Advertisments