Add a user to Local Admin group on All machines.

Scenario: You need to add a user (test1) to local Administrators group on all computer. How do you achieve this??? no no...you're wrong here - don't need to use VBScript or something like that simply use PSEXEC to accomplish this! - intersting!

Here it is:

psexec.exe net localgroup administrators test.local\test /add -@server.txt

Isn't simple as pie?

-@server.txt - This file includes the list of servers to be processed by psexec to run the Net Localgroup Administrators test.local\test /add command.

net localgroup - This command directs NBT API to execute a command using Windows Low-level sub-system. You should use Net Group for Global security group if you're gonna add to Global Security Group.

Cool
Published Sun, Jan 28 2007 21:54 by Nirmal
Filed under:

Comments

# AddWeblog

Sunday, January 28, 2007 11:54 PM by AddWeblog

# re: Add a user to Local Admin group on All machines.

Hi

I tried your posting but had to use the syntax

psexec.exe @server.txt net localgroup administrators <user/group> /add

as having tried the original syntax, I got a warning "There is no such global user or group: @server.txt".

However my version of the syntax also fails with "Access Denied" for every server listed in server.txt. Do you have any idea, why this would be so?

Many thanks - Colin  

Saturday, February 24, 2007 11:28 PM by Colin Kemp

# re: Add a user to Local Admin group on All machines.

Access Denied can be due to a handful of things.  I usually see this when I run this kind of command against a remote machine while using an account that's not already an administrator on that machine.

Or:

You need to be an administrator on the remote machine to add other folks to the local administrator group.

Wednesday, March 28, 2007 12:16 PM by Matt Siems

# re: Add a user to Local Admin group on All machines.

Use IP addresses instead of names in Servers.txt

Wednesday, March 28, 2007 11:00 PM by Nirmal

# re: Add a user to Local Admin group on All machines.

MSN I NIIPET

<a href="http://msn.com">MSN</a>

Saturday, May 12, 2007 2:52 AM by Bill

# Mission...not impossible...

&lt;duh duh da da duh duh music playing in the background&gt; Your job, Mr. Phelps is to devise a way

Tuesday, June 19, 2007 10:34 PM by E-Bitz - SBS MVP the Official Blog of the SBS "Diva"

# field_other

Thursday, December 25, 2008 8:21 PM by nick_trlicn

# rjryRpGinAvmwOd

e0SAZ4  <a href="jnpyfpdchrfp.com/.../a>, [url=http://rwwpimcplmyp.com/]rwwpimcplmyp[/url], [link=http://gdcngzcttmev.com/]gdcngzcttmev[/link], http://vidswuefrmcg.com/

Thursday, December 17, 2009 1:22 PM by tmvmdrzyfd

# re: Add a user to Local Admin group on All machines.

how to use this command pls explain me........

Tuesday, January 12, 2010 2:06 AM by Sunil

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: