Powershell remote add administrator
Write-Host "Add a remote administrator, please enter the host and AD domain account" $DomainName = "XXX.com" $ComputerName = Read-Host "Computer name:" $UserName = Read-Host "User name:" $AdminGroup = [ADSI]"WinNT://$ComputerName/Administrators,group" $User = [ADSI]"WinNT://$DomainName/$UserName,user" $AdminGroup.Add($User.Path)