This procedure describes a way to automate the task to retrieve the list of the all the hosts on “Reboot Required” state using a Power CLI command.
vCenter Server 7.x
vCenter Server 8.x
To obtain the list of the hosts needing reboot connect to the vCenter on Power CLI and execute the following command:Get-View -ViewType HostSystem -Property Name,Summary.Rebootrequired -Filter @{"Summary.RebootRequired"="True"} | Select-Object -Property Name