Hi People,
I'm new to casper and have been going through this forum to get a better idea of how policies and scripts work but I'm having a problem with the below mentioned script (which I found here and and have modified it to work in our environment)
When I copy it to a workstation and run it through terminal as sudo it all works.
But when I create a policy and have the script copied via Casper Admin only the MCX removal files portion of the script is working. The deleting of the home directories doesn't work.
I'm hoping someone can shed some light on this for me.
Thanks in advance for view and assisting!
# Loop through users with homes in /Users; exclude any accounts you don't want removed (i.e. local admin and current user if policy runs while someone is logged in)
for username in `ls /Users | grep -v admin | grep -v Shared`
do
echo "Removing user profile: $username"
# dscl . delete /Local/Default/Users/$username
rm -rf /Users/$username
done
# Remove MCX files
echo "Removing MCX files"
rm -rf "/Library/Managed Preferences"