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

Badges
MCSE
Community

Cozumpark Bilisim Portali
Getting VM’s Passthrough disks and Cloud information via PowerShell
Posted in Virtual Machine Manager, Windows Powershell, Windows Server | No Comment | 1,549 views | 23/12/2013 11:15

This script requires SCVMM 2012 SP1. You should execute it on SCVMM PowerShell:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$Pt = 0;
$VMs = Get-VM
foreach ($VM in $VMs)
{
	$VMName = $VM.Name
	$Cloud = $VM.Cloud
 
	if ($VM.PassThroughDisks)
	{
		$PassThroughDisk = "True"
		Write-Host $VMName
		Write-Host $Cloud
		$Value = $VMName + ";" + $Cloud
		Add-Content -Value $Value -Path C:\yusufozt\PassThroughDisks.txt
		$Pt++
	}
}
Write-Host "Total VM: $Pt"

You can export into Microsoft Excel for a table view.



Leave a Reply