Posted in
Windows Powershell,
Windows Server |
1 Comment | 6,444 views | 19/07/2014 22:43
You can search VMs with specific VLAN id with following script:
1
2
3
4
5
| $ClusterNodes = Get-Cluster | Get-ClusterNode
foreach ($ClusterNode in $ClusterNodes)
{
Get-VM -ComputerName $ClusterNode | Where {$_.NetworkAdapters.VlanSetting.AccessVlanId -eq "173"}
} |
$ClusterNodes = Get-Cluster | Get-ClusterNode
foreach ($ClusterNode in $ClusterNodes)
{
Get-VM -ComputerName $ClusterNode | Where {$_.NetworkAdapters.VlanSetting.AccessVlanId -eq "173"}
}
That will give you VM list which has VLAN 173.