How can I use a local computer account as the credentials for PSExec

0

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?

powershell-3.0
bamboo
powershell-remoting
windows-security
asked on Stack Overflow Oct 11, 2017 by EiEiGuy • edited Oct 13, 2017 by EiEiGuy

1 Answer

0

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.

answered on Stack Overflow Oct 12, 2017 by Prasoon Karunan V

User contributions licensed under CC BY-SA 3.0