search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Windows Powershell, Windows Server | No Comment | 2,842 views | 19/06/2013 10:29

You can use this script to get virtual machines which has Virtual HBA support.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$Servers = Get-Content C:\hosts.txt
foreach ($Server in $Servers)
{
	$VMs = Get-VM -ComputerName $Server
	Write-Host $Server
	foreach ($VM in $VMs)
	{
		$TestFC = $VM | Select -expand FibreChannelHostBusAdapters
		if ($TestFC)
		{
			$Value = $VM.Name + "," + $VM.ComputerName
			Add-Content -Value $Value -Path C:\Servers.txt
		}
	}
}

I’ve added all my Hyper-V hostnames into C:\hosts.txt to use this script.