From 690ecda863b01e9dd3b0cf9f721bad27c78407f5 Mon Sep 17 00:00:00 2001 From: Eduard Arbona Date: Wed, 11 Nov 2026 10:56:39 -0400 Subject: [PATCH 1/2] fix(intune): ask for a MAM enrolment on the Windows Security Center connector MT.1098 tells the operator to complete setup in Intune and with the partner whenever a connector reports `notSetUp`. For the Windows Security Center connector with **Connect Windows devices for MAM** already on, that setup is done: Intune keeps the state at `notSetUp`, and sends no heartbeat, until the first Windows MAM user enrols (#2595, measured on a lab tenant). The verdict does not move. Microsoft documents `notSetUp` as blocking device threat messages whatever the cause, so the connector is still not carrying the signal it exists to carry. What changes is the Reason column and the heartbeat line, so the row names what is actually missing. Both guards are anchored: the connector's own ID and its own toggle. Either one alone keeps the generic explanation, which the two new negative cases assert. --- ...-MtMobileThreatDefenseConnectors.Tests.ps1 | 46 +++++++++++++++++++ tests/maester/intune/Test.MT.1098.md | 2 +- tests/maester/intune/Test.MT.1098.ps1 | 26 +++++++++-- 3 files changed, 70 insertions(+), 4 deletions(-) diff --git a/powershell/tests/functions/Test-MtMobileThreatDefenseConnectors.Tests.ps1 b/powershell/tests/functions/Test-MtMobileThreatDefenseConnectors.Tests.ps1 index 3a2a14fc1a..299f191799 100644 --- a/powershell/tests/functions/Test-MtMobileThreatDefenseConnectors.Tests.ps1 +++ b/powershell/tests/functions/Test-MtMobileThreatDefenseConnectors.Tests.ps1 @@ -63,6 +63,35 @@ Describe 'Test-MtMobileThreatDefenseConnectors' { $script:Result | Should -BeLike '*No heartbeat has been received*' } + It 'Asks for a MAM enrolment instead of more setup when Windows MAM is already on' { + # Measured in #2595: with the toggle on, the connector still reports notSetUp and no + # heartbeat until the first Windows MAM user enrols. The verdict must not move. + $script:Connector.partnerState = 'notSetUp' + $script:Connector.lastHeartbeatDateTime = '0001-01-01T00:00:00Z' + $script:Connector | Add-Member -NotePropertyName windowsMobileApplicationManagementEnabled -NotePropertyValue $true + + Test-MtMobileThreatDefenseConnectors | Should -BeFalse + $script:Result | Should -BeLike '*first Windows MAM user enrols*' + $script:Result | Should -BeLike '*device threat messages are blocked*' + $script:Result | Should -Not -BeLike '*verify that the partner can communicate with Intune*' + $script:Result | Should -Not -BeLike '*Complete setup in Intune and with the partner*' + } + + It 'Keeps the generic setup reason when ' -ForEach @( + @{ Case = 'Windows MAM is off'; Id = 'c2b688fe-48c0-464b-a89c-67041aa8fcb2'; MamEnabled = $false } + @{ Case = 'another connector has MAM on'; Id = 'fc780465-2017-40d4-a0c5-307022471b92'; MamEnabled = $true } + ) { + # Both guards matter: the reason is anchored on this connector's ID and on its own toggle, + # so neither one alone can swallow the generic explanation. + $script:Connector.id = $Id + $script:Connector.partnerState = 'notSetUp' + $script:Connector | Add-Member -NotePropertyName windowsMobileApplicationManagementEnabled -NotePropertyValue $MamEnabled + + Test-MtMobileThreatDefenseConnectors | Should -BeFalse + $script:Result | Should -BeLike '*Complete setup in Intune and with the partner*' + $script:Result | Should -Not -BeLike '*first Windows MAM user enrols*' + } + It 'Explains a stale heartbeat' { $script:Connector.lastHeartbeatDateTime = '2026-11-05T12:00:00Z' @@ -155,6 +184,23 @@ Describe 'MT.1098 native engine results' { $rows[0].ResultDetail.TestResult | Should -BeLike '*Never received*' } + It 'Records the Windows MAM wait as Failed with the enrolment reason through the engine' { + Mock -ModuleName Maester Invoke-MtGraphRequest { + [pscustomobject]@{ + id = 'c2b688fe-48c0-464b-a89c-67041aa8fcb2' + partnerState = 'notSetUp' + lastHeartbeatDateTime = '0001-01-01T00:00:00Z' + windowsMobileApplicationManagementEnabled = $true + } + } + + $rows = @(Invoke-MtTest -Id 'MT.1098' -Config $script:config) + $rows | Should -HaveCount 1 + $rows[0].Result | Should -Be 'Failed' + $rows[0].ResultDetail.TestResult | Should -BeLike '*first Windows MAM user enrols*' + $rows[0].ResultDetail.TestResult | Should -BeLike '*Never received*' + } + It 'Records the no-connectors case as Skipped through the engine' { Mock -ModuleName Maester Invoke-MtGraphRequest { @() } diff --git a/tests/maester/intune/Test.MT.1098.md b/tests/maester/intune/Test.MT.1098.md index ae623ce5ff..c85268b0e6 100644 --- a/tests/maester/intune/Test.MT.1098.md +++ b/tests/maester/intune/Test.MT.1098.md @@ -2,7 +2,7 @@ This test verifies the health of Intune Mobile Threat Defense Connectors, includ Each connector must be enabled and have a heartbeat in the last 48 hours. The result table explains unhealthy states and reports a missing or year-1 heartbeat as **Never received**. -A connector in `notSetUp` has not completed setup and blocks device threat messages. A connector in `available` has completed setup but needs a platform toggle enabled. Neither state satisfies this health check. An `unresponsive` connector needs attention because Intune ignores its compliance state once the configured unresponsiveness threshold is reached. +A connector in `notSetUp` has not completed setup and blocks device threat messages. The **Windows Security Center** connector is a documented special case: with **Connect Windows devices for MAM** already on, it stays in `notSetUp` with no heartbeat until the first Windows MAM user enrols, so its Reason asks for that enrolment rather than for more setup. A connector in `available` has completed setup but needs a platform toggle enabled. Neither state satisfies this health check. An `unresponsive` connector needs attention because Intune ignores its compliance state once the configured unresponsiveness threshold is reached. #### Remediation action diff --git a/tests/maester/intune/Test.MT.1098.ps1 b/tests/maester/intune/Test.MT.1098.ps1 index a49ba3d649..c70d9d7be2 100644 --- a/tests/maester/intune/Test.MT.1098.ps1 +++ b/tests/maester/intune/Test.MT.1098.ps1 @@ -28,7 +28,7 @@ Service = 'Graph', License = 'INTUNE_A', Author = 'nicolonsky', - Contributor = ('Mynster9361', 'FiraSenax') + Contributor = ('Mynster9361', 'FiraSenax', 'julien-ly', 'earbona23') )] [CmdletBinding()] [OutputType([bool])] @@ -78,10 +78,26 @@ $connectorName = $connector.id } + # The Windows Security Center connector reports 'notSetUp' with no heartbeat until the + # first Windows MAM user enrols, even with its own toggle already on (measured on a lab + # tenant in #2595; the Intune admin center says the status changes within 30 minutes of + # that enrolment). The verdict stays a failure, because Microsoft documents 'notSetUp' as + # blocking device threat messages whatever the cause. What changes is the Reason: without + # this, the row sends the operator back to the partner to finish a setup that is done. + $awaitingWindowsMamEnrolment = $connector.id -eq 'c2b688fe-48c0-464b-a89c-67041aa8fcb2' -and + $connector.windowsMobileApplicationManagementEnabled -and + $connector.partnerState -eq 'notSetUp' + $isConnected = $connector.partnerState -eq 'enabled' $reasons = @(switch ($connector.partnerState) { 'enabled' { break } - 'notSetUp' { 'Setup is incomplete; device threat messages are blocked. Complete setup in Intune and with the partner, or remove an unused connector.' } + 'notSetUp' { + if ($awaitingWindowsMamEnrolment) { + 'Windows MAM is on and this connector stays in notSetUp until the first Windows MAM user enrols; device threat messages are blocked until then. Enrol a MAM user, or remove the connector if Windows MAM is not in use.' + } else { + 'Setup is incomplete; device threat messages are blocked. Complete setup in Intune and with the partner, or remove an unused connector.' + } + } 'unavailable' { 'The connector is deprovisioned; device threat messages are blocked. Ask the MTD partner to provision it again.' } 'available' { 'Setup is complete. Turn on a platform toggle to enable the connector.' } 'unresponsive' { 'The connector is unresponsive. After its configured unresponsiveness threshold, Intune ignores its compliance state. Check the partner service and connectivity.' } @@ -93,7 +109,11 @@ if ($heartbeat.Year -eq 1) { $heartbeatDisplay = 'Never received' $syncIsRecent = $false - $reasons += 'No heartbeat has been received. Complete setup and verify that the partner can communicate with Intune.' + $reasons += if ($awaitingWindowsMamEnrolment) { + 'No heartbeat arrives before that first enrolment.' + } else { + 'No heartbeat has been received. Complete setup and verify that the partner can communicate with Intune.' + } } else { $heartbeatDisplay = [string]$connector.lastHeartbeatDateTime # At most one completed day since the heartbeat, so less than 48 hours. From 30177c3bbaec093d814dcf46edc161f9ea5dafd6 Mon Sep 17 00:00:00 2001 From: Eduard Arbona <175124143+earbona23@users.noreply.github.com> Date: Sun, 15 Nov 2026 08:01:17 -0400 Subject: [PATCH 2/2] fix(intune): say what MT.1098 actually reads, and drop the "documented" claim Two corrections to the Windows Security Center case, both about claiming more than the source supports. The guide called it "a documented special case". The live Learn page for the connector says the opposite - Available after creation, Enabled once the toggle goes on - and the only source for the enrolment trigger is the note in the Intune admin center. It now says "a special case noted in the Intune admin center". The Reason opened with "Windows MAM is on". What the check reads is the connector's own windowsMobileApplicationManagementEnabled, the Connect Windows devices for MAM toggle, which says nothing about whether a Windows app protection policy is deployed. The Reason now names that toggle. No behaviour change: the guard, the verdict and the heartbeat line are untouched, and the unit tests match on "first Windows MAM user enrols", which both wordings keep. --- tests/maester/intune/Test.MT.1098.md | 2 +- tests/maester/intune/Test.MT.1098.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/maester/intune/Test.MT.1098.md b/tests/maester/intune/Test.MT.1098.md index c85268b0e6..601898c77d 100644 --- a/tests/maester/intune/Test.MT.1098.md +++ b/tests/maester/intune/Test.MT.1098.md @@ -2,7 +2,7 @@ This test verifies the health of Intune Mobile Threat Defense Connectors, includ Each connector must be enabled and have a heartbeat in the last 48 hours. The result table explains unhealthy states and reports a missing or year-1 heartbeat as **Never received**. -A connector in `notSetUp` has not completed setup and blocks device threat messages. The **Windows Security Center** connector is a documented special case: with **Connect Windows devices for MAM** already on, it stays in `notSetUp` with no heartbeat until the first Windows MAM user enrols, so its Reason asks for that enrolment rather than for more setup. A connector in `available` has completed setup but needs a platform toggle enabled. Neither state satisfies this health check. An `unresponsive` connector needs attention because Intune ignores its compliance state once the configured unresponsiveness threshold is reached. +A connector in `notSetUp` has not completed setup and blocks device threat messages. The **Windows Security Center** connector is a special case noted in the Intune admin center: with **Connect Windows devices for MAM** already on, it stays in `notSetUp` with no heartbeat until the first Windows MAM user enrols, so its Reason asks for that enrolment rather than for more setup. A connector in `available` has completed setup but needs a platform toggle enabled. Neither state satisfies this health check. An `unresponsive` connector needs attention because Intune ignores its compliance state once the configured unresponsiveness threshold is reached. #### Remediation action diff --git a/tests/maester/intune/Test.MT.1098.ps1 b/tests/maester/intune/Test.MT.1098.ps1 index c70d9d7be2..47e22423c8 100644 --- a/tests/maester/intune/Test.MT.1098.ps1 +++ b/tests/maester/intune/Test.MT.1098.ps1 @@ -93,7 +93,7 @@ 'enabled' { break } 'notSetUp' { if ($awaitingWindowsMamEnrolment) { - 'Windows MAM is on and this connector stays in notSetUp until the first Windows MAM user enrols; device threat messages are blocked until then. Enrol a MAM user, or remove the connector if Windows MAM is not in use.' + 'Connect Windows devices for MAM is on for this connector, so it stays in notSetUp until the first Windows MAM user enrols; device threat messages are blocked until then. Enrol a MAM user, or remove the connector if Windows MAM is not in use.' } else { 'Setup is incomplete; device threat messages are blocked. Complete setup in Intune and with the partner, or remove an unused connector.' }