You may use the Microsoft Windows PowerShell script below to remotely add a domain user to the specified group of the server you choose.
<#
.SYNOPSIS
This script will add a domain user to a group on a server.
.DESCRIPTION
This script will automate the process of adding a domain user to a group on a server.
.EXAMPLE
N/A.
.AUTHOR
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)?”
([ADSI]”WinNT://$SERVER/$GROUP,group”).psbase.Invoke(“Add”,([ADSI]”WinNT://$DOMAIN/$– USERNAME”).path)