Jump to content

Recommended Posts

Posted

-Open Terminal on an affected machine:

-Type:

-cd /Users

-sudo rm -rf name* (to delete all 'name' users for instance)

-It'll ask for the admin password.

 

Certain versions of MacOS eat disk space. It's a bug.

Posted

I've had to do this on mac with small Hard drives

 

you might find first listing the contents on the users folder in date order by using

 

ls -lt

 

them you can remove the oldest folders from the bottom of the list

Posted (edited)

This is the script I run on boot with JAMF on our IT Lab Mac's to delete the local user profiles. You should be able to adapt to what you need. The code does not put things on new lines correctly when posted, so I've attached a screenshot of it formatted correctly.

Screenshot 2023-06-26 at 14.41.38.png

 

sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow PasswordExpirationDays 0Users_Array=( `ls /Users | grep -v Shared | grep -v localadmin` )for user in "${Users_Array[@]}"do    if [ "${user}" == "${User_Name}" ]; then        echo "skip user ${user} as they are logged on."    else        dscl . -delete /Users/${user}        rm -fR /Users/${user}    fidone

Edited by 2ilent8cho
Posted (edited)
This is the script I run on boot with JAMF on our IT Lab Mac's to delete the local user profiles. You should be able to adapt to what you need. The code does not put things on new lines correctly when posted, so I've attached a screenshot of it formatted correctly.

[ATTACH=CONFIG]69311[/ATTACH]

 

sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow PasswordExpirationDays 0Users_Array=( `ls /Users | grep -v Shared | grep -v localadmin` )for user in "${Users_Array[@]}"do    if [ "${user}" == "${User_Name}" ]; then        echo "skip user ${user} as they are logged on."    else        dscl . -delete /Users/${user}        rm -fR /Users/${user}    fidone

 

 

Definitely want something like this but only if 30 days or older.

 

Don't want to delete students active garage band projects!

Edited by plumyeti

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...