Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DarkMx-6

macrumors newbie
Original poster
Jul 16, 2019
3
0
Hello,

We run a macOS server Yosemite at a high school and I need to clean all the student profiles before the year starts in the fall.

What is the best way to go about doing this? I have removed the profile then gained ownership of their files so I can delete them but that is a really long process for all the students I have to do.

Disclaimer I know very little about macOS server or open directory

Thank you!
 

hobowankenobi

macrumors 68020
Aug 27, 2015
2,116
928
on the land line mr. smith.
Both actually

Thinking about this a bit more, I would suggest caution.

All the options I am aware of are command line, not for Unix beginnners...both on the client and server. Here's a thread for Mac admins discussing a script to delete all users automatically.

Many larger institutions simply re-image or re-deploy lab/workstation/client computers once a year, to refresh everything, including user accounts AND home directories.

On clients, keep in mind there are two seperate functions:

  1. Removing user accounts/profiles
  2. Removing user home directories

Via command line, which is faster than through the GUI:

  1. Command to delete a user accounts/profile: sudo dscl . -delete /Users/<whatever>
  2. Command to delete a home directory: sudo rm -rf /Users/<whatever>

Keep in mind both are instantly destructive! Test on things you can blow up.

-----

As for server....I don't recall, does the Server app allow for bulk user deletion? Sounds like no...
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.