通过编辑文件夹的安全设置 [英] Editing security setting of a folder through

查看:64
本文介绍了通过编辑文件夹的安全设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图通过代码将我的SQL Server数据库附加到服务器实例。它给错误的是,包含这些文件的文件夹没有完全控制,我需要通过右键单击文件夹并编辑证券来提供。



我希望通过代码完成。请告知是否可以使用Netsh命令或任何其他方式。



谢谢

Hi,
I am trying to attach my SQL Server DBs to instance of the server through code. It gives errr that the folder that contains these files does not hav ''Full Control'' that I need to give by right clicking on the folder, and editing the Securities.

I wish to do it through code. Please advise if it is possible using Netsh command or any other way.

Thanks

推荐答案

最简单低谷代码的方法是使用 SetACL.exe命令工具 [ ^ ]。它有无数的命令行选项,允许设置文件和文件夹的安全权限。也受系统管理员信任(在我们公司使用)
the easiest way to do it "trough code" is by using SetACL.exe command tool[^]. It has countless number of command line options and allows to set the security permissions on files and folders. Trusted by system administrators as well (it is used in our company)


您的MSSQLSERVER服务帐户是否对该文件夹具有适当的权限?如果不存在,请检查并给予适当的许可。那么你希望能够做到这一点。
Does your MSSQLSERVER service account has proper privilege on the folder? Please check and give proper permission if does not exists. Then you will be able to do that, I hope.


这篇关于通过编辑文件夹的安全设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆