Creating a custom filter for computers that require a reboot/restart
search cancel

Creating a custom filter for computers that require a reboot/restart

book

Article ID: 262339

calendar_today

Updated On:

Products

IT Management Suite Patch Management Solution

Issue/Introduction

Is there a way to create a filter that displays which computers require a reboot/restart?

There is the "Restart Status" Report (under Reports > All Reports > Software > Patch Management > Remediation Status > Restart Status) but what is needed is to be able to create a filter that shows the computers that require a reboot/restart just like the report does. This is needed so it can easily add the filter to a Target and apply it to a policy to reboot the computers, etc.

Environment

ITMS 8.6, 8.7

Resolution

Patch doesn't have a filter based on "Restart Status". Moreover, the count of Patch filters, which are used in our scenarios, is very limited:

 
The official recommendation is to use automatic restart (if required) at the end of the Patch cycle:

The following query can be used to create a custom filter:

SELECT DISTINCT cmp.Guid
FROM  vComputerResourceEx cmp
LEFT JOIN vPMCore_GetAllRetiredMachines ret ON ret.Guid = cmp.Guid
    JOIN Inv_Software_Update_Distribution_Status sus ON sus._ResourceGuid = cmp.Guid
    WHERE   ret.Guid IS NULL -- exclude the retired machine
        AND sus.DistributionStatus = 65536  -- STATE_REBOOT_PENDING
AND cmp.IsLocal = 1