0
添加本地主机\用户+读取权限的文件夹我想:我怎样才能在PowerShell中
$Folderpath='D:\DATA\'
$user_account='USERS'
$Acl = Get-Acl $Folderpath
$Ar = New-Object system.Security.AccessControl.FileSystemAccessRule($user_account, "Read", "ContainerInherit, ObjectInherit", "None", "Allow")
$Acl.Setaccessrule($Ar)
Set-Acl $Folderpath $Acl
我获得以下错误:
Set-Acl : The security identifier is not allowed to be the owner of this object.
我不希望用户拥有者寿,只有有READ。
我不认为问题出在您的脚本上,而是该文件夹中已有的所有权。 – BenH