Unified Tenant Configuration Management
Eine PowerShell-Bibliothek, die Microsoft 365-Tenant-Konfigurationen über die Graph TCM APIs liest, überwacht und verwaltet — lokal und in Azure Automation.
Erstellt Konfigurationsschnappschüsse für alle 5 M365-Workloads: Entra ID, Exchange, Intune, Teams, Defender.
Überwacht Konfigurationsabweichungen gegenüber einer definierten Baseline und alarmiert bei Änderungen.
JSON, Excel (.xlsx), HTML-Bericht und Word/PDF — ohne installiertes Office.
Importiert JSON-Exporte in einen neuen Tenant über die TCM Baseline API.
Zertifikat-basierte App-Authentifizierung. Kein interaktives Login nach der Ersteinrichtung.
Unterstützt beliebig viele Tenants über eine einzige App-Registrierung (MSP-geeignet).
Vollständige Unterstützung für Azure Automation mit Managed Identity und Key Vault.
Statische SPA mit MSAL.js-Authentifizierung — auf IIS, Azure Static Web Apps oder Cloudflare Pages lauffähig.
$PSVersionTable.PSVersion
dotnet --version
Einmalig für App Registration
Contributor auf Resource Group
Folgen Sie den Schritten für Ihre gewünschte Installationsumgebung.
Wo soll UTCM-API betrieben werden?
Führen Sie UTCM-API auf Ihrem lokalen PC aus. Ideal für die Ersteinrichtung, Tests und gelegentliche Exports.
Automatisierte Ausführung in Azure. Zeitpläne, Key Vault, Managed Identity und optionale Web App.
Nur das Web-Interface nutzen — kein lokales PowerShell, kein Azure nötig. App-Registrierung über Entra Admin Center.
Überprüfen Sie, ob Ihr System die Anforderungen erfüllt.
$PSVersionTable.PSVersion
# Erwartete Ausgabe: Major >= 7, Minor >= 2
Laden Sie den UTCM-API-Code auf Ihren Computer herunter.
git clone https://github.com/MKN1411/UTCM-API-Beta.git "C:\_GitHub\UTCM-API"
cd "C:\_GitHub\UTCM-API"
# ZIP von GitHub herunterladen und entpacken:
Expand-Archive -Path "$env:USERPROFILE\Downloads\UTCM-API-Beta-main.zip" `
-DestinationPath "C:\_GitHub\UTCM-API"
Das Modul installiert alle Abhängigkeiten automatisch.
# Modul laden (einmalig pro Session)
Import-Module "C:\_GitHub\UTCM-API\src\UTCM.psd1" -Force
# Alle benötigten Module installieren
Initialize-UTCMModules
# Installiert automatisch:
# ✅ Microsoft.Graph.Authentication 2.15+
# ✅ Microsoft.Graph.Applications
# ✅ ImportExcel 7.8+
# ✅ Az.Accounts (optional, für Azure-Features)
CurrentUser installiert — keine Admin-Rechte auf dem PC nötig.
Der Setup-Wizard erstellt einmalig eine App-Registrierung in Ihrem Entra ID und ein Zertifikat zur Authentifizierung. Dies erfordert einen einmaligen interaktiven Login als Global Administrator.
Import-Module "C:\_GitHub\UTCM-API\src\UTCM.psd1" -Force
Initialize-UTCMSetup `
-TenantId "IHRE-TENANT-ID" `
-AppName "UTCM-API" `
-OpenConsentInBrowser
# Was passiert:
# 1️⃣ Benötigte Module werden geprüft
# 2️⃣ Einmaliger interaktiver Login (Browser öffnet sich)
# 3️⃣ Self-Signed Zertifikat wird erstellt
# 4️⃣ App-Registrierung wird angelegt
# 5️⃣ Admin Consent URL wird angezeigt
Die App benötigt Admin Consent für die Microsoft Graph-Berechtigungen. Nach dem Setup erscheint eine URL — öffnen Sie diese als Global Administrator.
Initialize-UTCMSetup in der Ausgabe angezeigt
https://login.microsoftonline.com/organizations/adminconsent
?client_id=IHRE-CLIENT-ID
&redirect_uri=https%3A%2F%2Flocalhost
# URL per PowerShell anzeigen
Get-UTCMAdminConsentUrl
# Oder direkt im Browser öffnen
Invoke-UTCMAdminConsent
Testen Sie die Verbindung und erstellen Sie Ihren ersten Snapshot.
Import-Module "C:\_GitHub\UTCM-API\src\UTCM.psd1" -Force
# Verbindung herstellen (zertifikatbasiert, kein Login-Dialog)
Connect-UTCMTenant
# Tenant-Profil lesen
Get-UTCMTenantProfile
# Ersten Snapshot erstellen
$job = New-UTCMSnapshotJob -WorkloadFilter @(
'MicrosoftEntra', 'MicrosoftIntune', 'MicrosoftTeams'
)
$job = Wait-UTCMSnapshotJob -JobId $job.id
$data = Get-UTCMSnapshot -JobId $job.id
# Als JSON exportieren
Export-UTCMToJson -InputObject $data -OutputPath .\exports
# Als HTML-Bericht öffnen
Export-UTCMToHtml -InputObject $data -OutputPath .\exports -OpenInBrowser
C:\_GitHub\UTCM-API\config\utcm-config.json
Stellen Sie sicher, dass alle Anforderungen für die Azure-Einrichtung erfüllt sind.
# Az-Module installieren (einmalig, ~5 Min.)
Install-Module Az -Scope CurrentUser -Force -AllowClobber
# Oder nur die benötigten Module:
Install-Module Az.Accounts, Az.KeyVault, Az.Automation `
-Scope CurrentUser -Force
Geben Sie Ihre Azure-Details ein. Die PowerShell-Befehle werden automatisch angepasst.
Erstellt Resource Group, Key Vault, Automation Account und richtet alle Berechtigungen ein.
Import-Module "C:\_GitHub\UTCM-API\src\UTCM.psd1" -Force
Initialize-UTCMAzureAutomation `
-SubscriptionId "IHRE-SUBSCRIPTION-ID" `
-ResourceGroup "rg-utcm" `
-AutomationAccountName "aa-utcm" `
-KeyVaultName "kv-utcm" `
-Location "germanywestcentral"
# Was erstellt wird:
# 🏗️ Resource Group: rg-utcm
# 🔑 Key Vault: kv-utcm (mit Soft Delete, 90 Tage)
# ⚙️ Automation Account: aa-utcm (mit System Managed Identity)
# 🔐 KV-Berechtigung für Managed Identity
# 📦 PowerShell-Module im AA importiert
# 🔒 Secrets in Key Vault gespeichert
Das UTCM-PowerShell-Modul muss manuell im Automation Account verfügbar gemacht werden.
src/-Ordner als ZIP packen und hochladencd "C:\_GitHub\UTCM-API"
# src/ als UTCM.zip packen
Compress-Archive -Path .\src\* `
-DestinationPath .\UTCM-Module.zip -Force
# ZIP manuell im Azure Portal hochladen:
# Automation Account → Module → Modul hinzufügen → UTCM-Module.zip
Importieren Sie die Runbooks und planen Sie die automatische Ausführung.
# Runbooks hochladen (Azure CLI)
az automation runbook create `
--resource-group "rg-utcm" `
--automation-account-name "aa-utcm" `
--name "Start-UTCMSnapshot" `
--type "PowerShell72" `
--description "UTCM Snapshot Runbook"
az automation runbook replace-content `
--resource-group "rg-utcm" `
--automation-account-name "aa-utcm" `
--name "Start-UTCMSnapshot" `
--content @"C:\_GitHub\UTCM-API\src\AzureAutomation\Runbooks\Start-UTCMSnapshot.ps1"
az automation runbook publish `
--resource-group "rg-utcm" `
--automation-account-name "aa-utcm" `
--name "Start-UTCMSnapshot"
Connect-AzAccount -Subscription "IHRE-SUBSCRIPTION-ID"
# Täglichen Zeitplan erstellen (3:00 Uhr)
$schedule = New-AzAutomationSchedule `
-ResourceGroupName "rg-utcm" `
-AutomationAccountName "aa-utcm" `
-Name "UTCM-Daily-Snapshot" `
-StartTime (Get-Date "03:00").AddDays(1) `
-DayInterval 1
# Runbook mit Zeitplan verknüpfen
Register-AzAutomationScheduledRunbook `
-ResourceGroupName "rg-utcm" `
-AutomationAccountName "aa-utcm" `
-RunbookName "Start-UTCMSnapshot" `
-ScheduleName "UTCM-Daily-Snapshot"
Das Setup ist abgeschlossen. UTCM-API läuft jetzt vollautomatisch in Azure.
Connect-AzAccount -Subscription "IHRE-SUBSCRIPTION-ID"
Deploy-UTCMAzureWebApp `
-ResourceGroup "rg-utcm" `
-AppName "utcm-portal" `
-Location "germanywestcentral"
# Alternativ: GitHub Actions automatisch nach Push deployen
# (AZURE_STATIC_WEB_APPS_API_TOKEN als GitHub Secret setzen)
Erstellen Sie eine Multi-Tenant App-Registrierung im Entra Admin Center — kein PowerShell erforderlich.
UTCM-APIErteilen Sie der App-Registrierung die benötigten Microsoft Graph-Berechtigungen.
ConfigurationMonitoring.ReadWrite.AllGroup.ReadWrite.AllRoleManagement.Read.AllTenantGovernance.ReadWrite.AllDirectory.Read.AllTragen Sie Client-ID und Tenant-ID in den Einstellungen des Web-Interface ein.
localStorage des Browsers gespeichert und bleiben nach dem Neuladen erhalten.Das Web-Interface ist eingerichtet und einsatzbereit.
Import-Module "C:\_GitHub\UTCM-API\src\UTCM.psd1"
Connect-UTCMTenant
# Snapshot für alle Workloads
$job = New-UTCMSnapshotJob -DisplayName "Wöchentlicher Snapshot"
# Auf Abschluss warten
$job = Wait-UTCMSnapshotJob -JobId $job.id -TimeoutSeconds 300
# Daten abrufen (gefiltert nach Workload)
$entraData = Get-UTCMSnapshot -JobId $job.id -WorkloadFilter 'MicrosoftEntra'
$intuneData = Get-UTCMSnapshot -JobId $job.id -WorkloadFilter 'MicrosoftIntune'
# Alle Daten abrufen
$allData = Get-UTCMSnapshot -JobId $job.id
# Vorhandene Jobs abrufen
Get-UTCMSnapshotJob | Select-Object id, displayName, status, createdDateTime
Connect-UTCMTenant
# Baseline aus Snapshot erstellen
$baseline = New-UTCMBaseline `
-Name "Produktions-Baseline Juni 2026" `
-SnapshotJobId $job.id
# Monitor auf Basis der Baseline einrichten
$monitor = New-UTCMMonitor `
-DisplayName "CA-Policies Monitor" `
-BaselineId $baseline.id `
-IsEnabled $true
# Drifts abrufen (aktive Abweichungen)
$drifts = Get-UTCMDrift -Status Active
$drifts | Select-Object resourceDisplayName, workloadType, propertyName, `
expectedValue, currentValue, detectedDateTime
# Drift als behoben markieren
Resolve-UTCMDrift -DriftId $drifts[0].id
# Monitor-Ergebnisse abrufen
Get-UTCMMonitorResult -MonitorId $monitor.id -Status NonCompliant
Connect-UTCMTenant
$data = Get-UTCMSnapshot -JobId $job.id
# JSON (vollständig, für Import/Backup)
Export-UTCMToJson -InputObject $data -OutputPath .\exports
# Excel (ohne installiertes Office)
Export-UTCMToExcel -InputObject $data -OutputPath .\exports -AutoSize
# HTML-Bericht (statisch, offline nutzbar)
Export-UTCMToHtml -InputObject $data -OutputPath .\exports -OpenInBrowser
# Word-Dokument (.docx, ohne Word)
Export-UTCMToWord -InputObject $data -OutputPath .\exports
# PDF (benötigt Chrome oder Edge)
Export-UTCMToPdf -InputObject $data -OutputPath .\exports
Connect-UTCMTenant
# Importvorschau (Dry Run)
Import-UTCMConfig -JsonPath .\exports\utcm-snapshot.json -DryRun
# Import durchführen (erstellt TCM Baseline)
$result = Import-UTCMConfig `
-JsonPath .\exports\utcm-snapshot.json `
-WorkloadFilter @('MicrosoftEntra', 'MicrosoftIntune')
Write-Output "Baseline ID: $($result.BaselineId)"
Connect-UTCMTenant
# Tenant-Profil
Get-UTCMTenantProfile | Format-List
# Entra ID Konfiguration (CA-Policies, Auth-Methoden, ...)
$entra = Get-UTCMEntraConfig
$entra.ConditionalAccessPolicies | Where-Object { $_.state -eq 'enabled' }
# Intune Compliance-Policies
$intune = Get-UTCMIntuneConfig
$intune | Select-Object displayName, platforms, scheduledActionsForRule
# Teams Einstellungen
Get-UTCMTeamsConfig | Select-Object -ExpandProperty TeamworkAppSettings
| Funktion | Kategorie | Beschreibung |
|---|---|---|
Initialize-UTCMSetup | Setup | First-Run Wizard: App-Registrierung, Zertifikat, Consent-URL |
Connect-UTCMTenant | Setup | Verbindung zum Tenant (zertifikatbasiert, kein Login-Dialog) |
Disconnect-UTCMTenant | Setup | Token-Cache leeren, Verbindung trennen |
Initialize-UTCMModules | Setup | Benötigte PowerShell-Module installieren/prüfen |
Get-UTCMConfiguration | Setup | Konfiguration lesen (lokal oder aus Key Vault) |
Set-UTCMConfiguration | Setup | Konfiguration schreiben |
New-UTCMAppRegistration | Setup | Multi-Tenant App-Registrierung in Entra ID anlegen |
New-UTCMCertificate | Setup | Self-Signed Zertifikat für App-Auth erstellen |
Get-UTCMAccessToken | Setup | Aktuelles Access Token abrufen (mit Auto-Refresh) |
Get-UTCMAdminConsentUrl | Setup | Admin Consent URL generieren |
Invoke-UTCMAdminConsent | Setup | Admin Consent URL im Browser öffnen |
Get-UTCMEnvironment | Setup | Gibt 'Local' oder 'AzureAutomation' zurück |
Invoke-UTCMGraphRequest | Setup | Generischer Graph-API-Aufruf mit Retry/Throttle-Handling |
New-UTCMSnapshotJob | TCM | Neuen Snapshot-Job starten |
Get-UTCMSnapshotJob | TCM | Snapshot-Jobs auflisten oder einzelnen abrufen |
Wait-UTCMSnapshotJob | TCM | Warten bis Snapshot-Job abgeschlossen (mit Timeout) |
Get-UTCMSnapshot | TCM | Ressourcen aus abgeschlossenem Snapshot-Job lesen |
Remove-UTCMSnapshotJob | TCM | Snapshot-Job löschen |
New-UTCMMonitor | TCM | Neuen Drift-Monitor erstellen |
Get-UTCMMonitor | TCM | Monitore auflisten |
Set-UTCMMonitor | TCM | Monitor-Einstellungen ändern (aktivieren/deaktivieren) |
Remove-UTCMMonitor | TCM | Monitor löschen |
Get-UTCMMonitorResult | TCM | Monitor-Ergebnisse (Compliant/NonCompliant) |
Get-UTCMDrift | TCM | Konfigurationsabweichungen abrufen |
Resolve-UTCMDrift | TCM | Drift als behoben markieren |
New-UTCMBaseline | TCM | Neue Baseline aus Snapshot oder Ressourcen erstellen |
Get-UTCMBaseline | TCM | Baselines auflisten |
Get-UTCMTenantProfile | Tenant | Grundlegende Tenant-Informationen lesen |
Get-UTCMEntraConfig | Tenant | Entra ID Konfiguration (CA, Auth-Methoden, Security Defaults) |
Get-UTCMExchangeConfig | Tenant | Exchange Online Konfiguration via TCM Snapshot |
Get-UTCMIntuneConfig | Tenant | Intune Compliance- und Konfigurationsrichtlinien |
Get-UTCMTeamsConfig | Tenant | Microsoft Teams Einstellungen |
Get-UTCMDefenderConfig | Tenant | Microsoft Defender / Purview Konfiguration |
Export-UTCMToJson | Export | Als JSON mit Metadaten-Envelope exportieren |
Export-UTCMToExcel | Export | Als Excel-Workbook (.xlsx) exportieren (kein Office nötig) |
Export-UTCMToHtml | Export | Als statischen HTML-Bericht exportieren |
Export-UTCMToWord | Export | Als Word-Dokument (.docx) exportieren (OOXML, kein Word nötig) |
Export-UTCMToPdf | Export | Als PDF exportieren (benötigt Chrome oder Edge) |
Import-UTCMConfig | Import | JSON-Export in Ziel-Tenant importieren (via TCM Baseline) |
Initialize-UTCMAzureAutomation | Azure | Resource Group, Key Vault, Automation Account einrichten |
Deploy-UTCMAzureWebApp | Azure | Azure Static Web App deployen |
Das UTCM-Portal ist eine statische Single-Page-App mit MSAL.js-Authentifizierung. Es läuft auf IIS, Azure Static Web Apps, Cloudflare Pages oder direkt im Browser.
Die einfachste Option — Datei direkt im Browser öffnen.
# Einfach die index.html öffnen:
Start-Process "C:\_GitHub\UTCM-API\WebApp\index.html"
# Oder mit PowerShell:
Invoke-Item "C:\_GitHub\UTCM-API\WebApp\index.html"
Für unternehmensweiten Zugriff im lokalen Netz.
# WebApp-Ordner in IIS-Site kopieren
Copy-Item "C:\_GitHub\UTCM-API\WebApp\*" `
-Destination "C:\inetpub\wwwroot\utcm" `
-Recurse -Force
# In IIS: Neue Site oder virtuelles Verzeichnis
# Bind an Port 80/443, Root = C:\inetpub\wwwroot\utcm
Automatisches Deployment per GitHub Actions bei jedem Push.
AZURE_STATIC_WEB_APPS_API_TOKENmain-Branch pushen → automatisches Deployment via .github/workflows/deploy-webapp.yml# Azure CLI — Static Web App erstellen
az staticwebapp create `
--name "utcm-portal" `
--resource-group "rg-utcm" `
--location "germanywestcentral" `
--sku Free `
--source "https://github.com/MKN1411/UTCM-API-Beta" `
--branch "main" `
--app-location "WebApp"
Alternative zu Azure — global gehostet, kostenloser Tarif, kein Azure-Konto nötig.
WebApp/wrangler.toml gelesen.https://utcm-portal.pages.dev oder https://projektname.konto.workers.dev — siehe Cloudflare Dashboard)CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID.github/workflows/deploy-cloudflare.yml deployt nur bei Änderungen in WebApp/**
Das Web-Interface nutzt MSAL.js (PKCE-Flow) mit der gleichen App-Registrierung wie die PowerShell-Bibliothek.
http://localhost — für lokalen Aufruf / direkte Dateiöffnunghttps://ihr-iis-server/utcm — für IIShttps://utcm-portal.azurestaticapps.net — für Azure Static Web Appshttps://utcm-portal.pages.dev — Beispiel-Standard-Domain bei Cloudflare Pageshttps://projektname.konto.workers.dev — alternative Workers-Domain (von Cloudflare auto-generiert)https://ihre-domain.com — für eigene benutzerdefinierte DomainConnect-MgGraph -Scopes 'Application.ReadWrite.All'
$app = Get-MgApplication -Filter "displayName eq 'UTCM-API'"
$redirectUris = $app.Spa.RedirectUris + @(
'http://localhost',
'https://utcm-portal.azurestaticapps.net'
)
Update-MgApplication -ApplicationId $app.Id `
-Spa @{ RedirectUris = $redirectUris }