Policies: ADMX-Import überspringt Einstellung sauber bei Presentation-Mismatch
Bei ingesteten ADMX mit abweichender Ziel-Version ließ sich eine Presentation teils nicht zuordnen; bisher wurde die Einstellung dennoch (unvollständig) gepostet -> 400 BadRequest. Jetzt wird die ganze Einstellung mit klarer Meldung übersprungen, statt einen kaputten Body zu senden. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+9
-1
@@ -588,12 +588,16 @@ function Import-GraphAdministrativeTemplate {
|
||||
|
||||
$presVals = @()
|
||||
$typeCounter = @{}
|
||||
$presFailed = $false
|
||||
foreach ($pv in @(Get-PolicyProp $dv 'presentationValues')) {
|
||||
if (-not $pv) { continue }
|
||||
$pres = Get-PolicyProp $pv 'presentation'
|
||||
if ($ingested) {
|
||||
$presId = Resolve-TargetPresentationId -TargetPres $tgtPres -SrcPresentation $pres -Counter $typeCounter
|
||||
if (-not $presId) { $errors += "${defName}: Presentation im Ziel nicht zuordenbar - Wert uebersprungen"; continue }
|
||||
# Presentation nicht zuordenbar (andere ADMX-Version im Ziel): die GANZE
|
||||
# Einstellung ueberspringen, statt mit unvollstaendigem Body ein 400 zu
|
||||
# provozieren.
|
||||
if (-not $presId) { $presFailed = $true; break }
|
||||
} else {
|
||||
$presId = [string](Get-PolicyProp $pres 'id')
|
||||
}
|
||||
@@ -608,6 +612,10 @@ function Import-GraphAdministrativeTemplate {
|
||||
}
|
||||
$presVals += $entry
|
||||
}
|
||||
if ($presFailed) {
|
||||
$errors += "${defName}: Eingabefelder passen nicht zur Ziel-ADMX (andere Version?) - uebersprungen"
|
||||
continue
|
||||
}
|
||||
|
||||
$body = [ordered]@{
|
||||
enabled = [bool](Get-PolicyProp $dv 'enabled')
|
||||
|
||||
Reference in New Issue
Block a user