根据文件夹名称输入设置权限 [英] set permission based on folder name input

查看:85
本文介绍了根据文件夹名称输入设置权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我是脚本或者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 the AD username jsmith

// fileserver / sharepath / jsmith   

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

permission setting for above folder should be full control for the admin and jsmith account 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


这篇关于根据文件夹名称输入设置权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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