PowerShell Remoting: No credentials are available in the security package

Posted by TheSciz on Server Fault See other posts from Server Fault or by TheSciz
Published on 2012-08-30T20:20:42Z Indexed on 2012/08/30 21:40 UTC
Read the original article Hit count: 273

I'm trying to use the following script:

$password = ConvertTo-SecureString "xxxx" -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential("domain\Administrator", $password)
$session = New-PSSession 192.168.xxx.xxx -Credential $cred
Invoke-Command -Session $session -ScriptBlock { New-Cluster -Name "ClusterTest" -Node HOSTNAME }

To remotely create a cluster (it's for testing purposes) on a Windows Server 2012 VM. I'm getting the following error:

An error occurred while performing the operation.
    An error occurred while creating the cluster 'ClusterTest'.
    An error occurred creating cluster 'ClusterTest'.
    No credentials are available in the security package
    + CategoryInfo          : NotSpecified: (:) [New-Cluster], ClusterCmdletException
    + FullyQualifiedErrorId : New-Cluster,Microsoft.FailoverClusters.PowerShell.NewClusterCommand

All of my other remote commands (installing/making changes to DNS, DHCP, NPAS, GP, etc) work without an issue. Why is this one any different? The only difference is in the -ScriptBlock tag. Help!

© Server Fault or respective owner

Related posts about Windows

Related posts about powershell