OSX server question - removing data....
#1
Scooby Regular
Thread Starter
OSX server question - removing data....
from authenticated users' desktops....
How do you do it?
To cut a long story short, my students are now done for the year, and I want to flush their desktops/local machines.
I would rather not flush completely with a new disk image tbh, as the machines are fine.
We use OSX server to authenticate to desktop (with no admin-rights for the users!)
Just trying to work out how to delete their locally stored data (that they should have deleted!)
Any ideas?
Dan
How do you do it?
To cut a long story short, my students are now done for the year, and I want to flush their desktops/local machines.
I would rather not flush completely with a new disk image tbh, as the machines are fine.
We use OSX server to authenticate to desktop (with no admin-rights for the users!)
Just trying to work out how to delete their locally stored data (that they should have deleted!)
Any ideas?
Dan
#2
Scooby Regular
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
Ah, if we were a few years ago I'd have told you to buy and install MacAdministrator
What exactly do you want to preserve? I'm guessing you'd want to do something to "/Users/<username>/Desktop/" at the very least, if not "/Users/<username>/Documents/"
The preserve thing comes into play as you may want to keep stuff in /Users/<username>/Library/ or other folders.
Do you have ARD? That might have options for this stuff built in, if not, it allows you to run a script, so you could have a shell script that iterates through /Users/ and trashes the contents of the Documents, Desktop, Music, and Pictures folders.
What exactly do you want to preserve? I'm guessing you'd want to do something to "/Users/<username>/Desktop/" at the very least, if not "/Users/<username>/Documents/"
The preserve thing comes into play as you may want to keep stuff in /Users/<username>/Library/ or other folders.
Do you have ARD? That might have options for this stuff built in, if not, it allows you to run a script, so you could have a shell script that iterates through /Users/ and trashes the contents of the Documents, Desktop, Music, and Pictures folders.
#3
Scooby Regular
Thread Starter
What exactly do you want to preserve? I'm guessing you'd want to do something to "/Users/<username>/Desktop/" at the very least, if not "/Users/<username>/Documents/"
The preserve thing comes into play as you may want to keep stuff in /Users/<username>/Library/ or other folders.
Do you have ARD? That might have options for this stuff built in, if not, it allows you to run a script, so you could have a shell script that iterates through /Users/ and trashes the contents of the Documents, Desktop, Music, and Pictures folders.
The preserve thing comes into play as you may want to keep stuff in /Users/<username>/Library/ or other folders.
Do you have ARD? That might have options for this stuff built in, if not, it allows you to run a script, so you could have a shell script that iterates through /Users/ and trashes the contents of the Documents, Desktop, Music, and Pictures folders.
How's things going buddy?
All I want to preserve is the usernames for the one group, AND delete the users and associated user files for the other group.
Basically the students "dump" all their work onto the desktop, so I want to wipe their desktops, itunes libraries, documents, videos, images etc - ie their home folder.
I'm still running ARD 3.0 so I do have access to the machines.
Dan
#4
Scooby Regular
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
I'm doing well, hope the same is true for you.
Ok, the home folder deletion is pretty easy. The users, hmm, probably a dscl command to delete a user. Have a look at this which details how to use dscl to delete users.
You could then knock up a script script to trash the users you don't want.
Ok, the home folder deletion is pretty easy. The users, hmm, probably a dscl command to delete a user. Have a look at this which details how to use dscl to delete users.
You could then knock up a script script to trash the users you don't want.
#5
Scooby Regular
Thread Starter
Thanks mate - yeh, all good here too
I'm pretty sure I've got the user-deletion covered: just do it from the Workgroup user manager in Server.
It's just getting rid of the home folders.......
Dan
I'm pretty sure I've got the user-deletion covered: just do it from the Workgroup user manager in Server.
It's just getting rid of the home folders.......
Dan
#6
Scooby Regular
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
As for the home folders. Ok, this should work:
Code:
-- List of user folders to keep set listofuserstopreserve to {".localized", ""} -- Path to the Users folder set pathtousersfolder to "/Users/" -- List all folders in /Users/ set listoffoldersinusersfolders to list folder (POSIX file pathtousersfolder) -- Iterate through the list of folders in /Users and delete those that are not on the preservation list repeat with auserfolder in listoffoldersinusersfolders -- Check to see if the item is in the protected list if listofuserstopreserve does not contain auserfolder then -- Kill the folder set shellcode to ("sudo rm -rf '/Users/" & auserfolder & "'") as string do shell script shellcode user name "<TheAdminName>" password "<TheAdminPassword>" with administrator privileges end if end repeat
Other step is to look for <TheAdminName> and <TheAdminPassword> items change those to a local admin username (short name) and password.
Copy the script over using ARD, and then run it using ARD. I'd run it on a machine first to make sure it works and if so, deploy it to all machines and run it on all of them.
#7
Scooby Regular
Thread Starter
Thanks Markus, this seems to be doing part of the job - we're also looking at a total flush (seems like a good time to be looking at it tbh! )
Dan
Dan
Trending Topics
#8
Scooby Regular
Join Date: Mar 1999
Location: The Great White North
Posts: 25,080
Likes: 0
Received 0 Likes
on
0 Posts
If you are thinking of a re-image, then check this out: http://code.google.com/p/instadmg/
Very cool, basically it's like an windows slipstream, but for OS X. Very handy when you need to get a machine to the latest OS and don't have an install dvd of that os.
File can then be used with Apple's net restore stuff to push it out to many machines.
Very cool, basically it's like an windows slipstream, but for OS X. Very handy when you need to get a machine to the latest OS and don't have an install dvd of that os.
File can then be used with Apple's net restore stuff to push it out to many machines.
#9
Scooby Regular
Thread Starter
Thanks for that Markus - will have a look into it. Got t flush 22 macs in the next week. Along with everything else!!
This may make light work of it.
This may make light work of it.
Thread
Thread Starter
Forum
Replies
Last Post