VMware Cloud Community
selva_0087
Contributor
Contributor

Mail the powercli output

I'm little new to powercli.

I have created a script to list all the ESXi hosts across our vCenters which are not in Connected state. I'm able to get the output as a text format and was able to schedule it in Windows Task scheduler. But I would like to automate further by mailing the output to my mail ID. How can I achieve that?

Tags (1)
0 Kudos
1 Reply
LucD
Leadership
Leadership

You can use the Send-MailMessage cmdlet for that.

You can provide the report in the Body or as an attachment to the email.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference