Exporting VMs config using SCVMM2012   Leave a comment

A Couple of years ago I got the question – How many VMs do we have today? How much disk is presented to these ones?  How much memory do we utilize? And so on…
At the time we had VMM2008R2 pre SP1 so it was easy.

Just a couple of days ago I needed same type of info again, this time it was a little more complicated because this time it involved dynamic memory and dynamic disks and I wanted to get the “thin provisioned” disk to show how much disk that is presented and map it to what we really have.

The script will create an “Export VMs Configuration.csv” on the desktop, it will show you something like this.

Ohh almost forgot this is for VMMm2012, it “should” work on VMM2008R2SP1 as well but not tested.

Thx Niklas Goude for assistance with syntax.

$Path=”$env:USERPROFILE\Desktop\Export VMs Configuration”
get-vm -vmmserver $Hostname |
sort-object name |
select-object Name, Description, OperatingSystem, CPUCount, Memory, MemoryAssignedMB, Status,
@{n=’TotalSize (Gb)’;e={($_.totalsize / 1gb).tostring(“F02”)}},
@{n=’MaxlSize (Gb)’;e={
Foreach ($Disk in $_.Virtualharddisks) {
$TotalVirtualHD += $disk.maximumsize
($TotalVirtualHD/ 1gb).tostring(“F02”)}
HostName | export-csv -NoTypeInformation -delimiter “;” -encoding Utf8 -path $Path



Posted July 1, 2012 by jorgen brandelius in SCVMM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: