Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 230336

Re: Create a report to list VMs with snapshots

$
0
0

Run the below script to get all VMs of all vCenters with Snapshot details :

 

$vm_snapshot = @()

$vm_consolidate = @()

 

$vc = get-content d:\snapshot\serverlist.txt

foreach ( $vcs in $vc)

{

connect-viserver $vcs

 

$VMs = get-vm

 

$vm_consolidate += $VMs | get-harddisk | select @{ n = "Virtual Center";e= { (($_.uid).split("@")[-1]).split(":")[0] }}, Parent,name,StorageFormat,Filename

 

$vm_snapshot +=  $VMs | get-snapshot | sort created |select @{"N" ="VirtualCenter";"E" = {$vcs}},VM,name, @{"N" ="Created";"E" = {$_.created.tostring("d")}}, description, sizeMB, powerstate

 

disconnect-viserver $vcs

}

 

$vm_consolidate | export-csv d:\snapshot\diskinfo.csv

 

$vm_snapshot | export-csv d:\snapshot\snapshotsinfo.csv


Viewing all articles
Browse latest Browse all 230336

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>