复制文件夹和preserving权限 [英] copying folders and preserving permissions
问题描述
大家好我一直都负责创建一个应用程序,将创建一批文件夹与用户指定的共享我们的网络上的权限。我的想法是与所有必要的权限创建的文件夹为模板,然后应用程序将简单的模板复制到指定的共享。是否有可能在C#或PowerShell来这样做时,复制的文件夹和preserve的权限。香港专业教育学院做了谷歌搜索,但无法找到任何确凿的。
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.
推荐答案
你去那里,简单的采用了类FileSecurity传输文件的权限。
There you go, simple use the class FileSecurity to transfer permissions of files.
和目录安全性的文件夹:
And Directory Security for the folders:
<一个href="http://stackoverflow.com/questions/4323390/copy-permissions-from-one-windows-folder-to-another">Directory安全1
这篇关于复制文件夹和preserving权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!