Quantcast
Channel: VMware Communities : All Content - VMware PowerCLI
Viewing all articles
Browse latest Browse all 16717

Scheduled maintenance mode script with email status report

$
0
0

Hello Guys,

 

I need your help, i need a powercli script to put some esxi host in maintenance mode at a specifique Date/Hour.

 

Don't know if we can do it with powercli or if i need to use the windows scheduler with something like ;

 

$serverlist = gc 'inputFile.txt'

 

Foreach ($vmhost in $serverlist)

{

$esxcli = Get-EsxCli -vmhost $vmhost

$maintenance=$esxcli.system.maintenanceMode.set($true)

}

 

I also need an email report at the end of the script like :

 

ESX1 : Maintenance OK

ESX2 : Maintenance KO ## Maybe with a timeout trigger or something like that

ESX3 : Maintenance OK

 

If please someone can help    thanks


Viewing all articles
Browse latest Browse all 16717

Trending Articles



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