Quantcast
Channel: Security forum
Viewing all articles
Browse latest Browse all 12072

Use RoboCopy to copy a folder structure template and retain permissions

$
0
0

We have a client that has a Shared Data area they are trying to configure that uses a very convoluted permission structure that requires certain subfolders to have different permissions from their parent folder. Parts of the folder structure they also want to be able to recreate multiple times (use a template). I know that using a simple 'copy/paste' operation kills all the permissions on the 'pasted' copy and causes all folders, subfolders and files to inherit the permissions of the parent folder they are pasted into.

I found an article online that seemed to allow me to do this using Robocopy. The command is: 

robocopy source destination /E /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE

The only problem with this is that it doesn't 'update' any files that are in the folders. So if a certain user/group had only 'Read' access to files in a certain folder and you use the above command to give them 'Read/Write' within that folder they still only have 'Read' access to existing files even though, when you check their properties, they say they are inheriting from their parent. The only way I found to 'update' the permissions is to 'Save As' the file under a different name (which then has the correct permissions) and then have someone that had 'Delete' permissions to delete the old file so you can then rename the new copy to the proper name.

I'm no Robocopy expert so I'm wondering if there is a switch or something that I can add that would 'refresh' the permissions on the files in the destination to match the new permissions on the folders?


Viewing all articles
Browse latest Browse all 12072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>