Skript Beschreibung
Zusammenfassung: Compliance-Drift-Detector - Detects configuration drift in compliance policies.
Prüfstatus: Ungeprüft
Aus dem bestehenden GitHub-Bestand übernommen; fachliche und Tenant-Abnahme ausstehend.
Compares the current state of a target compliance policy against a
defined 'Golden Image' to identify unauthorized or accidental changes.
#>
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string]$GoldenPolicyId,
[Parameter(Mandatory=$true)]
[string]$TargetPolicyId
)
process {
Write-Host "[INFO] Analyzing compliance drift..." -ForegroundColor Cyan
$Golden = Get-MgDeviceManagementCompliancePolicy -DeviceId $GoldenPolicyId
$Target = Get-MgDeviceManagementCompliancePolicy -DeviceId $TargetPolicyId
$Drift = @()
# Simplified comparison of key properties
if ($Golden