delete /groups/staff GroupMembership usernamedscl. delete /groups/.1 GroupMembership usernamedscl. delete /groups/admin GroupMembership usernamedscl.
delete /groups/_lpadmin GroupMembership usernamedscl. delete /groups/_appserverusr GroupMembership usernamedscl. delete /groups/_appserveradm GroupMembership usernamedscl. = # /bin/sh# check and mount the hard drive/sbin/fsck -fy/sbin/mount -uw /#determine which OS we're on - clunky but it works.x_5=`sw_vers -productVersion | grep "10.5"`x_4=`sw_vers -productVersion | grep "10.4"`x_3=`sw_vers -productVersion | grep "10.3"`#if we're 10.5, remove user account this wayif ] then# start directory serviceslaunchctl load /System/Library/LaunchDaemons/# remove user from directory servicesdscl. PS - I'm sure I looked at the same sources as the OP when I wrote this - I don't want to take credit for the methodology. Really wish this functionality could get rolled into AppleJack. My scripting is pretty rusty but it gets the job done I'd love to see someone clean it up a bit. Also the script removes itself, and the name and location are hardcoded, so adjust those as well. Please note that I hard coded the user account someone could easily modify it to find it automatically or as a command line argument. Drop it in the root level of the hard drive, then boot to single user mode and run it.
Here's a little script I wrote that will clear user info on recent versions of OS X. Please know what you're doing before trying this - the dscl command will let you wreak havoc on your system if you're not careful! Much of this was taken from this entry in Robert Daeley's blog at O'Reilly. All done? Type reboot to reboot the system or shutdown -h now to shut down the system.AppleSetupDone file in /var/db to cause the Setup Assistant to run when next booted.
list /groups GroupMembership | grep username - repeat for each group except for the user's own group.