How to find VMware ESX(i) servers that need a reboot using PowerCLI
January 2, 2012 5 Comments
If you install patches to your ESX(i) servers you will probably have to reboot them. But if you don’t reboot them right after installing the patches, how can you find the servers that are patched and waiting for a reboot?
VMWare ESX(i) servers that are waiting for a reboot have the “Reboot Required” message in the Summary tab in the VMware vSphere Client. But if you have hundreds of ESX(i) servers, you don’t want to click through all your ESX(i) servers Summary tabs. You need to automate this task.
The PowerCLI one-liner from listing 1 will show you the names of all the ESX(i) servers that need a reboot.
Get-View -ViewType HostSystem -Property Name,Summary.Rebootrequired -Filter @{"Summary.RebootRequired"="True"} | Select-Object -Property Name
Listing 1. PowerCLI script to list the names of the ESX(i) servers that need a reboot
Pingback: The Need To Reboot ESXi Hosts After vCenter Upgrade | Long White Virtual Clouds
Pingback: vCoffee Links #13 – Lots of good vStuff!!! » vHersey - VCDX Two to the Seventh Power (#128)
Pingback: PowerShell/PowerCLI to Find ESX Hosts Needing a Reboot – Phasmid LLC
Muchas gracias. ?Como puedo iniciar sesion?
You can connect to your vCenter Server or ESXi servers with the Connect-VIServer cmdlet.