$domain = 'cascades.local'
$gpoName = 'CSC - Folder Redirection'

try {
    Set-GPPermission -Name $gpoName -Domain $domain `
        -PermissionLevel None -TargetName 'Authenticated Users' -TargetType Group `
        -Confirm:$false -EA Stop
    Write-Output "[OK] Removed Authenticated Users from security filter"
} catch {
    Write-Output "[ERROR] $($_.Exception.Message)"
}

Write-Output ""
Write-Output "=== GPO Security Filter ==="
Get-GPPermission -Name $gpoName -Domain $domain -All | ForEach-Object {
    Write-Output "  $($_.Trustee.Name) [$($_.Trustee.TrusteeType)] — $($_.Permission)"
}
