Skip to content

Instantly share code, notes, and snippets.

@smashism
Created November 5, 2025 18:46
Show Gist options
  • Select an option

  • Save smashism/c2eb02613de4a3c75d0331642d594591 to your computer and use it in GitHub Desktop.

Select an option

Save smashism/c2eb02613de4a3c75d0331642d594591 to your computer and use it in GitHub Desktop.
Gets the latest line from the OktaVerify.log and displays it on a Jamf Pro computer record when configured as an Extension Attribute
#!/bin/bash
# Extension attribute to read in last line of Okta Verify log file
# Get the local user account
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
# Okta Verify log file
oktaLogs="/Users/${currentUser}/Library/Group Containers/B7F62B65BN.group.okta.macverify.shared/Logs/OktaVerify.log"
if [ -f "$oktaLogs" ]
then
/bin/echo "<result>$(/usr/bin/tail -n -1 "$oktaLogs")</result>"
else
/bin/echo "<result></result>"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment