Skip to content

Dynamically collect all MdmDiagnosticsTool areas from registry (fixes #16)#18

Merged
markstan merged 4 commits intomarkstan:masterfrom
YeehomZhu:fix/mdmdiag-all-areas-issue16
Mar 24, 2026
Merged

Dynamically collect all MdmDiagnosticsTool areas from registry (fixes #16)#18
markstan merged 4 commits intomarkstan:masterfrom
YeehomZhu:fix/mdmdiag-all-areas-issue16

Conversation

@YeehomZhu
Copy link
Contributor

Summary

Fixes #16 - Expand parameters for MDMDIAGNOSTICSTOOL.EXE

Changes

Replaced the static MdmDiagnosticsTool.exe -out $pwd command with dynamic registry-based area collection that:

  1. Reads all available diagnostic areas from HKLM:\SOFTWARE\Microsoft\MdmDiagnostics\Area
  2. Joins them into a semicolon-delimited string (e.g., Autopilot;DeviceEnrollment;DeviceProvisioning;OsConfiguration;TPM)
  3. Runs MdmDiagnosticsTool.exe -area "<all areas>" -zip to produce a comprehensive MDMDiagReport-AllAreas.zip
  4. Falls back to the original behavior if the registry key doesn't exist or has no areas

Why

Previously, ODC only ran the default MdmDiagnosticsTool.exe -out which missed areas like TPM and DeviceProvisioningService. Support engineers had to manually run additional cab collections. This change automatically discovers and includes all registered areas.

Testing

  • Verified registry key HKLM:\SOFTWARE\Microsoft\MdmDiagnostics\Area returns 5 areas: Autopilot, DeviceEnrollment, DeviceProvisioning, OsConfiguration, TPM
  • Unit tested: produced 18.5MB MDMDiagReport-AllAreas.zip with all areas
  • Full end-to-end ODC test: zero errors, both Autopilot-specific and AllAreas ZIPs created successfully
  • Output location: Commands\General\MDMDiagReport-AllAreas.zip

@markstan markstan merged commit b033b97 into markstan:master Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand parameters for MDMDIAGNOSTICSTOOL.EXE

2 participants