Quantcast
Channel: VMware Communities : Discussion List - ESXi
Viewing all articles
Browse latest Browse all 8132

VM Snapshot Deletion script

$
0
0

I am new with Power cli.. created below script to delete VM snapshot for particular VMs mentioned in a CSV file.

$date = get-date -format "yyyyMMdd_HHmmss"

Import-Csv C:\Output\PatchingVMsList.csv | %{Get-VM $_.Name} | Get-Snapshot -Name BeforePatching  | Remove-Snapshot -Confirm:$false -RunAsync

| Export-CSV C:\output\SnapshotRemoval-$date.csv -NoTypeInformation

But the script will show only task name and status. I need to generate a report with below details:

VM Name

Snapshot Name

Deletion start time

Deletion end time

User Id use to delete the snap

Anyone help me on this?


Viewing all articles
Browse latest Browse all 8132

Latest Images

Trending Articles



Latest Images

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