Quick and simple on here.
This script takes the list of servers from a CSV file and then adds the specified user or groups to the local group of that server.
CSV File should be formatted as follows
“Name”
“Server1”
“Server2”
$ServerList = Import-CSV C:\Temp\serverlist.csv
ForEach ($server in $ServerList)
{
echo $serverInvoke-Command -ComputerName $server.name -ScriptBlock {add-LocalGroupMember -Group "Administrators" -Member "---Insert User or Group name-----"}
}
A copy is attached if you want to download it.