Script Help for backup then restore of mobile AD home folder...

GabeShack
Valued Contributor III

Hi all,

I am looking for a way to script the backup and restore of a users (local) mobile AD user folder and then restore it back with correct permissions.

We are constantly updating images and systems and this would really streamline the process if it can be scripted.

I can do this pretty well manually by just mounting my backup share, copying the user's home folder to my backup share, then reimaging the compter with my netboot Casper Imaging server. My image then has installs that happen at reboot, then goes to the login screen when finished. I'd love it to then copy the users home folder back to the Users folder and then apply the correct permissions for their account which I believe should be they are the Owner with read write execute with their AD login, then other domain users have just read access, and everyone just has read access.

The ideal situation would be a script that does the backup while I'm booted into the netboot casper imaging system, then another that prompts for the username to then find the user folder automagically and then copies it back after imaging is complete as well as sets correct permissions.

I have only gotten so far as to script the mounting of the backup share lol.
Suggestions? Help? Words of wisdom?
Anything would help at this point!
Thanks to our wonderful community for anything you can provide!

Gabe Shackney
Princeton Public Schools

Gabe Shackney
Princeton Public Schools
2 REPLIES 2

ShaunRMiller83
Contributor III

Gabe,

While i dont think this won't fulfill all of your requirements.

These script were my starting point - https://jamfnation.jamfsoftware.com/discussion.html?id=9418 (Thanks @Roskos and the other posters in this thread for this script)

I believe it could be a good starting point to be able to modify to meet your needs.

bpavlov
Honored Contributor

This is for use in DeployStudio but I think it can provide a good starting point and perhaps you can adapt it for your workflow: https://github.com/rustymyers/BackupRestore