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

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

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 Account.