Powercli script to get host connection state

Oneliner PowerCLI-

Powercli script to get  ESXi hosts connection state such as Host disconnected or nonresponding.

Get-VMHost |Where{$_.ConnectionState -eq ‘Disconnected’} |Select Name, ConnectionState

You can also try below to send output to mail.

Send-MailMessage -from ‘mail@.test..com’ -to “mail@.test.com.com’ -Subject ‘Report’ -smtpserver ‘smtp server’

Leave a Reply

Your email address will not be published. Required fields are marked *