Reputation: 844
I am trying to run a powershell invoke-command on a vmware image I have: invoke-command -computer [vmware host] -scriptBlock { commands }
This does not work because my client where I run the command is on a domain and the vm image is in a workgroup (mixed domains)
After some research, I have added the vmware host to trusted hosts (Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value [vmware host]) and if I supply credentials (administrator/password) the command works.
My question is: Is there a way to make it work without explicitly supplying the credentials e.g. either opening up the vmware host to all kinds of access or then somehow saving the credentials permanently on my client computer so that I don't need to supply them in a call using the "invoke-command -credential argument". I don't have the flexibility of adding the "-credential" argument as this code is maintained by other team.
I know I could add trust between the domains (to use kerberos) but that option is not available to me.
Upvotes: 1
Views: 1703
Reputation: 47802
This is possible using certificate-based authentication. You would authenticate with a client certificate that gets mapped to an account.
I admit I have not gotten around to it. I'd love to do this, but we only have about 9 Windows servers in the DMZ and it's just not worth the effort for me right now.
These links look promising:
If you do manage to get this working, I would very much like to hear about your experience.
Upvotes: 0
Reputation: 1095
This is about all you can do. Use PSDefaultParameters.
http://technet.microsoft.com/en-us/library/hh847819.aspx
$PSDefaultParameterValues = @{
"Enter-PSSession:Credential" = $cred
"Invoke-Command:Credential" = $cred
}
Upvotes: 0