Hi Folks,
I am looking for a script to pull out how many VMs in a VC have snapshot with Cluster info in CSV format.If possible snapshot size too
thanks
vmguy
Try something like this
$report = foreach($vm in Get-VM){ Get-Snapshot -VM $vm | Select @{N="Cluster";E={(Get-Cluster -VM $vm).Name}}, @{N="VM";E={$vm.Name}}, Name, SizeMB } $report | Export-Csv "C:\report.csv" -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
$report = foreach($vm in Get-VM){ Get-Snapshot -VM $vm | Select @{N="Cluster";E={(Get-Cluster -VM $vm).Name}}, @{N="VM";E={$vm.Name}}, Name, SizeMB } $report | Export-Csv "C:\report.csv" -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD,
You are awsome
thanks
vmguy
LucD,
Can you modify a little to include the ESX/ESXI host name too columns in this.
thanks
vmguy
Sure, try this
$report = foreach($vm in Get-VM){ Get-Snapshot -VM $vm | Select @{N="Cluster";E={(Get-Cluster -VM $vm).Name}}, @{N="Host";E={(Get-VMHost -VM $vm).Name}}, @{N="VM";E={$vm.Name}}, Name, SizeMB } $report | Export-Csv "C:\report.csv" -NoTypeInformation -UseCulture
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference