Does anybody know how to remove a user in single user mode on a computer running snow leopard. I have a script for leopard and its not working in snow leopard. Thanks.
Hi Andy, I have no issues creating or deleting users from the command line using
dscl . -list /groups GroupMembership | grep testuser
dscl . -delete /groups/testusersgroups GroupMembership testuser replace testusergroups with group results from first line.
dscl . delete /users/testuser
Maybe if you post your script so we can have a look.
Here are my sciprts for 10.5 and 10.4 (I dont have the source)
[url]http://files.me.com/andyboutte/qlerrq[/url]
And here is what we used to use before we had the script made:
10.4
mout -uw /
cd /private/var/db/netinfo
rm -r local.nidb
rm ../.AppleSetupDone
cd /Users
ls
rm -r username
shutdown -r now
10.5
mout -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist & dscl localhost
cd /Local/Defualt/Users/
rm username
exit
rm. /private/var/db/.AppleSetupDone
cd /Users/
rm -r username
shutdown -r now
When I tried what you posted it gave me an error on the second line. I am guessing that I am getting the testusergroup wrong. When you say ‘from the first line’ I am not 100% sure I know what you referring to. Any help would be greatly appreciated. Thanks.
Hi again, the dscl . -list /groups GroupMembership | grep testuser line looks for any groups that testuser is a member of.
so for example dscl . -list /groups GroupMembership | grep admin on a test machine could return
so for a user admin the 2nd line
dscl . -delete /groups/testusersgroups GroupMembership testuser
should look like
dscl . -delete /groups/_lpadmin GroupMembership admin
would delete admin from the group _lpadmin
Comments are closed