Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bulk Deleting of User Accounts and Files




Am 07.08.2006 um 18:07 schrieb Adam Gerson:

We have to delete about 100 users from our directory of around 1000. I need

to delete the OD user records as well as the home folders. Given a text file

with short names does anyone have a script that could accomplish this task?


I could even write my own if I knew the command line code for deleting a

user account. In the command line user guide I see that it explains how to

use dscl in interactive mode to do this. To include it in a script I need a

non-interactive way to do it.


Adam



Maybe you don't need it anymore (I'm a little bit late), but you could use dscl like this:

dscl -u diradmin -P password-of-diradmin "/LDAPv3/127.0.0.1" -delete /Users/username

Including theĀ  diradmin password in the script is probably not the best thing to do from a security point of view, but if you just run the script once and then delete the pw from the script... I'm afraid that f you don't include it, it will prompt you for the pw for every single user it deletes. Not very practical. Didn't try it, though.

Hope this helps, Tina
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macos-x-server mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden

References: 
 >Bulk Deleting of User Accounts and Files (From: Adam Gerson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.