https://github.com/scns/windows-update-report-multitenant
Windows Update Report MultiTenant is een PowerShell-oplossing voor het centraal monitoren van ontbrekende Windows-updates over meerdere Microsoft 365-tenants. Het script gebruikt de Microsoft Graph Threat Hunting API om per tenant updategegevens op te halen en genereert automatisch een interactief HTML-dashboard met filterbare tabellen en grafieken
https://github.com/scns/windows-update-report-multitenant
azure powershell powershell-script update windows windows-update
Last synced: 18 days ago
JSON representation
Windows Update Report MultiTenant is een PowerShell-oplossing voor het centraal monitoren van ontbrekende Windows-updates over meerdere Microsoft 365-tenants. Het script gebruikt de Microsoft Graph Threat Hunting API om per tenant updategegevens op te halen en genereert automatisch een interactief HTML-dashboard met filterbare tabellen en grafieken
- Host: GitHub
- URL: https://github.com/scns/windows-update-report-multitenant
- Owner: scns
- License: mit
- Created: 2025-07-15T08:54:30.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2026-06-03T04:58:41.000Z (26 days ago)
- Last Synced: 2026-06-03T06:26:37.219Z (26 days ago)
- Topics: azure, powershell, powershell-script, update, windows, windows-update
- Language: PowerShell
- Homepage: https://mrtn.blog
- Size: 504 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Windows Update Report MultiTenant v3.0
| Repository Status | Windows Update Report |
| :--- | :--- |
| [![last commit time][github-last-commit]][github-master] [![GitHub Activity][commits-shield]][commits] | |
| [![License][license-shield]](LICENSE) [![Forks][forks-shield]][forks-url] [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] | [![Contributors][contributors-shield]][contributors-url] [](https://GitHub.com/scns/Windows-Update-Report-MultiTenant/releases) |

Dit PowerShell-project genereert een uitgebreid overzichtsrapport van Windows Update en device compliance status voor meerdere tenants via Microsoft Graph. Het resultaat is een professioneel HTML-dashboard met filterbare tabellen, grafieken, compliance monitoring en gedetailleerde KB informatie.
## π― Versie 3.1 Hoogtepunten
- **π‘οΈ Device Compliance Integration**: Volledige Microsoft Graph compliance monitoring
- **π Intelligent Backup System**: Automatische backups met retention management
- **π¨ Modern UI**: Dark/Light theme support met streamlined interface
- **π Timezone Support**: Configureerbare tijdzone weergave voor accurate timestamps
- **π¦ Enhanced Configuration**: Uitgebreide configuratie-opties voor alle functionaliteiten
- **ποΈ KB Database Caching**: Intelligent caching systeem voor KB mapping database
## π **Backup & Archivering System**
- **Automatische Backups**: Configureerbare backup van exports, archive en configuratiebestanden
- **Retention Management**: Instelbare bewaarperiode per backup type (standaard 5 backups)
- **Intelligente Cleanup**: Automatische verwijdering van oude backups met logging
- **Separate Backup Types**:
- **Export Backup**: `backup/export_backup/` - Dagelijkse exports
- **Archive Backup**: `backup/archive_backup/` - Gearchiveerde bestanden
- **Config Backup**: `backup/config_backup/` - Configuratie en credentials
- **Granular Control**: Per backup type aan/uit te schakelen
- **Status Logging**: Duidelijke feedback over backup creation en cleanup
## π **Timezone Support**
- **Configureerbare Offset**: Instelbare tijdzone via `timezoneOffsetHours` in config.json
- **Robuuste Conversie**: Ondersteunt meerdere DateTime formaten voor maximale compatibiliteit
- **UTC Detection**: Intelligente tijdzone detectie en conversie
- **Visual Feedback**: HTML headers tonen tijdzone informatie (bijv. "LastSeen (UTC+2)")
- **Accurate Calculations**: Verbeterde sync berekeningen met tijdzone correctie
## π Hoofdfunctionaliteit
- **Automatische module installatie**: Controleert en installeert automatisch benodigde PowerShell modules
- **Configureerbare instellingen**: Alle instellingen beheerbaar via `config.json`
- **Multi-tenant ondersteuning**: Haalt per tenant Windows Update en compliance status op via Microsoft Graph
- **Device Compliance Monitoring**: Complete device compliance status tracking via Microsoft Graph API
- **Intelligente KB detectie**: Toont specifieke ontbrekende KB nummers en security patches
- **KB Mapping Database**: Uitgebreide online database met intelligent caching systeem
- **OS versie analyse**: Automatische detectie van verouderde Windows builds en aanbevelingen
- **Timezone ondersteuning**: Configureerbare tijdzone conversie voor accurate LastSeen tijden
- **Flexibele export opties**: Exporteert resultaten naar CSV-bestanden per klant inclusief compliance data
- **Interactief HTML-dashboard**: Professioneel dashboard met filterbare tabellen, snelfilters en grafieken
- **Intelligente bestandsbeheer**: Automatische archivering van oude export bestanden
- **Automatische browser integratie**: Configureerbaar automatisch openen van het gegenereerde rapport
## π Nieuwe Functionaliteiten v3.0
### π‘οΈ **Device Compliance Monitoring**
- **Microsoft Graph Integration**: Volledige integratie met `deviceCompliancePolicyStates` API
- **Compliance Status Tracking**:
- **Compliant**: Device voldoet aan alle compliance policies
- **Non-Compliant**: Device heeft compliance issues gedetecteerd
- **Geen data**: Geen compliance informatie beschikbaar
- **Error**: Fout opgetreden tijdens compliance controle
- **Visual Indicators**: Kleurgecodeerde compliance status (groen/rood/grijs/oranje)
- **Dedicated Filtering**: Non-Compliant quick filter voor snelle problem identification
- **CSV Export**: Compliance status opgenomen in alle export bestanden
- **Dropdown Filters**: Compliance Status kolom heeft eigen dropdown filter
### π¨ **Theme Support**
- **Dark/Light Mode**: Configureerbare standaard theme in config.json
- **Browser Toggle**: Runtime switching tussen dark en light mode
- **Consistent Styling**: Alle UI elementen ondersteunen beide themes
- **Professional Design**: Moderne styling met optimale leesbaarheid
### π― **Intelligente Update Detectie**
- **Specifieke KB nummers**: Toont ontbrekende KB updates zoals "KB5041585" voor machines met verouderde OS
- **Build analyse**: Analyseert OS versie verschillen en suggereert benodigde cumulative updates
- **Update status categorieΓ«n**:
- "Up-to-date", "Verouderde OS versie", "Handmatige controle vereist"
- "Waarschijnlijk up-to-date", "Updates wachtend", "Update fouten"
- "Compliance problemen", "Synchronisatie vereist", "Error"
### ποΈ **KB Mapping Database & Intelligent Caching**
- **Online KB database**: Uitgebreide mapping van Windows build numbers naar specifieke KB updates
- **Intelligent caching systeem**: Downloads KB database eenmalig en cached voor configureerbare duur (standaard 30 minuten)
- **Fallback mechanisme**: Gebruikt expired cache bij netwerk problemen voor betrouwbaarheid
- **Database overzicht**: Dedicated dashboard tab toont beschikbare mappings en cache status
- **Performance optimalisatie**: Vermindert server load met 95%+ door slim caching
- **Multi-platform support**: Ondersteunt Windows 10, Windows 11 en historische versies
- **Cache methode tracking**: Toont bron van KB informatie (Online, Cache, ExpiredCache, Local, Estimated)
### π¦ **Office Version Tracking & Channel Management (v2.0)**
- **Office versie detectie**: Automatische detectie van Microsoft 365 Apps versies per device via Graph API
- **Verbeterde Office Channel herkenning**: Intelligente classificatie met leeftijdsdetectie en nauwkeurige versie matching:
- **Current Channel (Actueel)** - nieuwste release (build >= 19426) β Groen, bold
- **Current Channel (Recent)** - recente release < 30 dagen oud (build 19328-19425) β Groen
- **Current Channel (Verouderd)** - oude release > 30 dagen oud (build 19328-19425) β Oranje β οΈ
- **Monthly Enterprise** - ondersteunde Monthly Enterprise builds (19127-19327) β Groen
- **Semi-Annual Enterprise** - oudere maar ondersteunde versies (17928-19126) β Oranje
- **Verouderd/EOL** - zeer oude versies < build 17928 β Rood, bold β
- **Onbekend** - versies die niet gedetecteerd konden worden β Grijs
- **Office Mapping Database v2.0**:
- Uitgebreide versiegeschiedenis met 43 Current Channel releases (laatste 12 maanden)
- Gedetailleerde build informatie met release dates en age_days
- 11 Monthly Enterprise Channel releases met end-of-support datums
- Rule-based classification system met prioriteit
- Full build nummer ondersteuning (major + minor versie)
- **Leeftijdsdetectie**: Automatische berekening van versie leeftijd met:
- Exacte matching tegen version_history database
- Geschatte leeftijd voor onbekende builds
- Intelligente degradatie van status bij verouderde versies
- **Visual Indicators**: Kleurgecodeerde Office versies met status tooltips
- **Office Versions Tab**: Dashboard tab met:
- Overzicht van alle Office update channels
- Release dates en end-of-support informatie
- Versiegeschiedenis en aanbevolen updates
- CSV export functionaliteit
- **Export ondersteuning**: Office versie, channel en status in alle CSV exports
- **Online-first caching**:
- Office mapping wordt online opgehaald van GitHub
- 30 minuten cache voor performance
- Fallback naar lokale file bij netwerk problemen
### πͺ **Windows Edition & Support Status Tracking**
- **Windows Edition detectie**: Automatische herkenning van Windows versies op basis van build numbers
- **Support status kleurcodering**: Visuele indicatoren voor Windows support lifecycle:
- **W11 25H2** (groen, bold) - Nieuwste versie, volledig ondersteund
- **W11 24H2** (groen, bold) - In support tot oktober 2026
- **W11 23H2** (groen) - In support tot november 2025
- **W11 22H2** (oranje) - Beperkte support, EOL oktober 2024 (Pro) / oktober 2025 (Enterprise)
- **W11 21H2** (rood, bold) - End of Life, EOL oktober 2023
- **W10 22H2** (oranje) - Eindigt oktober 2025
- **W10 21H2 en ouder** (rood, bold) - End of Life
- **Windows Edition kolom**: Dedicated kolom toont duidelijke Windows versie aanduiding (bijv. "W11 24H2", "W10 22H2")
- **Dubbele visualisatie**: Zowel OS Version (build number) als Windows Edition kolom met kleurcodering
- **Support awareness**: Snelle identificatie van systemen die dringend een upgrade nodig hebben
### π **Geavanceerde Filtering & UI**
- **Dropdown filters**: Update Status en Compliance Status kolommen hebben dropdown met alle beschikbare opties
- **Snelfilter knoppen**: Kleurgecodeerde knoppen voor directe filtering op:
- Up-to-date (groen), Updates Wachtend (geel), Update Fouten (rood)
- Verouderde OS (oranje), Handmatige Controle (paars), Non-Compliant (unieke rode kleur)
- **Filter Synchronisatie**: Automatische reset van conflicterende filters voor consistente ervaring
- **Dark Theme Support**: Optimale zichtbaarheid in zowel light als dark browser themes
- **Streamlined Table**: KB Method kolom verwijderd voor cleaner interface
- **Export Functies**: Volledige tabel export en gefilterde export opties per klant
### π **Enhanced Dashboard & Statistics**
- **Globale Statistieken**: Overzicht van alle tenants met totalen en percentages
- **Per-Client Statistieken**: Gedetailleerde breakdown per klant met visual cards
- **Compliance Percentages**: Up-to-date percentages en compliance ratios
- **Interactive Charts**: Chart.js grafieken met per-klant filtering
- **Professional Styling**: Moderne UI met responsive design
- **App Registration Monitoring**: Dedicated tab voor certificate expiry tracking
## π Vereiste Microsoft Graph API Permissions
Voor volledige functionaliteit zijn de volgende **Application Permissions** vereist:
> **β οΈ Belangrijk**: Configureer deze permissions als **Application permissions** (niet Delegated permissions) in je Azure App Registration.
### π Device Management & Configuration
```text
DeviceManagementManagedDevices.Read.All (Application)
DeviceManagementConfiguration.Read.All (Application)
```
**Voor**: Device management API, compliance policy states, en device configuration informatie
### π‘οΈ Security & Threat Hunting
```text
ThreatHunting.Read.All (Application)
SecurityEvents.Read.All (Application)
```
**Voor**: Advanced Hunting KQL queries en security event informatie
### π Directory & Device Information
```text
Device.Read.All (Application)
```
**Voor**: Device directory informatie en organizational context
### βοΈ Application & Windows Updates Management
```text
Application.Read.All (Application)
WindowsUpdates.ReadWrite.All (Application)
```
**Voor**: App Registration expiry monitoring en certificate status
## π οΈ Installatie & Setup
### 1. Repository Setup
```powershell
git clone https://github.com/scns/Windows-Update-Report-MultiTenant.git
cd Windows-Update-Report-MultiTenant
```
### 2. Configuratie
```powershell
# Kopieer template bestanden (voor nieuwe installaties)
Copy-Item "_config.json" "config.json"
Copy-Item "_credentials.json" "credentials.json"
# Pas configuratie aan
notepad config.json
notepad credentials.json
```
**Voor bestaande installaties:** Vergelijk je huidige config.json met _config.json om nieuwe opties toe te voegen.
**π Uitgebreide credentials setup:** Zie [CREDENTIALS-SETUP.md](CREDENTIALS-SETUP.md) voor gedetailleerde instructies.
## π Upgrade van v2.x naar v3.0
Voor bestaande gebruikers zijn er enkele belangrijke wijzigingen:
### Configuratie Updates
```powershell
# Backup je huidige configuratie
Copy-Item "config.json" "config_backup.json"
# Vergelijk met nieuwe template en voeg nieuwe opties toe
# Nieuwe opties in v3.0:
# - timezoneOffsetHours
# - backup sectie (enableExportBackup, etc.)
# - theme sectie
# - kbMapping uitgebreid
```
### Nieuwe Features
1. **Backup System**: Configureer automatische backups in config.json
2. **Timezone Support**: Stel `timezoneOffsetHours` in voor je locatie
3. **Theme Preference**: Kies tussen "light" en "dark" als standaard
4. **Streamlined Interface**: KB Method kolom is verwijderd voor een cleanere UI
### Backward Compatibility
- Bestaande config.json bestanden blijven werken
- Nieuwe features hebben veilige standaardinstellingen
- Geen breaking changes in credentials.json formaat
### 3. Azure App Registration Setup
1. Ga naar [Azure Portal](https://portal.azure.com) β Azure Active Directory β App registrations
2. Maak nieuwe App Registration aan per tenant/klant
3. Voeg de vereiste API permissions toe:
- `DeviceManagementManagedDevices.Read.All`
- `DeviceManagementConfiguration.Read.All`
- `ThreatHunting.Read.All`
- `Device.Read.All`
- `Directory.Read.All`
- `Application.Read.All`
4. **Grant admin consent** voor alle permissions
5. Genereer client secret (noteer deze veilig!)
6. Vul `credentials.json` in met tenant ID, client ID en client secret per klant
### 4. Eerste Run
```powershell
# Start het script - automatische module installatie
.\get-windows-update-report.ps1
```
Het script installeert automatisch benodigde PowerShell modules en genereert het eerste rapport.
### 5. Output Locaties
- **HTML Dashboard**: `exports/Windows_Update_Overview.html`
- **CSV Exports**: `exports/YYYYMMDD_KlantNaam_Windows_Update_report_*.csv`
- **Archived Files**: `archive/` (oudere exports)
- **Backups**: `backup/` (automatische backups)
## βοΈ Configuratie Opties
### Basis Configuratie
```json
{
"exportRetentionCount": 40,
"cleanupOldExports": true,
"exportDirectory": "exports",
"archiveDirectory": "archive",
"autoOpenHtmlReport": true,
"lastSeenDaysFilter": 0,
"timezoneOffsetHours": 2
}
```
**Opties:**
- `exportRetentionCount`: Aantal export bestanden om te bewaren (standaard: 40)
- `cleanupOldExports`: Automatisch opruimen van oude exports (true/false)
- `lastSeenDaysFilter`: Filter machines op laatste online tijd (0 = alle machines)
- `autoOpenHtmlReport`: Automatisch openen van rapport in browser
### Timezone Configuration
```json
{
"timezoneOffsetHours": 2
}
```
**Opties:**
- **Nederland (zomer)**: `2` (UTC+2)
- **Nederland (winter)**: `1` (UTC+1)
- **UTC tijd**: `0`
- **US Eastern**: `-5` (UTC-5)
### KB Mapping Database
```json
{
"kbMapping": {
"kbMappingUrl": "https://raw.githubusercontent.com/scns/Windows-Update-Report-MultiTenant/refs/heads/main/kb-mapping.json",
"timeoutSeconds": 10,
"cacheValidMinutes": 30,
"estimationThreshold": 1000,
"showEstimationLabels": true,
"fallbackToLocalMapping": true,
"estimationLabels": {
"buildDifference": "(geschat voor build {targetBuild})",
"noMapping": "(geschat)",
"oldMapping": "(verouderd)"
}
}
}
```
### Office Version Mapping
```json
{
"officeMapping": {
"officeMappingUrl": "https://raw.githubusercontent.com/scns/Windows-Update-Report-MultiTenant/refs/heads/main/office-version-mapping.json",
"timeoutSeconds": 10,
"cacheValidMinutes": 30,
"fallbackToLocalMapping": true
}
}
```
### Backup System
```json
{
"backup": {
"enableExportBackup": true,
"enableArchiveBackup": true,
"enableConfigBackup": true,
"exportBackupRetention": 5,
"archiveBackupRetention": 5,
"configBackupRetention": 5,
"backupRoot": "backup",
"exportBackupSubfolder": "export_backup",
"archiveBackupSubfolder": "archive_backup",
"configBackupSubfolder": "config_backup"
}
}
```
**Backup Types:**
- **Export Backup**: Dagelijkse backup van alle CSV exports
- **Archive Backup**: Backup van gearchiveerde bestanden
- **Config Backup**: Backup van config.json, credentials.json, kb-mapping.json
### Theme Configuration
```json
{
"theme": {
"default": "dark"
}
}
```
**Opties:**
- `"light"`: Light theme als standaard
- `"dark"`: Dark theme als standaard
## π Bestandsstructuur
```text
Windows-Update-Report-MultiTenant/
βββ get-windows-update-report.ps1 # Hoofd PowerShell script
βββ config.json # Configuratie instellingen
βββ credentials.json # Tenant credentials (exclusief git)
βββ kb-mapping.json # Lokale KB mapping database
βββ exports/ # Gegenereerde rapporten
βββ archive/ # Gearchiveerde oude exports
βββ backup/ # Automatische backups
βββ images/ # Dashboard screenshots
βββ CONFIG-UITLEG.md # Gedetailleerde configuratie uitleg
βββ KB-CACHING-INFO.md # KB caching documentatie
βββ SECURITY.md # Beveiligingsbeleid
βββ CONTRIBUTING.md # Contributie richtlijnen
βββ CODE_OF_CONDUCT.md # Gedragscode
```
## π§ Troubleshooting
### Permissions Errors
- Controleer of alle vereiste API permissions zijn toegekend
- Zorg ervoor dat permissions zijn "granted" door een admin
- Controleer client secret geldigheid
### Timezone Issues
- Pas `timezoneOffsetHours` aan in config.json
- Check of LastSeen tijden correct worden weergegeven
- Gebruik UTC offset voor uw tijdzone
### Cache Problems
- KB mapping cache wordt automatisch ververst na 30 minuten
- Bij problemen: verwijder `Global:CachedKBMapping` variabele
- Check internet connectiviteit voor online KB database
### Compliance Data Missing
- Zorg ervoor dat `DeviceManagementConfiguration.Read.All` permission is toegekend
- Controleer of devices enrolled zijn in Intune
- Fallback naar "Geen data" status is normaal voor niet-managed devices
## π Documentatie Links
- **[Configuratie Uitleg](CONFIG-UITLEG.md)** - Gedetailleerde uitleg van alle config opties
- **[Credentials Setup](CREDENTIALS-SETUP.md)** - Stap-voor-stap Azure App Registration setup
- **[KB Caching Info](KB-CACHING-INFO.md)** - KB mapping cache configuratie en troubleshooting
- **[Security Policy](SECURITY.md)** - Beveiligingsbeleid en kwetsbaarheid rapportage
- **[Contributing Guidelines](CONTRIBUTING.md)** - Richtlijnen voor bijdragen aan het project
- **[Code of Conduct](CODE_OF_CONDUCT.md)** - Gedragscode voor contributors
## π€ Contributing
Bijdragen zijn welkom! Zie [CONTRIBUTING.md](CONTRIBUTING.md) voor richtlijnen.
## π License
Dit project valt onder de [MIT License](LICENSE).
## π Security
Voor beveiligingsgerelateerde zaken, zie [SECURITY.md](SECURITY.md).
## π Support
- **Issues**: [GitHub Issues](https://github.com/scns/Windows-Update-Report-MultiTenant/issues)
- **Email**: [info@maarten-schmeitz.nl](mailto:info@maarten-schmeitz.nl)
- **Documentation**: Zie de bijgevoegde MD bestanden voor gedetailleerde informatie
---
**Versie**: 3.0 | **Laatste Update**: Augustus 2025 | **PowerShell**: 7.2+ | **Microsoft Graph**: v1.0 & Beta
## Benodigdheden
- PowerShell 7.2+
- Microsoft Graph PowerShell SDK (wordt automatisch geΓ―nstalleerd)
- Een Azure AD App Registration per tenant met de juiste permissies
## Voorbereiding
### 1. Maak een Azure AD App Registration aan
1. Ga naar [Azure Portal - App registrations](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps).
2. Klik op **New registration** en geef de app een naam.
3. Na het aanmaken, ga naar **API permissions**.
4. **Verwijder alle standaard toegevoegde permissies** (zoals `User.Read`).
5. Voeg de volgende Microsoft Graph **Application** permissies toe:
#### Voor optimale functionaliteit (aanbevolen)
- `DeviceManagementManagedDevices.Read.All` - Voor gedetailleerde Windows Update informatie
- `ThreatHunting.Read.All` - Voor fallback functionaliteit
- `Application.Read.All` - Voor App Registration geldigheid monitoring
#### Minimale vereisten (fallback functionaliteit)
- `ThreatHunting.Read.All` - Voor basis Windows Update informatie
- `Application.Read.All` - Voor App Registration geldigheid monitoring
1. Klik op **Grant admin consent** voor deze permissies.
2. Ga naar **Certificates & secrets** en maak een nieuwe client secret aan. Noteer deze waarde direct.
> **π‘ Tip**: Met `DeviceManagementManagedDevices.Read.All` krijg je specifieke KB nummers en gedetailleerde update informatie. Zonder deze permissie valt het script terug op basis functionaliteit via de Threat Hunting API.
### 2. Configureer het project
#### Credentials bestand
**Voor nieuwe installaties:**
1. Hernoem `_credentials.json` naar `credentials.json`
2. Vul de juiste waarden in voor je tenants
**Voor bestaande installaties:**
- Je bestaande `credentials.json` blijft werken zoals het is
- Geen wijzigingen nodig
Het `credentials.json` bestand heeft het volgende format:
```json
{
"LoginCredentials": [
{
"ClientID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"Secret": "YOUR-CLIENT-SECRET",
"TenantID": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"customername": "KlantNaam",
"color": "#1f77b4"
}
// Voeg meer tenants toe indien nodig
]
}
```
**color**: Geef per klant een vaste HTML kleurcode op (hex, bijvoorbeeld `#1f77b4`). Deze kleur wordt gebruikt in de grafieken van het HTML-dashboard.
#### Configuratie bestand
**Voor nieuwe installaties:**
1. Hernoem `_config.json` naar `config.json`
2. Pas de instellingen aan naar jouw behoeften
**Voor bestaande installaties:**
- Als je al een `config.json` hebt, voeg eventueel ontbrekende opties toe
- Vergelijk met `_config.json` om te zien welke nieuwe opties beschikbaar zijn
Het `config.json` bestand bevat alle instellingen:
```json
{
"exportRetentionCount": 40,
"cleanupOldExports": true,
"exportDirectory": "exports",
"archiveDirectory": "archive",
"autoOpenHtmlReport": true,
"lastSeenDaysFilter": 0,
"kbMapping": {
"kbMappingUrl": "https://mrtn.blog/wp-content/uploads/2025/08/kb-mapping.json",
"timeoutSeconds": 10,
"cacheValidMinutes": 30,
"estimationThreshold": 1000,
"showEstimationLabels": true,
"fallbackToLocalMapping": true,
"estimationLabels": {
"buildDifference": "(geschat voor build {targetBuild})",
"noMapping": "(geschat)",
"oldMapping": "(verouderd)"
}
},
"theme": {
"default": "dark"
}
}
```
**Configuratie opties:**
- `exportRetentionCount`: Aantal export bestanden dat behouden blijft per klant/type (oudere worden gearchiveerd)
- `cleanupOldExports`: Schakel automatische archivering in/uit (true/false)
- `exportDirectory`: Directory waar nieuwe export bestanden worden opgeslagen
- `archiveDirectory`: Directory waar oude export bestanden worden gearchiveerd
- `autoOpenHtmlReport`: Automatisch openen van HTML-rapport in webbrowser (true/false)
- `lastSeenDaysFilter`: Filtert de rapportage op basis van het aantal dagen sinds een device voor het laatst gezien is
- `kbMapping.kbMappingUrl`: URL naar online KB mapping database
- `kbMapping.timeoutSeconds`: Timeout voor online KB database requests (standaard: 10)
- `kbMapping.cacheValidMinutes`: Cache geldigheid in minuten (standaard: 30)
- `kbMapping.estimationThreshold`: Build verschil drempel voor KB estimaties
- `kbMapping.showEstimationLabels`: Toon labels voor geschatte KB nummers
- `kbMapping.fallbackToLocalMapping`: Gebruik lokale mapping als fallback
- `officeMapping.officeMappingUrl`: URL naar online Office version mapping database
- `officeMapping.timeoutSeconds`: Timeout voor online Office mapping requests (standaard: 10)
- `officeMapping.cacheValidMinutes`: Cache geldigheid in minuten (standaard: 30)
- `officeMapping.fallbackToLocalMapping`: Gebruik lokale Office mapping als fallback
- `theme.default`: Standaard thema voor het dashboard ("dark" of "light")
> π **Gedetailleerde configuratie uitleg**: Voor uitgebreide informatie over elke configuratie optie, zie [CONFIG-UITLEG.md](CONFIG-UITLEG.md)
### 3. Installeer benodigde PowerShell-modules
De benodigde modules worden automatisch geΓ―nstalleerd bij het eerste gebruik van het script. Handmatige installatie is niet meer nodig.
## Gebruik
1. **Voor nieuwe installaties**: Hernoem `_credentials.json` naar `credentials.json` en `_config.json` naar `config.json`
2. **Voor bestaande installaties**: Controleer of je `config.json` alle benodigde opties bevat (vergelijk met `_config.json`)
3. Vul je tenant gegevens in het `credentials.json` bestand
4. Pas de instellingen in `config.json` aan naar jouw behoeften
5. Start het script:
```powershell
.\get-windows-update-report.ps1
```
1. Het script zal:
- Automatisch benodigde modules installeren (indien nodig)
- App Registration geldigheid controleren per tenant
- Windows Update status ophalen via Device Management API (of fallback naar Threat Hunting API)
- OS versie analyse uitvoeren en verouderde builds detecteren
- Ontbrekende KB nummers identificeren voor machines met verouderde OS
- CSV-bestanden genereren per klant met gedetailleerde informatie
- Oude bestanden archiveren (indien geconfigureerd)
- Een HTML-dashboard genereren met filterbare tabellen en snelfilters
- Het rapport automatisch openen in je standaard webbrowser
2. De resultaten vind je in de geconfigureerde export directory, inclusief het interactieve HTML-dashboard.
## HTML Dashboard Functionaliteiten
### π **Overzichtstabellen per Klant**
- **Filterbare DataTables**: Zoeken en sorteren op alle kolommen
- **Update Status dropdown**: Directe filtering op specifieke statussen
- **Snelfilter knoppen**: Kleurgecodeerde knoppen voor veelgebruikte filters
- **Export functionaliteit**: Exporteer volledige of gefilterde resultaten naar CSV
### π― **Kolom Informatie**
| Kolom | Beschrijving |
|-------|-------------|
| **Device** | Computer naam |
| **Update Status** | Overall status (Up-to-date, Verouderde OS versie, etc.) |
| **Missing Updates** | Specifieke KB nummers en update namen die ontbreken |
| **Details** | Statusberichten en diagnostische informatie |
| **OS Version** | Windows build versie |
| **KB Method** | Bron van KB informatie (Online, Cache, ExpiredCache, Local, Estimated) |
| **Count** | Binary indicator (0 = OK, 1 = aandacht vereist) |
| **LastSeen** | Laatste synchronisatie datum |
| **LoggedOnUsers** | Huidige gebruikers |
### π **Filter Functionaliteiten**
```html
π Alle statussen π’ Up-to-date π Verouderde OS
π΄ Handmatige controle π΅ Waarschijnlijk up-to-date π£ Errors
```
### π **Grafieken en Analyses**
- **Count trend per dag**: Laat zien hoe de Windows Update situatie evolueert
- **Per klant overzicht**: Vergelijk update status tussen verschillende tenants
- **OS versie analyse**: Percentage verdeling van Windows builds
### π **Thema Ondersteuning**
- **Dark/Light mode toggle**: Schakel eenvoudig tussen donker en licht thema
- **Configureerbare standaard**: Stel je voorkeur in via `config.json`
- **Gebruiksvriendelijk**: FontAwesome iconen voor consistente weergave
### ποΈ **KB Mapping Database Dashboard**
Het HTML-dashboard bevat een dedicated "KB Mapping Database" tabblad dat uitgebreide informatie toont over de KB mapping database:
#### Database Status Overzicht
- **Database Status**: β
Beschikbaar / β Niet beschikbaar
- **Bron Methode**: Online, Cache, ExpiredCache, Error, of Exception
- **Totaal Entries**: Aantal beschikbare KB mappings in de database
- **Laatste Update**: Timestamp van laatste cache refresh
#### KB Mapping Tabel
**Volledige database weergave** met filterbare/sorteerbare kolommen:
- **Build Number**: Windows OS build nummer (bijv. 26100, 22631)
- **KB Number**: Corresponderende KB update (bijv. KB5041585)
- **Update Title**: Beschrijving van de update
- **Release Date**: OfficiΓ«le release datum van de update
- **OS Version**: Windows versie categorie (Windows 11 24H2, Windows 10 22H2, Historical)
#### Cache Intelligence Features
- **Real-time status**: Toont huidige cache status en bron van informatie
- **Performance metrics**: Zichtbaarheid in cache effectiviteit
- **Fallback transparency**: Duidelijke indicatie wanneer fallback wordt gebruikt
- **Historical data**: Toegang tot historische KB mappings per jaar
## API Methodologie en Fallback
### π― **Primary Method: Device Management API**
**Vereist**: `DeviceManagementManagedDevices.Read.All` permissie
**Voordelen**:
- Specifieke KB nummers van ontbrekende updates
- Detailed compliance informatie
- Windows Update state tracking
- Configuration policy violations
**Voorbeeld output**:
```text
Missing Updates: "2024-08 Cumulative Update voor Windows (KB5041585 of nieuwer)"
Details: "Windows Update status: Recent gesynchroniseerd, geen problemen"
```
### π **Fallback Method: Threat Hunting API**
**Vereist**: `ThreatHunting.Read.All` permissie
**Gebruikt wanneer**:
- Device Management API niet beschikbaar
- Onvoldoende permissies voor Device Management
- Tenant heeft geen Intune licenties
**Output**:
```text
Missing Updates: (leeg - geen specifieke KB info beschikbaar)
Details: "Windows Update status: Controleer handmatig - Device niet in Intune beheer"
```
### π§ **Intelligente OS Analyse**
**Voor alle scenarios**:
Ongeacht welke API gebruikt wordt, het script analyseert OS versies en:
- Detecteert nieuwste Windows build in de omgeving
- Identificeert machines met verouderde builds
- Suggereert specifieke KB updates voor bekende build verschillen
- Geeft praktische aanbevelingen voor IT beheerders
**Voorbeeld voor verouderde OS**:
```text
Missing Updates: "Waarschijnlijk ontbrekende cumulative update (build verschil: 294); 2024-08 Cumulative Update voor Windows (KB5041585 of nieuwer)"
Update Status: "Verouderde OS versie"
```
## Bestandsstructuur
### Template bestanden (meegeleverd)
```text
Windows-Update-Report-MultiTenant/
βββ _credentials.json # Template voor credentials (hernoem naar credentials.json)
βββ _config.json # Template voor configuratie (hernoem naar config.json)
βββ CONFIG-UITLEG.md # Gedetailleerde configuratie uitleg
βββ get-windows-update-report.ps1
βββ readme.md
```
### Na configuratie en uitvoering
```text
Windows-Update-Report-MultiTenant/
βββ _credentials.json # Template bestand (blijft bestaan)
βββ _config.json # Template bestand (blijft bestaan)
βββ credentials.json # Jouw tenant configuratie
βββ config.json # Jouw instellingen
βββ CONFIG-UITLEG.md
βββ get-windows-update-report.ps1
βββ exports/ # Configureerbare export directory
β βββ 20250822_KlantA_Windows_Update_report_Overview.csv
β βββ 20250822_KlantA_Windows_Update_report_ByUpdate.csv
β βββ 20250822_KlantB_Windows_Update_report_Overview.csv
β βββ 20250822_KlantB_Windows_Update_report_ByUpdate.csv
β βββ Windows_Update_Overview.html
βββ archive/ # Oude bestanden worden hier gearchiveerd
βββ 20250821_KlantA_Windows_Update_report_Overview.csv
βββ ... (oudere bestanden)
```
## Nieuwe functies in v3.0
### π― **KB Detection & Update Intelligence**
- **Specifieke KB nummers**: Identificeert ontbrekende updates zoals KB5041585
- **Build gap analyse**: Analyseert verschil tussen huidige en nieuwste OS builds
- **Smart suggestions**: Geeft praktische aanbevelingen op basis van build verschillen
- **Multiple API support**: Device Management API met Threat Hunting fallback
### ποΈ **KnowledgeBase Mapping Database & Intelligent Caching**
- **Online KB database**: Uitgebreide externe database met Windows Update KB mappings
- **Intelligent caching**: Downloads database eenmalig per sessie, cached voor 30 minuten (configureerbaar)
- **Performance optimalisatie**: Vermindert server load met 95%+ door slim cache beheer
- **Fallback mechanisme**: Gebruikt expired cache bij netwerk problemen voor maximale betrouwbaarheid
- **Cache transparantie**: KB Method kolom toont bron van elke KB lookup (Online/Cache/ExpiredCache/Local/Estimated)
- **Multi-platform database**: Ondersteunt Windows 10, Windows 11, en historische versies met 27+ KB mappings
- **Update Status dropdown**: Vervang tekstfilter met dropdown voor exacte filtering
- **Snelfilter knoppen**: Kleurgecodeerde knoppen voor directe access tot veelgebruikte filters
- **Synchronized filtering**: Dropdown en snelfilters werken samen voor optimale UX
- **Filter persistence**: Behoud filter instellingen tijdens sessie
### π **Enhanced Data Presentation**
- **Separated columns**: "Missing Updates" voor KB nummers, "Details" voor statusberichten
- **Improved Count logic**: Binary indicator (0/1) voor duidelijke status indicatie
- **OS version analysis**: Percentage breakdown van Windows builds in omgeving
- **Status categorization**: Duidelijke update status categorieΓ«n voor betere insights
## Backup functionaliteit
Het script ondersteunt automatische back-ups van exports, archief en configuratiebestanden:
- **Export back-up**: Maakt een zip-bestand van de exports directory
- **Archief back-up**: Maakt een zip-bestand van de archive directory
- **Config back-up**: Maakt een zip-bestand van config.json en credentials.json
- **Retentie**: Het aantal te bewaren back-ups is instelbaar per type
- **Configuratie**: Alle paden en instellingen zijn te beheren via `config.json`
### Configuratie opties
In het `config.json` bestand kun je per back-up type instellen of deze actief is en hoeveel back-ups bewaard blijven:
```json
"backup": {
"enableExportBackup": true,
"enableArchiveBackup": true,
"enableConfigBackup": true,
"exportBackupRetention": 5,
"archiveBackupRetention": 5,
"configBackupRetention": 5,
"backupRoot": "backup",
"exportBackupSubfolder": "export_backup",
"archiveBackupSubfolder": "archive_backup",
"configBackupSubfolder": "config_backup"
}
```
## App Registration Status Dashboard
Het HTML-dashboard bevat een speciaal "App Registrations" tabblad dat een overzicht toont van alle client secret vervaldatums:
### App Registration Dashboard Functionaliteit
- **Centraal overzicht**: Alle tenants en hun App Registration status in één tabel
- **Status indicatoren**: Kleurgecodeerde waarschuwingen voor vervaldatums:
- π’ **Groen**: Meer dan 30 dagen geldig
- π **Oranje**: 7-30 dagen tot verval (waarschuwing)
- π΄ **Rood**: Minder dan 7 dagen tot verval (kritiek) of geen toegang
- **Gedetailleerde informatie**:
- Customer naam
- Status bericht
- Dagen tot verval
- Exacte vervaldatum (DD-MM-YYYY)
- **Filterbare tabel**: Zoeken en sorteren op alle kolommen via DataTables
- **Export functionaliteit**: Mogelijkheid tot CSV export van de status gegevens
## Troubleshooting
### β **"Device Management API niet beschikbaar"**
**Oorzaak**: Ontbrekende `DeviceManagementManagedDevices.Read.All` permissie of geen Intune licenties
**Oplossing**: Script valt automatisch terug op Threat Hunting API - geen actie vereist
### β **"Geen geldige client secret gevonden"**
**Oorzaak**: Ontbrekende `Application.Read.All` permissie
**Oplossing**: Voeg permissie toe in Azure Portal en verleen admin consent
### β **Missing Updates kolom is leeg**
**Oorzaak**: Machines zijn werkelijk up-to-date of gebruiken fallback API
**Verwachting**: Dit is normaal - machines met verouderde OS krijgen automatisch KB suggesties
### β
**Permissie Verificatie**
Controleer in Azure Portal of je App Registration deze permissies heeft:
- β
`DeviceManagementManagedDevices.Read.All` (voor KB nummers)
- β
`ThreatHunting.Read.All` (voor fallback)
- β
`Application.Read.All` (voor App Registration monitoring)
## Opmerkingen
- Het script werkt optimaal met Device Management permissies, maar functioneert ook met alleen Threat Hunting permissies
- KB nummers worden alleen getoond bij Device Management API toegang of bij gedetecteerde verouderde OS versies
- Voor meer informatie over App Registrations, zie de [Microsoft Docs](https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app)
- Het script ondersteunt zowel Windows 10 als Windows 11 omgevingen
---
Β© 2025 by Maarten Schmeitz
[commits-shield]: https://img.shields.io/github/commit-activity/m/scns/Windows-Update-Report-MultiTenant.svg
[commits]: https://github.com/scns/Windows-Update-Report-MultiTenant/commits/main
[github-last-commit]: https://img.shields.io/github/last-commit/scns/Windows-Update-Report-MultiTenant.svg?style=plasticr
[github-master]: https://github.com/scns/Windows-Update-Report-MultiTenant/commits/main
[license-shield]: https://img.shields.io/github/license/scns/Windows-Update-Report-MultiTenant.svg
[contributors-url]: https://github.com/scns/Windows-Update-Report-MultiTenant/graphs/contributors
[contributors-shield]: https://img.shields.io/github/contributors/scns/Windows-Update-Report-MultiTenant.svg
[forks-shield]: https://img.shields.io/github/forks/scns/Windows-Update-Report-MultiTenant.svg
[forks-url]: https://github.com/scns/Windows-Update-Report-MultiTenant/network/members
[stars-shield]: https://img.shields.io/github/stars/scns/Windows-Update-Report-MultiTenant.svg
[stars-url]: https://github.com/scns/Windows-Update-Report-MultiTenant/stargazers
[issues-shield]: https://img.shields.io/github/issues/scns/Windows-Update-Report-MultiTenant.svg
[issues-url]: https://github.com/scns/Windows-Update-Report-MultiTenant/issues