添加组“所有人”到目录及其所有子目录
我目前使用的是 Vista 32 位。如何添加 Windows 安全组“Everyone”并完全控制目录及其所有子目录和所有文件?有我可以使用的 powershell 脚本吗?
谢谢!
I'm currently using Vista 32-bit. How do I add the Windows security group "Everyone" and give full control to a directory and all of it's sub-directories and all files? Is there a powershell script that I could use?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经扩展了 martona 的代码片段,并且能够授予对所有文件夹和子文件夹的访问权限。这是我的代码 -
I've expanded on martona's snippet and was able to give access to all folders and sub-folders. Here's my code -
有时“本机”PowerShell 方式不一定是最好的方式。对于类似的事情,我仍然会使用 icacls.exe。请记住,优秀的前任在 PowerShell 中工作得很好。只需 cd 到您想要设置并执行的目录:
这将使每个人都可以向下完全访问当前目录(通过权限继承)。只要 dir 结构中没有明确拒绝Everyone,这应该有效。
Sometimes the "native" PowerShell way isn't necessarily the best way. For something like this I would still use icacls.exe. Remember that good ol' exes work pretty good in PowerShell. Just cd to the directory you want to set and execute:
This will give Everyone full access to the current directory downwards (via permission inheritance). This should work as long as there are no explicit denials to Everyone in the dir structure.