Policies: ADMX-Import-Diagnose bei Presentation-Mismatch verbessert

Die "nicht zuordenbar"-Meldung listet jetzt Quell- und Ziel-Presentations
(Typ + Label) auf, damit echte ADMX-Versionsunterschiede sofort sichtbar sind.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-23 13:05:19 +02:00
co-authored by Claude Opus 4.8
parent 0e66e268f6
commit 849cdd198e
+9 -3
View File
@@ -598,6 +598,7 @@ function Import-GraphAdministrativeTemplate {
$presVals = @() $presVals = @()
$typeCounter = @{} $typeCounter = @{}
$presFailed = $false $presFailed = $false
$presDiag = ''
foreach ($pv in @(Get-PolicyProp $dv 'presentationValues')) { foreach ($pv in @(Get-PolicyProp $dv 'presentationValues')) {
if (-not $pv) { continue } if (-not $pv) { continue }
$pres = Get-PolicyProp $pv 'presentation' $pres = Get-PolicyProp $pv 'presentation'
@@ -605,8 +606,13 @@ function Import-GraphAdministrativeTemplate {
$presId = Resolve-TargetPresentationId -TargetPres $tgtPres -SrcPresentation $pres -Counter $typeCounter $presId = Resolve-TargetPresentationId -TargetPres $tgtPres -SrcPresentation $pres -Counter $typeCounter
# Presentation nicht zuordenbar (andere ADMX-Version im Ziel): die GANZE # Presentation nicht zuordenbar (andere ADMX-Version im Ziel): die GANZE
# Einstellung ueberspringen, statt mit unvollstaendigem Body ein 400 zu # Einstellung ueberspringen, statt mit unvollstaendigem Body ein 400 zu
# provozieren. # provozieren. Zur Diagnose Quelle + Ziel-Presentations anhaengen.
if (-not $presId) { $presFailed = $true; break } if (-not $presId) {
$srcI = "$([string](Get-PolicyProp $pres '@odata.type'))|label='$([string](Get-PolicyProp $pres 'label'))'"
$tgtI = (@($tgtPres) | ForEach-Object { "$([string](Get-PolicyProp $_ '@odata.type'))|label='$([string](Get-PolicyProp $_ 'label'))'" }) -join ' ; '
$presDiag = "Quelle[$srcI] Ziel[$tgtI]"
$presFailed = $true; break
}
} else { } else {
$presId = [string](Get-PolicyProp $pres 'id') $presId = [string](Get-PolicyProp $pres 'id')
} }
@@ -622,7 +628,7 @@ function Import-GraphAdministrativeTemplate {
$presVals += $entry $presVals += $entry
} }
if ($presFailed) { if ($presFailed) {
$errors += "${defName}: Eingabefelder passen nicht zur Ziel-ADMX (andere Version?) - uebersprungen" $errors += "${defName}: Presentation nicht zuordenbar - uebersprungen. $presDiag"
continue continue
} }