Add Domain User To Local Administrators Group

by [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

 

See Also


The Author — Nirmal Sharma

Nirmal Sharma avatar

Nirmal Sharma is a MCSEx3, MCITP and was awarded the Microsoft MVP award in Directory Services and Windows Networking. He specializes in Microsoft Azure, Office 365, Directory Services, Failover Clusters, Hyper-V, PowerShell Scripting and System Center products. Nirmal has been involved with Microsoft Technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles on various sites and contributing to PowerShell-based Dynamic Packs for www.ITDynamicPacks.Net solutions.

Featured Links