我正在尝试将ACL设置为仅修改,但是当我运行代码时它会运行,但是对于指定的用户,权限仍然是空白的,我哪里出错?
$ApplicationPoolIdentity = "domain\username"
function SetACL()
{
param (
[Parameter(Mandatory=$true)]
[string] $Path
)
$Acl = Get-Acl $Path
Write-Host "Path:" $Path "ID:" $ApplicationPoolIdentity
$Ar = New-Object system.security.accesscontrol.filesystemaccessrule($ApplicationPoolIdentity,"Write","Allow")
$Acl.SetAccessRule($Ar)
Write-Host $Acl
$Acl | Set-Acl $Path
}
SetACL "F:\Test123\"