Reputation: 2983
Guys ive been tasked with creating an app that will create a bunch of folders with permissions on our network in a share specified by the user. My thoughts are to create the folders as a template with all the necessary permission and then the app will simply copy the template to the specified share. Is it possible to in C# or powershell to copy the folders and preserve the permissions when doing so. Ive done a google search but cant find anything conclusive.
Upvotes: 2
Views: 2242
Reputation: 649
There you go, simple use the class FileSecurity to transfer permissions of files.
Google first result on c# copy files maintain permissions
And Directory Security for the folders:
Upvotes: 1