根据文件夹名称输入设置权限

编程入门 行业动态 更新时间:2024-10-24 22:17:23
本文介绍了根据文件夹名称输入设置权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

您好,

我是脚本或者PowerShell的新手

Im newbie for scripting or powershell

案例背景

我们在// fileserver / sharepath /中创建了120个文件夹,所有这120个文件夹都是使用用户AD用户名的名称。

We have created 120 folder in //fileserver/sharepath/ and all this 120 folder been name using users AD username.

如何使用文件夹名称输入自动化每个文件夹的权限设置(完全控制)。

How can i automated the permission setting for each folder (full control), using the folder name input.

示例

user = John Smith和 AD用户名 jsmith

user = John Smith and theAD username jsmith

// fileserver / sharepath / jsmith

上述文件夹的权限设置应该是对管理员的完全控制权和 jsmith仅限

permission setting for above folder should befull control for the admin andjsmithaccount only

谢谢

推荐答案

这个控制台命令可以解决问题:

This console command will do the trick:

for / d%a in(*。*)do @icacls"%a" / T / grant"%a":F系统:F管理员:F

最好先在单个文件夹上测试命令:

Best to first test the command on a single folder:

icacls" jsmith" / T / grant" jsmith" ;:F系统:F管理员:F

更多推荐

根据文件夹名称输入设置权限

本文发布于:2023-11-12 11:47:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581416.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   权限   名称

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!