This custom report can be useful for identifying workstations that have not rebooted recently. I use this report to identify users that may not have received the latest Group Policy settings or other items that require a reboot to be enforced. As well a report query, you must also add a prompt (no code necessary) named ‘Days‘. This is the variable that will store the amount of days you wish to search back. Set the default to 7 and do not allow nulls.
SELECT CS.Name0 AS [Hostname], CS.UserName0 AS [Last User], DateDiff(Day, OS.LastBootUpTime0, GetDate()) AS [Uptime (in Days)], OS.LastBootUpTime0 AS [Last Reboot Date], WS.LastHWScan AS [Last Hardware Inventory] FROM DBO.v_GS_WORKSTATION_STATUS WS LEFT OUTER JOIN DBO.v_GS_Operating_System OS ON WS.ResourceID = OS.ResourceID LEFT OUTER JOIN DBO.v_GS_COMPUTER_SYSTEM CS ON CS.ResourceID = OS.ResourceID LEFT OUTER JOIN DBO.v_GS_SYSTEM SYS ON SYS.ResourceID = OS.ResourceID LEFT OUTER JOIN DBO.v_R_SYSTEM RSYS ON RSYS.ResourceID = CS.ResourceID WHERE SYS.SystemRole0 = 'Workstation' AND DateDiff(Day, OS.LastBootUpTime0, GetDate()) > @Days ORDER BY CS.Name0
No comments yet.
Leave a comment.