import-module ActiveDirectory
cls
$currentDomain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$currentDomain = $currentDomain.Name
$admls = get-item ("c:\windows\sysvol_dfsr\sysvol\" + $currentDomain + "\Policies\PolicyDefinitions\en-us\*.adml")
$admxs = get-item ("c:\windows\sysvol_dfsr\sysvol\" + $currentDomain + "\Policies\PolicyDefinitions\*.admx")
$admls | %{
$adml = $_
$admlName = $adml.name
$admlFullName = $adml.FullName
$admxName = $admlName.Substring(0, $admlName.Length - 5) + ".admx"
if (Get-Item ($admlFullName + "\..\..\" + $admxName) -ErrorAction SilentlyContinue) {
#do nothing
} else {
".......... " + $admxName + " is missing"
}
}
$admxs | %{
$admx = $_
$admxName = $admx.name
$admxFullName = $admx.FullName
$admlName = $admxName.Substring(0, $admxName.Length - 5) + ".adml"
if (Get-Item ($admxFullName + "\..\en-us\" + $admlName) -ErrorAction SilentlyContinue) {
#do nothing
} else {
".......... " + $admlName + " is missing"
}
}
2018-07-16
check group policy templates - compare-ADMX.ps1
How to find missing admx or adml files - of course - You should provide proper path and regional settings:
Subskrybuj:
Komentarze do posta (Atom)
Brak komentarzy:
Prześlij komentarz