我正在尝试使用以下脚本:
$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 }
要在 Windows Server 2012 VM 上远程创建集群(用于测试目的)。我收到以下错误:
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
我所有其他远程命令(安装/更改 DNS、DHCP、NPAS、GP 等)都可以正常工作。为什么这个命令会有所不同?唯一的区别在于 -ScriptBlock 标签。救命!