Hi,
I'd like to see last reboot time of different collection, so I want to target a query to those different collection.
What query could I use?
Please advise.
Technology Tips and News
Hi,
I'd like to see last reboot time of different collection, so I want to target a query to those different collection.
What query could I use?
Please advise.
Hello,
You wish to build a collection, based on last boot time?
This information would not be very reliable since it would be based on your Hardware Inventory. And based on how often your Hardware Inventory is set to run, how much "luck" you have had with timing it with the reboots ...
I would not attempt to build this.
Hi,
I have used this in the past:
http://blog.coretech.dk/kea/query-and-report-all-workstations-that-havent-rebooted-the-last-7-days/
Thanks, but when I use this query:
SELECT DISTINCT SMS_R_System.Name, SMS_G_System_OPERATING_SYSTEM.LastBootUpTime, SMS_G_System_OPERATING_SYSTEM.Caption
FROM SMS_R_System INNER JOIN SMS_G_System_OPERATING_SYSTEM ON SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId
to a collection of 8 pc's, I can see boot times for today 11:52 and most others are from yesterday. That would mean I had that much luck that all hardware inventories would have ran today/yesterday?
Yes that sounds about right.
You could check to see if all the devices have ran a hardware from an age specified.
Might be easier to look in SQL,
I always have hardware inventory running every 24 hours, what is your's set to.
Try Configuration baseline, using powershell script below.
#Use Get-WMIObject to read the Win32_OperatingSystem class
$Win32OS = Get-WMIObject -Class Win32_OperatingSystem
#Calculate the uptime based on the LastBootUpTime property and the local date and time
$Uptime = $Win32OS.ConvertToDateTime($Win32OS.LocalDateTime) - `
$Win32OS.ConvertToDateTime($Win32OS.LastBootUpTime)
#Check if the total number of days in our uptime calculation is greater than 7
#Return a 0 for a non-compliant system and a 1 if the system is compliant
if ($Uptime.TotalDays -gt 7){
$compliant = 0
}
else {
$compliant = 1
}
echo $compliant