Problem: Restore nutzt bisher den Snapshot aus dem BackupSet (BackupItem). Wenn der Snapshot “unvollständig”/nicht der gewünschte Stand ist, landen nach Restore nur wenige Admin-Template-Settings in Intune. Lösung: Neue Action “Restore to Intune” direkt an einer konkreten PolicyVersion (inkl. Dry-Run Toggle) → reproduzierbarer Rollback auf exakt diese Version. Restore-UI zeigt jetzt PolicyVersion-Nummer (version: X) in der Item-Auswahl + BackupSet Items Tabelle hat eine Version-Spalte. Implementierung: RestoreService::executeFromPolicyVersion() erzeugt dafür einen kleinen, temporären BackupSet+BackupItem aus der Version und startet einen normalen RestoreRun. Pest-Test: PolicyVersionRestoreToIntuneTest.php Specs/TODO: Offene Follow-ups sind dokumentiert in tasks.md unter “Open TODOs (Follow-up)”. QA (GUI): Inventory → Policies → <Policy> → Versions → Restore to Intune (erst Dry-Run, dann Execute) Backups & Restore → Restore Runs → Create (bei Items steht version: X) Backups & Restore → Backup Sets → <Set> (Version-Spalte) Tests: PolicyVersionRestoreToIntuneTest.php Co-authored-by: Ahmed Darrazi <ahmeddarrazi@adsmac.local> Reviewed-on: #13
2.5 KiB
Feature Specification: Administrative Templates (Group Policy Configurations) (010)
Feature Branch: feat/010-admin-templates
Created: 2025-12-29
Status: Draft
Input: .specify/spec.md (groupPolicyConfiguration scope), references/IntuneManagement-master (definitionValues/presentationValues pattern)
Overview
Add reliable coverage for Administrative Templates (groupPolicyConfiguration) in the existing inventory/backup/version/restore flows.
Administrative Templates are not fully represented by the base entity alone; the effective policy settings live in:
definitionValues(with expandeddefinition)presentationValuesper definitionValue (with expandedpresentation)
In Scope
- Policy type:
groupPolicyConfiguration(deviceManagement/groupPolicyConfigurations) - Snapshot capture hydrates:
definitionValues?$expand=definitionpresentationValues?$expand=presentationfor each definitionValue
- Restore supports “snapshot as source of truth” for Admin Templates settings:
- delete existing definitionValues
- recreate definitionValues + presentationValues from snapshot
- UI shows a readable “Normalized settings” view for Admin Templates (definitions + values).
Out of Scope (v1)
- Translating every ADMX value into Intune-portal-identical wording for every template
- Advanced partial-restore / per-setting selection
User Scenarios & Testing (mandatory)
User Story 1 — Inventory + readable view (P1)
As an admin, I can open an Administrative Template policy and see its effective configured settings (not only metadata).
Acceptance
- Policy detail shows a structured list/table of configured settings (definition + value).
- Policy Versions store the hydrated settings and render them in “Normalized settings”.
User Story 2 — Backup/Version capture includes definition values (P1)
As an admin, a backup/version of an Administrative Template includes the definitionValues + presentationValues.
Acceptance
- Backup payload contains
definitionValuesarray. - Each definitionValue includes expanded
definitionand apresentationValuescollection (when present).
User Story 3 — Restore settings (P1)
As an admin, restoring an Administrative Template brings the target tenant’s definition values back to the snapshot state.
Acceptance
- Restore deletes existing definitionValues before recreate.
- Restore recreates definitionValues and their presentationValues.
- Clear per-item audit outcomes on failures.