Files
claudetools/.claude/temp/check-frd-gpo.ps1
Howard Enos bc984d9c78 sync: auto-sync from HOWARD-HOME at 2026-05-20 17:08:25
Author: Howard Enos
Machine: HOWARD-HOME
Timestamp: 2026-05-20 17:08:25
2026-05-20 17:08:29 -07:00

38 lines
1.2 KiB
PowerShell

$domain = 'cascades.local'
$gpoName = 'CSC - Folder Redirection'
$gpo = Get-GPO -Name $gpoName -Domain $domain -EA Stop
Write-Output "GPO: $($gpo.DisplayName)"
Write-Output "GUID: {$($gpo.Id.ToString().ToUpper())}"
Write-Output "Status: $($gpo.GpoStatus)"
Write-Output ""
Write-Output "=== Security Filter (who this GPO applies to) ==="
Get-GPPermission -Name $gpoName -Domain $domain -All | ForEach-Object {
Write-Output " $($_.Trustee.Name) [$($_.Trustee.TrusteeType)] — $($_.Permission)"
}
Write-Output ""
Write-Output "=== GPO Links ==="
$report = Get-GPOReport -Name $gpoName -Domain $domain -ReportType Xml
$xml = [xml]$report
$links = $xml.GPO.LinksTo
if ($links) {
foreach ($l in $links) {
Write-Output " $($l.SOMPath) — Enabled: $($l.Enabled) — NoOverride: $($l.NoOverride)"
}
} else {
Write-Output " (no links)"
}
Write-Output ""
Write-Output "=== SYSVOL contents ==="
$srv = 'CS-SERVER'
$sysvol = "\\$srv\SYSVOL\$domain\Policies"
$guid = "{$($gpo.Id.ToString().ToUpper())}"
Get-ChildItem "$sysvol\$guid" -Recurse -EA SilentlyContinue | ForEach-Object {
$rel = $_.FullName.Replace("$sysvol\$guid", '')
$type = if ($_.PSIsContainer) { '[DIR]' } else { "[FILE $($_.Length)b]" }
Write-Output " $type $rel"
}