VMware Cloud Community
godaba
Contributor
Contributor

Export snapshot report to .csv file


Hi Everyone,

Trying to get the list of snapshot details associated with VM's in vCenter, want to export the information in CSV format by sending a automated mail. 

Please suggest me for any _powercli script.

0 Kudos
4 Replies
maksym007
Expert
Expert

Install simply RVtools there you will find all needed info 

also will be able to extract csv or excel file

0 Kudos
godaba
Contributor
Contributor

Thank you for the information,

We need an automated mail trigger to the admins and Server Owner's as well. Any help!

0 Kudos
TheSleepyAdmin
Enthusiast
Enthusiast

Hi 

This should probable be in the PowerCli page but you can use 

get-vm | get-snapshot | Select-Object vm, name,created,description | Export-Csv c:\temp\DailySnapshotReport.csv -NoTypeInformation

 to create the csv file. If you want any additional properties you will need to add to the select-object.

You can then use the send-mailmessage command to attached the csv file. 

Send-MailMessage -From from@domian.com -To to@domian.com -Subject "VMware Snapshot Report" -Body "VMware Snapshot Report attached"  -SmtpServer smtp_server_Address -Attachments c:\temp\DailySnapshotReport.csv
Tags (1)
0 Kudos
godaba
Contributor
Contributor

Hi,

Thank you so much for your inputs.

Still its not working its sending a mail like below, with out any information.

godaba_0-1673290492430.png

Previously we used get the mails like below.

godaba_2-1673291050881.png

It's happening after we upgraded the vCenter to 7.x .

Scripts are running from a Remote Windows Server as a Schedule Tasks. 

Other vCenter we have with 6.5 Version, reports ( automated mails) are good.

Please suggest me, if you have any KB's.

 

 

 

0 Kudos