Repository navigation
fix(intune): explain unhealthy MTD connector states - #2736
Conversation
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the Intune connector-health diagnostic improvements.
No open issues 🎉
What changed in this PR
This PR improves diagnostics for Maester’s MT.1098 Intune connector health check without relaxing its enabled-state requirement or existing heartbeat window. It addresses the diagnostic aspect of #2595; notSetUp remains unhealthy.
Changes:
- Adds per-connector reasons and remediation guidance, with escaped connector values in the Markdown table.
- Displays missing or year-1 heartbeats as Never received, returning an unhealthy result rather than a null-date conversion error.
- Adds regression coverage for connector states, heartbeat boundaries, Markdown escaping, and native-engine outcomes.
| File | Description |
|---|---|
tests/maester/intune/Test.MT.1098.ps1 |
Adds state explanations, missing-heartbeat handling, and safe table formatting. |
tests/maester/intune/Test.MT.1098.md |
Clarifies health criteria, connector states, and remediation steps. |
powershell/tests/functions/Test-MtMobileThreatDefenseConnectors.Tests.ps1 |
Adds diagnostic, boundary, escaping, and engine-result tests. |
Review effort: Balanced
| Mock -ModuleName Maester Get-Date { [datetime]'2026-11-08T12:00:00Z' } | ||
| Mock -ModuleName Maester Invoke-MtGraphRequest { $script:Connector } | ||
| Mock -ModuleName Maester Add-MtTestResultDetail { | ||
| param($Result, $SkippedBecause, $SkippedCustomReason) |
| Mock -ModuleName Maester Get-Date { [datetime]'2026-11-08T12:00:00Z' } | ||
| Mock -ModuleName Maester Invoke-MtGraphRequest { $script:Connector } | ||
| Mock -ModuleName Maester Add-MtTestResultDetail { | ||
| param($Result, $SkippedBecause, $SkippedCustomReason) |
|
The ID table, which this PR keeps as is, has two entries worth checking:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M6ZQ3XFATYYQTYJ0NQN6VJVT
|
Thanks @julien-ly, both checked.
|
|
@merill Follow-up on your Windows Security Center question: Microsoft365DSC has replaced DSC also added iVerify, taken from MT.1098. I created an iVerify connector in the same tenant from the Intune admin center, without enabling anything, and Graph returned |
MT.1098 currently reports only a raw connector state and heartbeat, leaving a year-1 timestamp looking like an unexplained synchronization failure. Add per-connector reasons and remediation guidance, display year-1 or missing heartbeats as Never received, and escape connector values in the Markdown table.
Keep the enabled-state requirement and existing heartbeat window (less than 48 hours). A null heartbeat now produces a failing health result instead of a date-conversion error.
Related #2595. This addresses diagnosis of the existing health verdict; it does not mark notSetUp as healthy.
Validation:
Live tenant validation on 2026-11-09 (PowerShell 7.5.2, Microsoft Graph Authentication 2.41.2):
beta/deviceManagement/mobileThreatDefenseConnectorsendpoint initially returned zero connectors. The real check throughInvoke-MtTest -Id MT.1098returnedSkipped / TestSkippedwithNo Mobile Threat Defense Connectors found.partnerState = notSetUpand a year-1 heartbeat.Failed; the report showedNever received, the incomplete-setup explanation, andNo heartbeat has been receivedwith remediation guidance.Live coverage is the empty inventory and
notSetUp/year-1 heartbeat case. Other connector states, null/stale heartbeats, and the 47/48-hour boundary remain covered by the 21 offline tests above. The existing vendor-ID mapping is unchanged; this passive fixture does not independently verify vendor identity mappings.After removing two unused mock parameters reported by code scanning, reran the 21 connector tests through
powershell/tests/pester.ps1(all passed) andPSReviewUnusedParameter(zero findings). The production check is unchanged from the live-tested implementation.Connector-state meanings follow Microsoft's documentation.
GitHub-hosted CI for the updated head currently reports
action_required; no jobs have executed yet. Workflow status.Summary by CodeRabbit