Repository navigation
Description
Pre-submission checklist
- I can reproduce this issue using the latest released version of Maester.
- I have searched the existing issues and did not find a similar report.
Describe the bug
In a tenant while preparing for something like setting up a connector to Windows Security Center there is this note
Note: The connector status will not show as "Enabled" until the first MAM user enrollment is completed for your tenant. Once a MAM enrollment completes, you will see the status update to "Enabled" within 30 minutes.
Tenant Administration -> Connectors and tokens -> Mobile Threat Defense
And if you have not enrolled anything yet it will show up like the following causing the test to fail.
Now everything is setup correctly but what it fails on is the heartbet and it not being enabled while true there is no way to remediate it without actually enrolling a MAM user but in theory there is nothing to correct here so the test needs to consider instances of inbetween stages.
Mobile Threat Defense Connector Status:
| Name | LastHeartbeatDateTime | PartnerState |
|---|---|---|
| Windows Security Center | 01/01/0001 00:00:00 | notSetUp |
| Microsoft Defender for Endpoint | 10/27/2026 23:05:44 | enabled |
Changing the current code from
$isConnected = $connector.partnerState -eq 'enabled'
$syncIsRecent = [System.Math]::Floor(((Get-Date) - [datetime]$connector.lastHeartbeatDateTime).TotalDays) -le 1to:
$isConnected = $connector.partnerState -eq 'enabled' -or $connector.partnerState -eq 'notSetUp'
$syncIsRecent = [System.Math]::Floor(((Get-Date) - [datetime]$connector.lastHeartbeatDateTime).TotalDays) -le 1 -or [datetime]$connector.lastHeartbeatDateTime -eq $(get-date '01-01-0001 00:00:00')
Write-Output ($isConnected -and $syncIsRecent)Would resolve the error but i am not really an intune guy so i might be missing something hence this issue
Steps to reproduce
go to: Tenant Administration -> Connectors and tokens -> Mobile Threat Defense
Create
Select 'Windows Security Center'
Create
Once that is done the policy here will show up on an invoke request
Invoke-MtGraphRequest -RelativeUri 'deviceManagement/mobileThreatDefenseConnectors' -ApiVersion betaresult alongside one for Microsoft Defender for Endpoint:
id : c2b688fe-48c0-464b-a89c-67041aa8fcb2
lastHeartbeatDateTime : 01-01-0001 00:00:00
partnerState : notSetUp
androidMobileApplicationManagementEnabled : False
iosMobileApplicationManagementEnabled : False
windowsMobileApplicationManagementEnabled : True
androidEnabled : False
iosEnabled : False
windowsEnabled : False
macEnabled : False
androidDeviceBlockedOnMissingPartnerData : False
iosDeviceBlockedOnMissingPartnerData : False
windowsDeviceBlockedOnMissingPartnerData : False
macDeviceBlockedOnMissingPartnerData : False
partnerUnsupportedOsVersionBlocked : False
partnerUnresponsivenessThresholdInDays : 7
allowPartnerToCollectIOSApplicationMetadata : False
allowPartnerToCollectIOSPersonalApplicationMetadata : False
microsoftDefenderForEndpointAttachEnabled : False
allowPartnerToCollectIosCertificateMetadata : False
allowPartnerToCollectIosPersonalCertificateMetadata : False
grantMobileThreatDefensePartnerRole : False
launchMobileThreatDefensePartnerOnSetupEnabled : False
partnerDisplayName :
partnerSupportsIosCertificateSync : False
partnerSupportsIosMam : False
partnerSupportsAndroidMam : False
partnerSupportsWindowsMam : False
partnerMinimumSupportedIosVersion :
partnerMinimumSupportedAndroidVersion :
partnerMinimumSupportedMacVersion :
partnerMinimumSupportedWindowsVersion :
id : fc780465-2017-40d4-a0c5-307022471b92
lastHeartbeatDateTime : 27-10-2026 23:05:44
partnerState : enabled
androidMobileApplicationManagementEnabled : True
iosMobileApplicationManagementEnabled : True
windowsMobileApplicationManagementEnabled : False
androidEnabled : True
iosEnabled : True
windowsEnabled : True
macEnabled : False
androidDeviceBlockedOnMissingPartnerData : True
iosDeviceBlockedOnMissingPartnerData : True
windowsDeviceBlockedOnMissingPartnerData : True
macDeviceBlockedOnMissingPartnerData : False
partnerUnsupportedOsVersionBlocked : True
partnerUnresponsivenessThresholdInDays : 7
allowPartnerToCollectIOSApplicationMetadata : True
allowPartnerToCollectIOSPersonalApplicationMetadata : False
microsoftDefenderForEndpointAttachEnabled : True
allowPartnerToCollectIosCertificateMetadata : False
allowPartnerToCollectIosPersonalCertificateMetadata : False
grantMobileThreatDefensePartnerRole : False
launchMobileThreatDefensePartnerOnSetupEnabled : False
partnerDisplayName :
partnerSupportsIosCertificateSync : False
partnerSupportsIosMam : False
partnerSupportsAndroidMam : False
partnerSupportsWindowsMam : False
partnerMinimumSupportedIosVersion :
partnerMinimumSupportedAndroidVersion :
partnerMinimumSupportedMacVersion :
partnerMinimumSupportedWindowsVersion : The first one will fail even though it is correctly configured.
Expected behavior
Polices that is setup and just waiting for an enrollment before being active should not be resulting in a failed test
Debug output
Module version
Get-Module -ListAvailable
Directory: C:\Users\M157133\OneDrive - Nuuday\Dokumenter\PowerShell\Modules
ModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 3.0.0 rc18 Maester Core {Add-MtMaesterAppFederatedCredential, Add-MtReportAttachment, Add-MtTestResultDetail, Clear-MtADCache…}
Environment data
$PSVersionTable
Name Value
---- -----
PSVersion 7.6.7
PSEdition Core
GitCommitId 7.6.7
OS Microsoft Windows 10.0.26200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Screenshots
No response
Additional context
No response
Activity
earbona23 commentedon Nov 7, 2026
Reproduced the shape you describe, and I think the failure is correct but the explanation is not — so the change I would suggest is a different one from the snippet.
notSetUpis not a benign in-between state. Microsoft's connector-status table is explicit about what each state does to the signal (Mobile Threat Defense integration with Intune):unavailablenotSetUpavailableenabledunresponsiveerrorSo a
notSetUpconnector is actively blocking device threat messages. If MT.1098 passed it, the report would call a connector healthy while it suppresses the very signal it exists to carry — and the state is remediable, just not by waiting: finish the setup, or delete the connector you are not going to finish. On a tenant that only ever had Defender for Endpoint, an abandoned Windows Security Center connector left atnotSetUpis exactly the finding an auditor wants.That is also why I would not add the zero-date clause:
01/01/0001means no heartbeat was ever received, which is weaker evidence of health than a stale one, not stronger.What I think is actually wrong with the test. It is the reporting, not the verdict. Today the row shows
notSetUpand01/01/0001 00:00:00and leaves you to work out which of the two is the problem and what to do about it — which is how this came up. The full enum isunavailable,available,enabled,unresponsive,notSetUp,error,unknownFutureValue(mobileThreatPartnerTenantState), and the current code collapses all six non-enabledstates into one unexplained failure, plus a heartbeat check whose result is meaningless when no heartbeat ever arrived.Concretely, and keeping the verdict as it is:
notSetUpreads "setup not complete - device threat messages are blocked; finish setup or remove the connector" rather than nothing;lastHeartbeatDateTimeis0001-01-01(or absent), say "never" instead of computing an age against year 1 - the current expression gives a ~739,000-day gap and reads as a sync problem;unresponsiveas its own line, since Microsoft says Intune ignores the compliance state for it: still a failure, but a different one from a connector that is merely not set up;unknownFutureValue, or any state not in the enum, should not be silently lumped in withenabled.Happy to send that as a PR if you and @nicolonsky agree with the direction — it changes no pass/fail outcome, only what the row tells you, so it should be easy to review. If either of you reads
notSetUpas something that genuinely should pass, say so before I write it, because that is the one part where I am taking a position rather than reporting a measurement.The documented semantics above are from the vendor docs; I have not yet run this against a tenant with a connector in each state.
julien-ly commentedon Nov 10, 2026
Measured in a lab tenant on the Windows Security Center connector (
c2b688fe-48c0-464b-a89c-67041aa8fcb2), read with Microsoft Graph beta (deviceManagement/mobileThreatDefenseConnectors):partnerStatenotSetUp,lastHeartbeatDateTime0001-01-01T00:00:00Z.windowsMobileApplicationManagementEnabledtrue,partnerStatestillnotSetUp, same heartbeat.The response is identical with and without
Prefer: include-unknown-enum-members. In mobileThreatPartnerTenantState,notSetUpanderrorcome beforeunknownFutureValue, so MT.1098 gets the real state without that header.That matches the admin center note quoted in the issue (no Enabled status before the first MAM user enrollment), not the Intune setup page for this connector, which says Available after creation and Enabled after the toggle.
Since #2736, MT.1098 on main reports this connector with Never received and the
notSetUpreason: "Complete setup in Intune and with the partner, or remove an unused connector." For a Windows Security Center connector with its toggle on, the next step isn't in the connector: according to that note, the state waits for the first MAM user enrollment. The reason could say so for this connector.Mynster9361 commentedon Nov 11, 2026
@earbona23 and @julien-ly
Thank you for participating in the issue :)
As stated i am not really an Intune kinda guy which is why i created the issue instead of sending a PR with my suggested "fix" I think @earbona23 would resolve the confusion for future uses of the tests and also reduces troubleshooting time for anyone else in the future and thank you for the insights @julien-ly and testing to validate what i saw and also linking the well outdated documentation on the Intune setup page :D
earbona23 commentedon Nov 11, 2026
Sent as #2794.
@Mynster9361 thanks — and your instinct was right that the test needed to consider the in-between stage. It just turned out to be the text, not the verdict.
What it does: for the Windows Security Center connector, and only when its own Connect Windows devices for MAM toggle is on, the Reason asks for the first MAM user enrollment instead of sending the operator back to the partner, and the heartbeat line says none arrives before that enrollment. Everything else is untouched.
What it deliberately does not do: flip
notSetUpto a pass. Microsoft documents that state as blocking device threat messages since 2309, whatever put the connector there, so the row is still reporting something real — and it is remediable, just not by waiting: enroll a MAM user, or remove a connector you are not going to use. If you or @nicolonsky read this case as a pass, say so on the PR and I will change it; that is the one judgement call in there.@julien-ly your measurement is what made it safe to write — the two-day observation with the toggle on is exactly the evidence the change needed, and the response being identical with and without
Prefer: include-unknown-enum-membersclosed the last doubt about the enum. I added you both toContributor.One thing your comment sent me to check, and it is worth writing down: the two Learn pages genuinely contradict each other. The setup page exists in one revision saying the status is Available after creation and Enabled with the toggle, and another saying it stays Unavailable until the first policy or enrollment. The tenant says
notSetUp. So all three disagree, and the PR follows the tenant.