Skip to content

Instantly share code, notes, and snippets.

@winkler-winsen
Created March 13, 2024 14:43
Show Gist options
  • Save winkler-winsen/2d2c52069dbdb2147ba6150e41b3f118 to your computer and use it in GitHub Desktop.
Save winkler-winsen/2d2c52069dbdb2147ba6150e41b3f118 to your computer and use it in GitHub Desktop.
Check GPO files on SYSVOL for every .adm/.admx file ha a correspondant resource .adml file in language sub dir.
# check GPO files on SYSVOL for every .adm and .admx file has a correspondant resource .adml file in language sub dir.
# https://learn.microsoft.com/en-us/troubleshoot/windows-server/group-policy/create-central-store-domain-controller
#
$p='\\ad.contoso.local\sysvol\ad.contoso.local\Policies\PolicyDefinitions'
$langdirs= Get-ChildItem -Path $p -Directory -Filter '*-*'
Set-Location -Path $p
$adm = Get-ChildItem -Path $p -File
foreach ($a in $adm) {
foreach ($l in $langdirs) {
$tpath=Join-Path -Path $p -ChildPath $l | Join-Path -ChildPath "$((Get-Item $a).Basename).adml"
if (!(Test-Path $tpath )) {
Write-Host $tpath
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment