Skip to main content

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

@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 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.


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


Zohaib24's solution worked like a charm. Thanks!