Create a Custom Attribute Script
Learn how to create a custom attribute script in Intune to collect specific information from managed macOS devices.
Last Reboot Time Script
#!/bin/bash
# Script to get the last reboot time formatted
# Extracting the timestamp from the sysctl command
timestamp=$(sysctl kern.boottime | awk '{print $5}' | tr -d ',')
# Converting the timestamp to a formatted date
formatted_date=$(date -r $timestamp "+%Y-%m-%d %H:%M:%S")
echo "Last Reboot Time: $formatted_date"Configuring the Custom Attribute
Viewing Results
Last updated
Was this helpful?



