M365 to Exchange Mail Flow Monitor

Microsoft.SystemCenter.M365.Monitor.M365ToExchangeMailFlow (UnitMonitor)

This monitor logs into M365 using the M365 Sender Profile and sends a test message to the Exchange Receiver Profile. It then logs into the account specified in the Exchange Receiver Profile and verifies receipt of the email from the M365 Sender Profile.

Knowledge Base article:

Summary

This monitor utilizes synthetic transactions to verify the flow of email from an Microsoft 365 email account to an Exchange email account. This monitor has two health states, healthy and critical. The health state is determined if the synthetic transaction is or is not able to successfully complete for any reason. The synthetic transaction works by logging into a sender account using the "M365 Email Sender email address" and sending a test email to the receiver account specified in the "Microsoft 365 Exchange Receiver Profile". The monitor then logs into the receiver account using the "Microsoft 365 Exchange Receiver Profile" to verify the test email was received.

This monitor contains the following overridable parameters.

-Interval (seconds)- Default Value: 900 seconds - This sets how long the monitor waits until running the synthetic transaction again. The default value can be left or can be adjusted to fit the environment.

-Enabled- Default Value: False -This need to be overridden to true for all watcher nodes. This allows the monitor to run the synthetic transaction workflows.

-GraphEndpoint- Default Value: None - This needs to be overridden and populated with the URL for the GraphAPI Endpoint URL utilized in your environment.

-Exchange URL- Default Value: None - This needs to be overridden and populated with the URL for the Exchange EWS URL utilized in your environment.

-SleepInterval- Default Value: 5 seconds - This value determines how long the monitor waits between search attempts during each run of the synthetic transaction. The synthetic transaction will attempt to search for the received email 10 times. The default value can be left or can be adjusted to fit the environment.

Causes

An error state is caused by having issues with connecting to Microsoft Exchange or Microsoft 365 or fetching data. It can be caused by the following:

Resolutions

Resolution depends on the specific error. Verify and/or fix the following:

Element properties:

TargetMicrosoft.SystemCenter.M365.WatcherNodeApplication.HybridMailFlow
Parent MonitorMicrosoft.SystemCenter.M365.Monitor.Availability.WatcherNode.HybridMailFlow
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SystemCenter.M365.Monitor.M365ToExchangeMailFlow.UnitMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
M365 to Exchange Mail Flow Monitor: Failure
This monitor has detected a mail flow issue while attempting to send email from an M365 email account to an Exchange email account.
{0}
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SystemCenter.M365.Monitor.M365ToExchangeMailFlow" Accessibility="Public" Enabled="true" Target="Microsoft.SystemCenter.M365.WatcherNodeApplication.HybridMailFlow" ParentMonitorID="Microsoft.SystemCenter.M365.Monitor.Availability.WatcherNode.HybridMailFlow" Remotable="true" Priority="Normal" TypeID="Microsoft.SystemCenter.M365.Monitor.M365ToExchangeMailFlow.UnitMonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.M365.Monitor.M365ToExchangeMailFlow.Alert.Message">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='Alert Message']$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Healthy" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Critical" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>900</IntervalSeconds>
<AzureADEndpoint>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/AzureADEndpoint$</AzureADEndpoint>
<GraphEndpoint>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/GraphEndpoint$</GraphEndpoint>
<TenantId>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/TenantId$</TenantId>
<ApplicationClientId>$RunAs[Name="Microsoft.SystemCenter.M365.RunAsProfile.ApplicationClient"]/UserName$</ApplicationClientId>
<ApplicationClientCredentials>$RunAs[Name="Microsoft.SystemCenter.M365.RunAsProfile.ApplicationClient"]/Password$</ApplicationClientCredentials>
<DelegatedUserId>$RunAs[Name="Microsoft.SystemCenter.M365.RunAsProfile.DelegatedMailSender"]/UserName$</DelegatedUserId>
<DelegatedUserCredentials>$RunAs[Name="Microsoft.SystemCenter.M365.RunAsProfile.DelegatedMailSender"]/Password$</DelegatedUserCredentials>
<SenderUser>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/M365EmailSender$</SenderUser>
<ReceiverUser>$RunAs[Name="Microsoft.SystemCenter.M365.RunAsProfile.Exchange.Receiver"]/UserName$</ReceiverUser>
<ReceiverPassword>$RunAs[Name="Microsoft.SystemCenter.M365.RunAsProfile.Exchange.Receiver"]/Password$</ReceiverPassword>
<ExchangeURL>$Target/Host/Property[Type="Microsoft.SystemCenter.M365.WatcherNodeApplication"]/ExchangeURL$</ExchangeURL>
<SleepInterval>5</SleepInterval>
<MatchCount>1</MatchCount>
</Configuration>
</UnitMonitor>