Remotely Run PowerShell on a Cluster
Learn how to remotely run PowerShell on a cluster.
June 17, 2014
Q: I'm trying to remotely run PowerShell commands on a node in a cluster, but the commands aren't working because of an authentication problem. Why?
A: When a PowerShell command is executed on a remote server, your credentials are used to perform actions on that remote box. In order to protect the use of your credentials, a remote server can't then use the credentials it was passed on another server, which would create a double-hop of credential usage. When you run cluster commands, all nodes in the cluster are communicated with to perform actions—which will fail because the cluster node you remotely connected to doesn't have the rights to use the credentials on other nodes in the cluster.
There are several ways to solve this problem. The simplest approach is to use CredSSP and configure the server to which you're connecting to allow the use of CredSSP.
On the local machine that will issue the commands, run:
Enable-WSManCredSSP Client -DelegateComputer -Force
On the remote server that will receive the commands, run:
Enable-WSManCredSSP Server
Then when running the remote commands, use the following:
$CustomCred = Get-Credential #Stores a credential to use and you will be prompted on screenInvoke-Command -ComputerName -ScriptBlock {remote stuff} -Authentication Credssp -Credential $CustomCred
About the Author
You May Also Like