Jump to content

Recommended Posts

Posted

I currently have been tasked to find a script to:

1. walk a system tree and find all .pst files on a netwotk share..ie drive:\home\username\mail\*.pst

2. Copy said files to a new location keeping the sytem tree in tack, but all directories empty except the target folder.

3. Then set ownership of each pst to the username.

Any thought would be greatly appreciated. I can do it manually, but 300 users would take some time.

 

 

Thanks.

Posted (edited)

I believe this should work

 

ROBOCOPY "Source" "Destination" *.pst /E /sec

 

Sorry cant check if works currently on iPad.

Edited by djwingfield
Posted (edited)

should be a one liner with bash

 

find c:\home\username\mail\ "*.pst" -exec rsync -R {} c:\wherever ;\ -exec setfacl -R -m user:username:rwx c:\wherever\{} ;\ 

 

not sure if the setfacl will work with cygwin as this is a unix to windows translation.

Edited by CyberNerd

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...