Windows Powershell 和管理 NLB 集群
我正在开发脚本以允许自动管理集群服务器,作为其中的一部分,我需要能够从 Powershell 脚本停止和启动集群节点。
我为此使用的代码如下:
Import-Module NetworkLoadBalancingClusters
Stop-NlbClusterNode [[-HostName] <string>] [-InterfaceName <string>] [<CommonParameters>]
但是在使用 Powershell v2 在 3 个不同的环境(Windows 7/Windows Server 2003/Windows Server 2008 R2)上运行此脚本时,出现以下错误:
Get-NlbCluster :此方法未在任何类中实现 行数:6 字符:15 + Get-NlbCluster <<<<< -主机名“SERVER1” -接口名“10.172.1.180” + 类别信息:未指定:(:) [获取 NlbCluster],管理异常 + FullQualifiedErrorId:System.Management.ManagementException、Microsoft.NetworkLoadBalancingClusters.PowerShell.GetNlbCluster。
有谁知道我在这里做错了什么导致这个错误?
提前致谢,
斯图尔特
I am in the process of developing scripts to allow automated management of Clustered servers, and as part of that I have a requirement to be able to stop and start cluster nodes from a Powershell script.
The code I am using for this is as follows:
Import-Module NetworkLoadBalancingClusters
Stop-NlbClusterNode [[-HostName] <string>] [-InterfaceName <string>] [<CommonParameters>]
But on running this script on 3 different environments (Windows 7/Windows Server 2003/Windows Server 2008 R2) all with Powershell v2, I get the following error:
Get-NlbCluster : This method is not implemented in any class At line:6 char:15 + Get-NlbCluster <<<< -HostName "SERVER1" -InterfaceName "10.172.1.180" + CategoryInfo : NotSpecified: (:) [Get-NlbCluster], ManagementException + FullyQualifiedErrorId : System.Management.ManagementException,Microsoft.NetworkLoadBalancingClusters.PowerShell.GetNlbCluster.
Does anyone know what I have done wrong here which is causing this error?
Thanks In Advance,
Stuart
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这仅适用于 Windows Server 2008 R2,并且您必须安装网络负载平衡功能。
This only works on Windows Server 2008 R2 and you have to install the Network Load Balancing feature.