$path = 'O:\путь'
Import-Module NTFSSecurity
#$acl = Get-ACL -Path $path
#$acl | select access | % {$_}
[array]$users = $null
$path | Get-NTFSAccess | % {
$user = $null
try {
$user = (get-aduser ($_.account -replace 'DomainName\\','') )
}
catch {
}
if ( ($user -ne $null) -and ($user.enabled -eq $false) ) {
Remove-NTFSAccess -Path $path -account $_.account -AccessRights $_.accessrights
$_.account
}
}