Looking for a new script that I can run on log in to update username status in Casper.
Thanks
Looking for a new script that I can run on log in to update username status in Casper.
Thanks
Best answer by karthikeyan_mac
We use the below script to update the username. This script runs weekly once between 10AM - 12PM and 2PM-4PM. This will not run recon or update the username if the machine is in login screen.
#!/bin/sh
# Script to report the Username if users logged in
# Created by Karthikeyan Marappan on 10/21/2015
loggedInUser=$( ls -la /dev/console | cut -d " " -f 4 )
if [[ $loggedInUser != root ]];
then
/usr/sbin/jamf recon -endUsername $loggedInUser
else
echo "Login Screen, No user logged in"
fi
exit 0
Thanks & Regards,
Karthikeyan
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.