I have this script working on 2008 R2 servers when run remotely with domain admin user: It creates a local user and then adds that user to local Administrators account.
$cn = [ADSI]"WinNT://$servername.com"
$user = $cn.Create("User","_decommission")
$user.SetPassword("P@ssword1")
$user.setinfo()
$user.Description = "Test user"
Invoke-command -computername $servername.com -scriptblock {net localgroup Administrators /add $servername\_decom}
How do I utilize vCO to call this script to where I have it prompt me for the $servername and/or to point to a text file with the list of servers??
Please help..