I created a vbs that looks like this:
strComputer = "." Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery _ ("Select * from Win32_OperatingSystem") For Each objOS in colOperatingSystems dtmBootup = objOS.LastBootUpTime dtmLastBootupTime = WMIDateStringToDate(dtmBootup) dtmSystemUptimeH = DateDiff("h", dtmLastBootUpTime, Now) dtmSystemUptimeS = DateDiff("s", dtmLastBootUpTime, Now) dtmSystemUptimeM = round(dtmSystemUptimeS/60,0) Wscript.Echo dtmSystemUptimeH Next Function WMIDateStringToDate(dtmBootup) WMIDateStringToDate = CDate(Mid(dtmBootup, 5, 2) & "/" & _ Mid(dtmBootup, 7, 2) & "/" & Left(dtmBootup, 4) _ & " " & Mid (dtmBootup, 9, 2) & ":" & _ Mid(dtmBootup, 11, 2) & ":" & Mid(dtmBootup, _ 13, 2)) End Function
Which reports how many hours since the last reboot. I created a software inventory item called "CI - Last Reboot" and attached the vbs to the inventory. I then used the File sync under distribution to sync the vbs to all windows pc's to a folder called c:\admin\scripts and added a shell command to the software inventory item that looks like this:
ShellCommandtextreturn(cmd.exe /c cscript //nologo "c:\admin\scripts\uptime.vbs")
That then populates the Custom inventory field with only a number... which is in hours format.
Once that is in place a smart label can query the number and you can easily say more than x amount of hours ect. And if you want then can create a "Nag" alert for users that are part of a label that indicates no reboot in x amount of time. (this all takes 2-3 inventories before the field begins to populate)
I also used a similar setup for my tiered patching which goes in place next week if there is any interest in that let me know, I'd be happy to share the scripts and config for it.