Using tools such as PSExec, it is possible to add or remove user accounts to a remote computer using command line utilities. Using the same tools, we can set that user as a local administrator as well.
To get started, navigate to the PsTools Download Page, then download the PsTools Suite.
Extract the contents of the downloaded zip file to c:\PSTools
Open a Command Prompt on a computer logged in with Domain Administrator credentials, or in a workgroup scenario, a mutual Administrator account.
Note: Be sure to Right Click > Run as Administrator on the Command Prompt
In the Command Prompt window, enter the command cd\ and press Enter
Enter the command cd pstools then press Enter
To create the remote user, enter the following:
PSEXEC \\ComputerName NET USER newusername newpassword /add
[ComputerName] = Name of remote computer
[newusername] = The desired username
[newpassword] = The desired password for the new user
To delete a remote user, enter the following:
PSEXEC \\ComputerName NET USER username /delete
[ComputerName] = Name of remote computer
[username] = The username of the user account to be removed
To view the current list of user accounts, enter the following:
PSEXEC \\ComputerName NET USER
[ComputerName] = Name of remote computer
To add users to a local group, enter the following: (Administrators group in this example)
PSEXEC \\ComputerName NET LOCALGROUP Administrators username /add
[ComputerName] = Name of remote computer
[Administrators] = The target group (in this example, Administrators)
[username] = The account that will be added to the target group