【问题标题】:Unable to determine if the computer '<CLUSTER-NAME>' exists in the domain - New-Cluster cmdlet无法确定域中是否存在计算机“<CLUSTER-NAME>” - New-Cluster cmdlet
【发布时间】:2016-09-21 11:40:08
【问题描述】:

我正在尝试通过 staf 运行 New-Cluster 命令以在(Windows server 2012 R2,启用 failovercluster 角色)上创建集群,并且 PowerShell 版本为 3.0。

尝试了 2 种不同的方法,但没有一个对我有用。 当我将会话参数传递给Invoke-Command 时,它能够找到New-Cluster cmdlet,但是当我尝试不使用会话时,它无法找到该cmdlet。

这是两种方法的sn-p:

  1. Staf“启动shell命令”方式:
    当我使用这种方法时,我遇到如下错误:

    staf <Server-IP> process START SHELL COMMAND :187:Invoke-Command -ScriptBlock
    

    我得到的错误如下所示:

    New-Cluster:术语“New-Cluster”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,如果包含路径,请验证路径是否正确,然后重试。

  2. 使用PSSESSION方式:

    staf <Server-IP> process START SHELL  COMMAND :221:$ps = New-PSSession; Invoke-Command -session $ps -ScriptBlock
    

    New-Cluster 命令执行,但失败并出现如下错误:

    New-Cluster : 无法确定计算机“”是否存在于
    域“”。
    &加; CategoryInfo : NotSpecified: (New-Cluster : U...XXXXXXXX'.:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError
        + PSComputerName:本地主机
    
    发生操作错误。
    在 C:\XXXXXX.ps1:7 字符:1
    &加;新集群 -Name $cluster -Node $nodes -StaticAddress $staticaddress
    &加; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
        + CategoryInfo : NotSpecified: (:) [New-Cluster], ClusterCmdletException
        + FullyQualifiedErrorId : New-Cluster,Microsoft.FailoverClusters.PowerShell.NewClusterCommand

我不想使用会话参数,有什么方法可以使用非默认模块进行远程命令调用? 有人可以建议我是否缺少任何需要的输入,或者请建议我是否应该尝试其他方法来获得预期的结果。

【问题讨论】:

  • 你在第一种方法中Import-Module FailoverClusters 吗?
  • 当我在第一种方法中使用 Import-Module 时,我得到与方法 2 中看到的完全相同的错误。即`New-Cluster:无法确定域中是否存在计算机'' `
  • 能否通过 GUI 工具创建集群?这也可能是权限问题,参考cluster troubleshooting
  • 从 GUI 它工作得非常好,当我在本地执行 cmdlet 时,它也能按预期工作。问题是当我通过 STAF(使用域管理员凭据)执行相同的 cmdlet 时,它会抛出上面案例 2 中提到的错误。

标签: powershell windows-server-2012-r2 staf


【解决方案1】:

这里的要点如下:

  1. 您要从中创建 WSFC 的计算机必须是域的一部分。
  2. 重要的是,New-Cluster 命令应该以属于域的用户而不是本地帐户的身份运行。

以域帐户运行 powershell 脚本:

Import-Module FailoverClusters New-Cluster -Name SomeCluster -Node <NodeName>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-31
    • 1970-01-01
    • 2016-10-04
    • 2020-02-02
    • 2020-10-10
    相关资源
    最近更新 更多