I am working on some deployment PowerShell scripts that I plan to use with Bamboo for deployment. Within these PowerShell scripts, I want to run commands on a remote computer on our local network. I would like to use Invoke-Command and use the remote computer's local administrator account as the credentials, like what is shown below;
Invoke-Command -ComputerName DevBox -Credential DevBox\Administrator -ScriptBlock { ... }
However, when I run the script, I get this error message;
[DevBox] Connecting to remote server DevBox failed with the following error
message : WinRM cannot process
the request. The following error with errorcode 0x80090311 occurred while
using Kerberos authentication: We can't sign
you in with this credential because your domain isn't available. Make sure
your device is connected to your
organization's network and try again. If you previously signed in on this
device with another credential, you can sign
in with that credential.
Does Invoke-Command not work with the remote computer's local administrator account.
I can use PSExec and it works properly but I would prefer to use Invoke-Command, if possible.
I have verified that WinRM is installed and running on the remote computer, using Enable-PSRemoting –Force from that remote computers desktop.
Any ideas?
If this line of code is in a script,try to execute the command separately and You should be executing the command from an elevated PowerShell session.
User contributions licensed under CC BY-SA 3.0