Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #376999
    a_frayn
    Participant

    At the school I’m at, we don’t keep our students’ user accounts on Mac OS X between years. As the school year’s about to start, I went to delete them all.

    I deleted everyone between A-Mr. and from Ms.-Z. I forgot about our one Dr. on staff. Fortunately, she’s on Mat leave, and is using her work computer at home, so I don’t need it recreated RIGHT THIS SECOND, but the sooner the better.

    We back up with Time Machine. It seems to work beautifully. However, I noticed that unlike other Apple software, you can’t just use Time Machine in that application. Sigh!

    How does one recover the user account?

    And now for the obligatory smashing my head against a desk yelling “stupid!”

    #377013
    a_frayn
    Participant

    Anyone know where the database file is kept?

    #377261
    tlarkin
    Participant

    I wrote this script a while ago to clean off machines that were to be loaned out on a temporary basis. This works in 10.5 and I must warn you, it will delete everything in /Users. This is why I keep all my local admin accounts hidden away in /prviate/var.

    Use at your own risk

    [code]
    #!/bin/bash

    #loop through /Users and delete every account, ensure they are removed from the admin group and all data is gone
    #this will completely scrub out /Users

    for a in `/bin/ls /Users | grep -v “Shared”` ; do

    #remove the account from admin group if applicable

    /usr/bin/dscl . -delete /Groups/admin GroupMembership $a

    #remove user from directory services, local

    /usr/bin/dscl . -delete /Users/$a

    #remove all user data

    /bin/rm -rf /Users/$a

    /bin/echo “done”

    exit 0
    [/code]

    Use this at your own risk, and definitely test it out first.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Comments are closed