SCVMM – Virtual Machine Status Script in Powershell
You can’t find this any other website because I wrote it :) Please leave a comment if it works for you.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Add-PSSnapin -name Microsoft.SystemCenter.VirtualMachineManager Get-Vmmserver localhost # VM Status Script - Yusuf Ozturk # http://www.yusufozturk.info $VMProp = Get-VM | Select-Object -Property Name,Status foreach ($i in $VMProp) { $VMName = $i.Name $VMStatus = $i.Status $contentStatus = ' <status>' + $VMStatus + '</status>' clear-content -path "C:\Program Files\Microsoft System Center Virtual Machine Manager 2008\wwwroot\Status\$VMName.xml" add-content -path "C:\Program Files\Microsoft System Center Virtual Machine Manager 2008\wwwroot\Status\$VMName.xml" -value '<?xml version="1.0"?>' add-content -path "C:\Program Files\Microsoft System Center Virtual Machine Manager 2008\wwwroot\Status\$VMName.xml" -value '<serverSettings>' add-content -path "C:\Program Files\Microsoft System Center Virtual Machine Manager 2008\wwwroot\Status\$VMName.xml" -value $contentStatus add-content -path "C:\Program Files\Microsoft System Center Virtual Machine Manager 2008\wwwroot\Status\$VMName.xml" -value '</serverSettings>' } |
You could run this as cronjob. You can see status in http://scvmm.domain.com/status/$vmname.xml.
Tags: hyper-v status script, powershell add-content, powershell foreach statement, scvmm powershell, scvmm vm status
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply