SCVMM – Virtual Machine List Script in Powershell
This is a basic script about listing vms in Powershell. Output will be Name and Operating System.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Add-PSSnapin -name Microsoft.SystemCenter.VirtualMachineManager Get-Vmmserver localhost # VM List Script - Yusuf Ozturk # http://www.yusufozturk.info $VMProp = Get-VM | Select-Object -Property Name,OperatingSystem clear-content -path "C:\VMList.txt" foreach ($i in $VMProp) { $VMName = $i.Name $VMOprs = $i.OperatingSystem.Name add-content -path “C:\VMList.txt” -value $VMName add-content -path “C:\VMList.txt” -value $VMOprs add-content -path “C:\VMList.txt” -value ‘‘ } |
You could add more property with using other property names.
Tags: powershell vm listing script, scvmm listing, scvmm vm list powershell, vm list script, vm listing
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