Hi,
Please see if this works for you
$group = "domain\helpdesk"
$folders = @()
ForEach ($Folder in $FolderPath) {
$NoPermission = $true
$Acl = Get-Acl -Path $Folder.FullName
ForEach ($Access in $Acl.Access) {
if($Access.IdentityReference.Value -eq $group){
$NoPermission = $false
}
}
if($NoPermission){
$folders += $Folder
}
}
Best Regards,
Ian
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.