Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Script Delete User Profiles

Hello,

Looking for a scipt to delete user profiles - hopefully in UNIX but any
automated way will work.

Need to exclude administrator and shared folders or any system folders under /Users

The following is a rough example of what is being worked on but not sure how to exclude administrator from the rm statement.
I am still new to macs thanks

#!/bin/bash

#This deletes all Macintosh profiles except admin,share,.localized


Profile="$Users/*"

Admin="

for Profile in $Profile
do
if [[ -e $Profile ]]
then
rm -rf $Profile

fi
done
exit

IMAC, Mac OS X (10.5.5)

Posted on Apr 28, 2010 8:51 AM

Reply
4 replies

Apr 28, 2010 3:34 PM in response to MacUserKHS

Try the Unix or AppleScript forums under OS X Technologies. BTW, on Macs there are only user accounts, no profiles.

Since you're new, see

Switching from Windows to Mac OS X,
Basic Tutorials on using a Mac,
Mac 101: Mac Essentials,
Anatomy of a Mac,
MacTips, and
Switching to the Mac: The Missing Manual, Snow Leopard Edition.

Additionally, *Texas Mac Man* recommends:

Quick Assist.
Welcome to the Switch To A Mac Guides,
Take Control E-books, and
A guide for switching to a Mac.

Apr 28, 2010 5:49 PM in response to baltwo

Hello should have been more clear. We are intergrated with an active directory domain and the profiles are the home directories of the users. I need to delete them from the school IMAC's at the end of the year. Each user has a unique id which generates a folder under users. This is like the Windows version of profiles.

Thnaks,

Script Delete User Profiles

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.