You may use the Microsoft Windows PowerShell script below to remotely add a domain user to the specified group of the server you choose.
This script will add a domain user to a group on a server.
This script will automate the process of adding a domain user to a group on a server.
Modified by Noel Enrique Alvarez on Friday, December 02, 2016.
#Request the domain name
$DOMAIN = Read-Host “What is the domain?”
#Request the username
$– USERNAME = Read-Host “What is the username?”
#Request the hostname of the server
$SERVER = Read-Host “What is the hostname of the server?”
#Request the name of the group
$GROUP = Read-Host “What is the name of the group (i.e. Administrators)?”