在工作流中创建具有新群集的群集,并且inlinescript失败

时间:2015-08-18 18:18:05

标签: powershell cluster-computing powershell-workflow

当我尝试在工作流程中使用PowerShell从其他主机远程安装群集时,以及这样的内联脚本:

workflow CreateClusterCL1 {
  $password = "xxx" | ConvertTo-SecureString -asPlainText -Force
  $username = "xxxx"
  $credential = New-Object System.Management.Automation.PSCredential($username,$password)
  inlinescript {
    New-Cluster -Name xxx-CL1 -StaticAddress xxx -Node xxx-01, xxx-02, xxx-03, xxx-04 -NoStorage -Force
  } -PSComputerName xxx-01.xx.loc -PSCredential $credential 
}

我收到此错误:

CategoryInfo          : **PermissionDenied**: (:) [New-Cluster], ClusterCmdletException
    + FullyQualifiedErrorId : **UnauthorizedAccess,**Microsoft.FailoverClusters.PowerShell.NewClusterCommand
    + PSComputerName        : [xxxx-01.xxxx]
New-Cluster : There was an error adding node 'xxx-03' to the cluster
    You do not have administrative privileges on the server 'xxx-03.xxx.LOC'.
    Attempted to perform an unauthorized operation.
At CreateClusterCL1:8 char:8

任何想法?

0 个答案:

没有答案