Files
claudetools/.claude/temp/gpo-inspect-le.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

52 lines
1.8 KiB
PowerShell

$domain = 'cascades.local'
$srv = 'CS-SERVER'
$sysvol = "\\$srv\SYSVOL\$domain\Policies"
# Find the LE folder redirection GPO
$gpo = Get-GPO -Name 'CSC - Folder Redirection (LE)' -Domain $domain
Write-Output "GPO: $($gpo.DisplayName)"
Write-Output "GUID: {$($gpo.Id.ToString().ToUpper())}"
$gpoPath = "$sysvol\{$($gpo.Id.ToString().ToUpper())}"
Write-Output "Path: $gpoPath"
Write-Output ""
# List all files in the GPO folder recursively
Write-Output "=== SYSVOL file tree ==="
Get-ChildItem $gpoPath -Recurse -File -EA SilentlyContinue | ForEach-Object {
Write-Output " $($_.FullName.Replace($gpoPath, ''))"
}
Write-Output ""
# Show GPT.INI
Write-Output "=== GPT.INI ==="
[System.IO.File]::ReadAllText("$gpoPath\GPT.INI") | Write-Output
Write-Output ""
# Show any fdeploy.ini or redirection files
$fdeployPath = "$gpoPath\User\Documents & Settings"
if (Test-Path $fdeployPath) {
Write-Output "=== fdeploy.ini ==="
[System.IO.File]::ReadAllText("$fdeployPath\fdeploy.ini") | Write-Output
} else {
Write-Output "No 'Documents & Settings' folder found"
}
# Also check the unlinked CSC - Folder Redirection GPO
Write-Output ""
Write-Output "=== CSC - Folder Redirection (unlinked) ==="
$gpo2 = Get-GPO -Name 'CSC - Folder Redirection' -Domain $domain -EA SilentlyContinue
if ($gpo2) {
Write-Output "GUID: {$($gpo2.Id.ToString().ToUpper())}"
$gpo2Path = "$sysvol\{$($gpo2.Id.ToString().ToUpper())}"
Get-ChildItem $gpo2Path -Recurse -File -EA SilentlyContinue | ForEach-Object {
Write-Output " $($_.FullName.Replace($gpo2Path, ''))"
}
$fd2 = "$gpo2Path\User\Documents & Settings\fdeploy.ini"
if (Test-Path $fd2) {
Write-Output "fdeploy.ini:"
[System.IO.File]::ReadAllText($fd2) | Write-Output
}
} else {
Write-Output "GPO not found"
}