Skip to main content
Question

Delete User Profiles issues while using Jamf Connect


Forum|alt.badge.img+4

I am using a script to remove student profiles from devices. I was testing the script and all seems well. My admin accounts are staying on the device, while removing unnecessary profiles. However, when I logged in at the Jamf Connect window I received the whole "your azure password does not match our local password" message......

How can this be if I deleted my profile? Something, somewhere on the machine is holding onto my credentials after deletion. What's strange is the same script removed my co-worker's profile and he can log in. Jamf connect says "creating your account." But I can't log in without supplying the old password. Even when I do enter the old password, it says it's incorrect... Is it my script?

 

# Get a list of all user accounts
user_list=$(dscl . -list /Users | grep -v '^_')

# Specify the admin account(s) that you want to exclude
excluded_users=("admin1" "admin2" "root" "management account")

# Loop through the user list and delete user profiles except admin accounts
for user in $user_list; do
if [[ ! " ${excluded_users[@]} " =~ " ${user} " ]]; then
if [[ "$user" != "Shared" ]]; then # Exclude 'Shared' user
echo "Deleting user profile for: $user"
sudo sysadminctl -deleteUser "/Users/$user"
sudo rm -rf "/Users/$user"
fi
fi
done

 

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings