How to check last restart in JSS (Jamf)

Mouthbaten_1911
New Contributor III

How do I check to see when the user restarted the computer in JSS ?

5 REPLIES 5

stevewood
Honored Contributor II
Honored Contributor II

@Zohaib24 AFAIK to do this you'll need to use an Extension Attribute. You can grab either the uptime of a computer or the last reboot. You can read about either method in this thread:

Create an extension attribute that reports last reboot for a mac

I have an EA for both methods, both from that discussion, but the reboot one is this:

#!/bin/bash

echo "<result>$(date -jf "%s" "$(sysctl kern.boottime | awk -F'[= |,]' '{print $6}')" +"%Y-%m-%d %T")</result>"

Sandy
Valued Contributor II

00cbc26a8d734fdfab1c30c6f84e0278

stevewood
Honored Contributor II
Honored Contributor II

@Sandy ah, yes, forgot about that. However, you have to have Computer Usage enabled for that data to be gathered. We do not collect that data here, hence the EA.

Sandy
Valued Contributor II

And if you want to know where to check or un-check that option :

9a2e30bee6164bbdaba907a4675ae58c

jshawnbell
New Contributor

Zohaib24's solution worked like a charm. Thanks!