Querying to find Computers requiring restart from Patch Management
Created: 08 Nov 2012 | Updated: 09 Nov 2012 | 4 comments
This issue has been solved. See solution.
Hi all,
I'm working on an automated reboot script and am having a very hard time finding out where in the database I can find the marker for a computer requiring a restart due to recent patches. If you go to the Patch Management screen and select the link "Computers Requiring Restart" you can see the kind of data I'm looking for.
Anyone figure this out yet?
Thanks
Discussion Filed Under:
Comments 4 Comments • Jump to latest comment
Hi garfaldo,
Actually, it's quite tricky to extract this data from Database. The easiest way would be to run AexPatchUtil.exe with /Reboot parameter on each client - reboot will occur only if it is required by Patch Plugin on each client. Exact command for this would be:
> [Altiris Agent]\Agents\PatchMgmtAgent\AexPatchUtil.exe /r /q
Please, let me know if this approach suites Your needs.
Best Regards,
Sergej
Hi Sergej,
Thanks for the reply. So where is the dashboard pulling that data from then?
The method you described wouldn't really suit our needs because we have to email users in advance notifying them that need to reboot. I know there is some flag in the registry that has info if the computer needs a reboot... so I was thinking of doing a custom inventory on that, but I'd prefer to use existing information if possible.
Thanks
garfaldo,
Just to clarify - are Reboot Notifications with Reboot Deferral option also do not suite Your needs?
They can be set in Settings -> Agents/Plugins -> Software -> Patch Management -> Windows -> Default Software Plugin Policy, Notification tab.
You can, for example, set 'Allow user to defer' for couple of days, and 'Show Pending Message'. In this case, User will be presented with 'Reboot Deferral' notification, allowing to defer reboot up to specified period, and when 'Reboot Deferral' is over - Reboot Pending message will be displayed - on this stage, reboot is inevitable.
This would allow affected users be aware of the upcoming reboot.
However, if this method is not that appropriate for Your case, possibly You could use the following query to retrieve list of machines, that require reboot:
set rowcount 0;
select DISTINCT
cn.Name as [Computer Name]
from Inv_AeX_SWD_Execution_Summary ex
join ItemReference ir on ex.AdvertisementId = ir.ParentItemGuid
and ir.Hint = 'swu'
join dbo.vSoftwareUpdateInventoryRuleAssociations ira on ir.ChildItemGuid = ira.SWUGuid
join dbo.vRM_Computer_Item cn on ex._ResourceGuid = cn.Guid
and cn.OwnerNSGuid = (select tns.Guid from dbo.vThisNS tns)
inner join vPMCore_ComputersPendingRebootByPackage prp on prp._ResourceGuid = ex._ResourceGuid
and prp.PackageId = ex.PackageId
where ira.SupersededBy is null
order by cn.Name
This query can be used in Automation Policy, for example.
Regards,
Sergej
Thanks so much for that reply Sergej. I thought about using the built-in deferral feature, but we want to make this part of an existing script which also handles reboot maintenance periods.
By the way I NEVER would have figured out that query.. hah. Thanks again.
Would you like to reply?
Login or Register to post your comment.