未设置Powershell ACL
我试图将ACL设置为仅修改,但当我运行它运行的代码时,指定用户的权限仍然为空,我哪里出错了未设置Powershell ACL,powershell,acl,Powershell,Acl,我试图将ACL设置为仅修改,但当我运行它运行的代码时,指定用户的权限仍然为空,我哪里出错了 $ApplicationPoolIdentity = "domain\username" function SetACL() { param ( [Parameter(Mandatory=$true)] [string] $Path ) $Acl = Get-Acl $Path Write-Host "Path:" $Pa
$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\"
此代码正在我的系统上运行。:我想可能是权限之类的。。但不会返回错误