我已经安装并设置了 NLB。我得到这样的接口数据:
Get-NlbClusterNodeNetworkInterface
InterfaceName : quanet
NlbBound : False
Cluster :
DhcpEnabled : False
InterfaceIP : 10.165.250.206
InterfaceSubnetMask : 255.255.0.0
ClusterPrimaryIP :
ClusterSubnetMask :
InterfaceName : cluster
NlbBound : False
Cluster :
DhcpEnabled : False
InterfaceIP : 172.16.1.206
InterfaceSubnetMask : 255.255.255.0
ClusterPrimaryIP :
ClusterSubnetMask :
我想使用 Powershell 将 NlbBound 设置为 true。不用说设置属性不起作用。例如
$x = Get-NlbClusterNodeNetworkInterface
$x[1].nlbbound = $true
$x = Get-NlbClusterNodeNetworkInterface
echo $x[1].NlbBound
False
我想避免在网络适配器设置中显式设置属性,因为此功能将存在于脚本中。如果可能的话,我也想避免使用 WMI。
根据 Get-Member cmdlet,NlbBound 属性是可设置的:
Get-Member -InputObject $x[1]
TypeName: Microsoft.NetworkLoadBalancingClusters.PowerShell.NetworkInterface
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
Cluster Property System.String Cluster {get;set;}
ClusterPrimaryIP Property System.String ClusterPrimaryIP {get;set;}
ClusterSubnetMask Property System.String ClusterSubnetMask {get;set;}
DhcpEnabled Property System.Boolean DhcpEnabled {get;set;}
InterfaceIP Property System.String InterfaceIP {get;set;}
InterfaceName Property System.String InterfaceName {get;set;}
InterfaceSubnetMask Property System.String InterfaceSubnetMask {get;set;}
NlbBound Property **System.Boolean NlbBound {get;set;}**