How to find VMware ESX(i) servers that need a reboot using PowerCLI

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

About Robert van den Nieuwendijk
Robert van den Nieuwendijk is a freelance senior systems engineer with over 30 years of experience in the IT industry. He focusses on VMware vCloud Suite and Microsoft Windows Server. He tries to automate as much of his work as possible using Microsoft PowerShell. Robert is the author of the books “Learning PowerCLI” and “Learning PowerCLI – Second Edition.” Robert is a frequent contributor and moderator at the VMware VMTN Communities. He has a bachelor degree in software engineering and holds the following IT certifications and accreditations: VSP 2016, VTSP 2016, VCP4-DCV, VCP5-DCV, VCP6-DCV, VCP6-CMA, VCA-Cloud, VCA-WM, VCA-NV, VMSP, VMTSP, ZCS, ZCP, ZCP-Cloud, MCSE, MCSA, MCP, MCP+I, PRINCE2 Foundation and ITIL Foundation. In 2012, 2013, 2014, 2015, 2016, 2017, 2018 and 2019 Robert received the VMware vExpert award for his contribution to the community of VMware users over the past year. In 2017 Robert also received the VMware vExpert Cloud award. PernixData made him in 2015 a member of the PernixPro.

5 Responses to How to find VMware ESX(i) servers that need a reboot using PowerCLI

  1. Pingback: The Need To Reboot ESXi Hosts After vCenter Upgrade | Long White Virtual Clouds

  2. Pingback: vCoffee Links #13 – Lots of good vStuff!!! » vHersey - VCDX Two to the Seventh Power (#128)

  3. Pingback: PowerShell/PowerCLI to Find ESX Hosts Needing a Reboot – Phasmid LLC

  4. lxkhafqohq says:

    Muchas gracias. ?Como puedo iniciar sesion?

Leave a comment