Add Domain User To Local Administrators Group

by Nirmal Sharma [Published on 9 Dec. 2010 / Last Updated on 31 Oct. 2009]

This article explains how you can use Psexec.exe to add a domain user to local administrators Security group.

You have installed an application in your environment. This application needs to C$ of all the client computers to install it's Agent. To install the Agent, application requires admin access on all the client computers. Application is installed with a domain user (for example; AppAccount) which must be added to the Local Administrators Security Group on all the client computers.

To accomplish above, you can follow the steps outlined below:

Create a text file and name it CompList.TXT

Put all the client computer names in it.

Next, run the following command:

Psexec.exe -@CompList.TXT Net LocalGroup Administrators DomainName.COM/AppAccount /add

The above command runs against each computer mentioned in the CompList.TXT and adds the AppAccount to Local Administrators Security Group. 

You can download the Psexec.exe from here: http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

 

Featured Links