I want to use Powershell to add the user domain2\user123 to the local admin group on server domain2\server123. I want to be able to run the script from a workstation in domain1 and pass domain2 credentials. Essentially I want to do this:
$creds= get-credential "domain2\admin123"$server="server123"$domain="domain2" add-localgroup -credential $creds-computername $server-localgroup "Administrators"-user "domain2\user123"
I realize add-localgroup doesn't exist. I just want that kind of functionality. I've tried the [ADSI] methods but I can't use those against a server in another domain.
Thanks