Hi all,
I'm writing a PowerShell script that will automatically set up a build machine VM.
Right now I'm stuck on adding a domain user to the local administrator's group on the VM:
$localAdminBlock = `
{
$objUser = [ADSI]("WinNT://mydomain/buildmaster")
$objGroup = [ADSI]("WinNT://$using:vm/Administrators")
$objGroup.PSBase.Invoke("Add",$objUser.PSBase.Path)
}
Invoke-Command -ComputerName $vm -Scriptblock $localAdminBlock -Credential $preDomainCredsWhen I run this, I get:
[TestVM] Processing data from remote server TestVM failed with the following error message: The WinRM client received an HTTP server error status (500), but the remote service did not include any other information about the cause of the failure.... CategoryInfo: OpenError (TestVM:String) [], PSRemotingTransportException FullyQualifiedErrorId: WinRMHttpError,PSSessionStateBroken
I've looked around, but all I can see about http 500 in this context is all Exchange-related.
Thanks!