Powershell script to list the Virtual Machines in SCVMM




Windows PowerShell (SCVMM)

SCVMM One-liner command 1:
  Outputs the VMName, VM Configuration File path, VHDCount, VHD Location,
VHDSize, MaxVHDSize, Cluster for all VMs managed by the SCVMM server
connected by PowerShell (in a single line)
$report = @(); $vms = get-vm; foreach ($vm in $vms){foreach ($vhd in $vm.VirtualHardDisks){$maxvhdsize = [math]::Round($vhd.MaximumSize/1024/1024/1024,1)

0 Comments