View last time sync ran and the results

Ahadub
New Contributor II

Is there a script or EA we can use to see when the last time Jamf Connect checked the sync status of the password and what the results were?  

2 REPLIES 2

DBrowning
Valued Contributor II

if you run defaults read com.jamf.connect.state it will show you last login and password status.

AJPinto
Honored Contributor II

JAMF Connect writes everything it does to a plist in the user's profile. This is the EA I use to read information from that plist.

 

#!/bin/zsh

#*=============================================================================
#* Script Name: User_AD_Password_Expire_JAMF_Connect
#* Created: 
#* Author: 
#* Comment: Change PasswordExpirationRemainingDays to whatever you are wanting to read.
#*=============================================================================

ActiveUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }' | tr "[a-z]" "[A-Z]"`

if [ -f "/Users/$ActiveUser/Library/Preferences/com.jamf.connect.state.plist" ]; then
	Password_Expiry=$( /usr/bin/defaults read "/Users/$ActiveUser/Library/Preferences/com.jamf.connect.state.plist" PasswordExpirationRemainingDays )
	echo "<result>$Password_Expiry</result>"
else
	echo "<result>Has not signed in to JAMF Connect</result>"
fi
exit 0