<Wizard xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<!-- ********************************************************************* -->
	<!--  Copyright (C) 2004-2006 Microsoft Corporation. All Rights Reserved.  -->
	<!-- ********************************************************************* -->

	<_locDefinition>
		<_locDefault _loc="locNone"/>
		<_locTag _loc="locNone" _locAttrData="ChangeDescription">Configuration</_locTag>
		<_locTag _loc="locNone" _locAttrData="Text,Title,Class,LogText">Object</_locTag>
		<_locTag _loc="locNone" _locAttrData="Text,Title,NotText,NotTitle">Rule</_locTag>
		<_locTag _loc="locNone" _locAttrData="Text,Title">Template</_locTag>
		<_locTag _loc="locNone" _locAttrData="Text,Title">RestrictionType</_locTag>
		<_locTag _loc="locNone" _locAttrData="Text,Title">Option</_locTag>
		<_locTag _loc="locNone" _locAttrData="Text,Title">Setting</_locTag>
		<_locTag _loc="locNone" _locAttrData="Text">String</_locTag>
		<_locTag _loc="locNone" _locAttrData="Text">IssueLink</_locTag>
		<_locTag _loc="locNone" _locAttrData="Title">Report</_locTag>
		<_locTag _loc="locNone" _locAttrData="Title">Action</_locTag>
	</_locDefinition>

	<Configuration ConfigVersion="1.2.21.0" ConfigName="ExMFA Master Input File" LongNameStart="Microsoft Exchange Server" LongNameEnd="Mail Flow Analyzer" ShortName="Exchange Server Mail Flow Analyzer" DownloadURL="https://www.microsoft.com/Exchange/code/ExMFA" ArticleURL="http://go.microsoft.com/fwlink/?linkid=62737&amp;l={0}&amp;v=ExMFA.{1}&amp;id={2}" HelpFile="ExMFA.chm" RootHelpId="html\6f5c22ba-d082-4454-b54c-621376e88703.htm" CheckForUpdatesHelpId="html\6f5c22ba-d082-4454-b54c-621376e88703.htm" StartScanHelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm" ScanCompletedHelpId="html\b669b0b8-7dc2-42f2-a0cd-a60f543f5bb1.htm" SelectScanHelpId="html\18433076-93df-4cb8-b87a-721edf115362.htm" ChangeDescription="Added an step to check link state churns" ReferencedFiles="ExBPA.Transport.xml">

		<ObjectProcessor Name="Step" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.StepObjectProcessor"/>
		<ObjectProcessor Name="Panel" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.PanelObjectProcessor"/>
		<ObjectProcessor Name="Information" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.PanelObjectProcessor"/>
		<ObjectProcessor Name="Progress" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.ProgressPanelObjectProcessor"/>
		<ObjectProcessor Name="Action" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.GroupObjectProcessor"/>
		<ObjectProcessor Name="Control" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.ControlObjectProcessor"/>
		<ObjectProcessor Name="IfResults" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.IfResultsObjectProcessor"/>
		<ObjectProcessor Name="Credentials" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.CredentialsObjectProcessor"/>
		<ObjectProcessor Name="Variable" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.VariableInfoObjectProcessor"/>
		<ObjectProcessor Name="DataGrid" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.DataGridObjectProcessor"/>
		<ObjectProcessor Name="RichTextBox" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.RichTextBoxObjectProcessor"/>

		<ObjectProcessor Name="Group" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.GroupObjectProcessor"/>
		<ObjectProcessor Name="Cache" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.CacheObjectProcessor"/>
		<ObjectProcessor Name="If" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.IfObjectProcessor"/>
		<ObjectProcessor Name="Resolve" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.ResolveObjectProcessor"/>
		<ObjectProcessor Name="Enumerator" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.EnumeratorObjectProcessor"/>
		<ObjectProcessor Name="Sleep" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.SleepObjectProcessor"/>
		<ObjectProcessor Name="Directory" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.DirectoryObjectProcessor"/>
		<ObjectProcessor Name="WMI" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.WMIObjectProcessor"/>
		<ObjectProcessor Name="Registry" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.RegistryObjectProcessor"/>
		<ObjectProcessor Name="File" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.FileObjectProcessor"/>
		<ObjectProcessor Name="Perfmon" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PerfmonObjectProcessor"/>
		<ObjectProcessor Name="Pdh" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PdhObjectProcessor"/>
		<ObjectProcessor Name="Metabase" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.MetabaseObjectProcessor"/>
		<ObjectProcessor Name="LookupAccount" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.LookupAccountObjectProcessor"/>
		<ObjectProcessor Name="Protocol" Assembly="BPA.NetworkCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.ProtocolObjectProcessor"/>
		<ObjectProcessor Name="Port" Assembly="BPA.NetworkCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PortObjectProcessor"/>
		<ObjectProcessor Name="Routing" Assembly="BPA.NetworkCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.RoutingObjectProcessor"/>
		<ObjectProcessor Name="DNS" Assembly="BPA.NetworkCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.DNSObjectProcessor"/>
		<ObjectProcessor Name="LinkState" Assembly="ExBPA.Shared.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Exchange.LinkStateObjectProcessor"/>
		<ObjectProcessor Name="RoutingInfo" Assembly="ExBPA.Shared.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Exchange.RoutingInfoObjectProcessor"/>
		<ObjectProcessor Name="MdbAdmin" Assembly="ExBPA.Shared.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Exchange.MdbAdminObjectProcessor"/>
		<ObjectProcessor Name="MonadCommand" Assembly="ExBPA.ExchangeCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Exchange.MonadCommandObjectProcessor"/>
		<ObjectProcessor Name="MonadData" Assembly="ExBPA.ExchangeCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Exchange.MonadDataObjectProcessor"/>
		<ObjectProcessor Name="SmtpClient" Assembly="ExBPA.ExchangeCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Exchange.SmtpClientObjectProcessor"/>

		<ExtFunction Name="list-average" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PdhObjectProcessor" Function="Average" Returns="Number" Parameters="String"/>
		<ExtFunction Name="list-sigma" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PdhObjectProcessor" Function="Sigma" Returns="Number" Parameters="String"/>
		<ExtFunction Name="list-median" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PdhObjectProcessor" Function="Median" Returns="Number" Parameters="String"/>
		<ExtFunction Name="list-max" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PdhObjectProcessor" Function="ListMax" Returns="Number" Parameters="String"/>
		<ExtFunction Name="list-min" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PdhObjectProcessor" Function="ListMin" Returns="Number" Parameters="String"/>
		<ExtFunction Name="list-percentile" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PdhObjectProcessor" Function="ListPercentile" Returns="String" Parameters="String,Number"/>
		<ExtFunction Name="longest-starts-with" Assembly="BPA.ConfigCollector.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Extensions.PdhObjectProcessor" Function="LongestStartsWith" Returns="String" Parameters="String,Any"/>
		<ExtFunction Name="regSetValue" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.Utility" Function="RegSetValue" Returns="Boolean" Parameters="String,String,String,String"/>
		<ExtFunction Name="resolve" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.ResolveObjectProcessor" Function="Resolve" Returns="String" Parameters="String"/>
		<ExtFunction Name="sdget" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.NTSD" Function="SdGet" Returns="Any" Parameters="String,String"/>
		<ExtFunction Name="setLabel" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.Utility" Function="SetLabel" Returns="Boolean" Parameters="String"/>
		<ExtFunction Name="pack" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.Utility" Function="Pack" Returns="String" Parameters="String"/>
		<ExtFunction Name="unpack" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.Utility" Function="Unpack" Returns="String" Parameters="String,Number"/>
		<ExtFunction Name="command-switches" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.Utility" Function="CommandSwitches" Returns="String" Parameters="Any"/>
		<ExtFunction Name="directory-lookup" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.Utility" Function="DirectoryLookup" Returns="String" Parameters="String,String,String,String"/>
		<ExtFunction Name="control-value" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.ControlObjectProcessor" Function="ControlValue" Returns="String" Parameters="String[,String]"/>
		<ExtFunction Name="validate-credentials" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.CredentialsObjectProcessor" Function="ValidateCredentials" Returns="Boolean" Parameters="String"/>

		<ExtFormat Name="Ascii" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.ExtFormat" Convert="ConvertBinaryToAscii"/>
		<ExtFormat Name="RoutingInfo" Assembly="ExBPA.Shared.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Exchange.RoutingInfo" Display="Display"/>
		<ExtFormat Name="RoutingInfo" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.ExtFormat" Convert="ConvertBinaryToString"/>
		<ExtFormat Name="LowerCase" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.CacheObjectProcessor" Convert="ToLower"/>
		<ExtFormat Name="Enum" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.ExtFormat" Convert="ConvertToIntegerString"/>
		<ExtFormat Name="CIMDateTime" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.ExtFormat" Convert="CIMDateTime"/>
		<ExtFormat Name="SortableDateTime" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.ExtFormat" Convert="SortableDateTime"/>

		<ConfigPreprocessor Name="2 Credentials" Assembly="BPA.WizardEngine.dll" Class="Microsoft.WindowsServerSystem.Exchange.WizardEngine.CredentialsConfigPreprocessor"/>
		<IssueProcessor Name="Events" Assembly="BPA.Common.dll" Class="Microsoft.WindowsServerSystem.BestPracticesAnalyzer.Common.EventProcessor"/>

		<Substitution Name="STEPNAMEPREFIX"></Substitution>

		<!-- Resource Strings which need to be localized -->
		<Resource>
		</Resource>

		<CustomReports>
			<Report Title="Overview" ArrangeByText="Area,Server" Query="/Wizard/Object[@Type='Step' and not(@StepStatus='Deactivated')]/*//Message[@ReportIssue='Summary']"/>
			<Report Title="Root Causes" ArrangeByText="Area,Server" Query="/Wizard/Object[@Type='Step' and not(@StepStatus='Deactivated')]/*//Message[@Error='Error' and @ReportIssue='RootCause']"/>
			<Report Title="Mail Flow Issues" ArrangeByText="Area,Server" Query="/Wizard/Object[@Type='Step' and not(@StepStatus='Deactivated')]/*//Message[@Error='Error' and @ReportIssue='Issue']"/>
			<Report Title="Other Errors" ArrangeByText="Area,Server" Query="/Wizard/Object[@Type='Step' and not(@StepStatus='Deactivated')]/*//Message[@Error='Error' and not(@ReportIssue)]"/>
			<Report Title="Warnings" ArrangeByText="Area,Server" Query="/Wizard/Object[@Type='Step' and not(@StepStatus='Deactivated')]/*//Message[@Error='Warning' and not(@ReportIssue='Summary')]"/>
			<Report Title="Recommendations" ArrangeByText="Area,Server" Query="/Wizard/Object[@Type='Step' and not(@StepStatus='Deactivated')]/*//Message[@ReportIssue='Recommendation']"/>
			<Report Title="Informational Items" ArrangeByText="Area,Server" Query="/Wizard/Object[@Type='Step' and not(@StepStatus='Deactivated')]/*//Message[(@Error='None' or @Error='NonDefault') and not(@ReportIssue)]"/>
		</CustomReports>

		<Template Name="tEvtAdjustGMTinSec" Query="if(contains($.,'+'),(substring-after($.,'+') * 60),if(contains($.,'-'),(substring-after($.,'-') * -60),0))"/>
		<Template Name="tExFileNewer" Query="substring($., 5, 4) &gt; $iFileVersionStore" Error="Warning" Sev="3" Title="Updated {5} file detected" Text="{5} file version on server {2} is more recent than the installed version of Exchange. This is probably a software update. Installed file version: {6}." S2="%varExName%" P6="$." GUID="5104a6a0-6c8d-4bf9-b056-6ed42faf8a92"/>
		<Template Name="tExFileOlder" Query="substring($., 5, 4) &lt; @S9" Error="Error" Sev="2" Title="Older {5} file detected" Text="{5} file version on server {2} is older than the installed version of Exchange. This may cause reliability problems. Installed file version: {6}." S2="%varExName%" P6="$." S9="%varExVersionNumber%"/>
		<Template Name="tInhBlockConfig" Query="boolean(bitwise-and(sdget('Control', $.),4096))" Error="Error" Sev="1" Title="Permissions inheritance block" Text="Access control list (ACL) inheritance is blocked for '{3}'. This may cause mail flow problems, store mounting issues and other service outages. Follow Microsoft Knowledge Base article 264733 and use the Active Directory Sites and Services program to re-enable inheritance on this object." S3="%DN%" GUID="d6d352bd-68a6-4270-b522-ea4dded1b7c1"/>
		<Template Name="tRemotePingSuccess" Query="$.=0" Error="None" Title="Ping successful" Text="Ping (Don't fragment = '{3}' and buffer size = {9}) from server {2} to remote server {1} was successful." S1="%SERVERLONGNAME%" S2="%varExName%"/>
		<Template Name="tRemotePingRequestTimedOut" Query="$.=11010" Error="Warning" Sev="2" Title="Ping request was timed out" Text="Ping (Don't fragment = '{3}' and buffer size = {9}) from server {2} to remote server {1} was timed out. Check whether the server is operational or not." S1="%SERVERLONGNAME%" S2="%varExName%" GUID="6c28d83b-45a7-4f66-bc9e-5a2427e8ae83"/>
		<Template Name="tRemotePingPacketTooBig" Query="$.=11009" Error="Error" Sev="2" ReportIssue="Issue" Title="Maximum Transmission Unit (MTU) size may be too small" Text="Ping (Don't fragment = '{3}' and buffer size = {9}) from server {2} to remote server {1} was not successful as the packet was too big. This indicates that the configured Maximum Transmission Unit (MTU) size may be too small." S1="%SERVERLONGNAME%" S2="%varExName%" GUID="6c28d83b-45a7-4f66-bc9e-5a2427e8ae83"/>
		<Template Name="tRemotePingOtherError" Error="Warning" Sev="2" Title="Ping unsuccessful" Text="Ping (Don't fragment = '{3}' and buffer size = {9}) from server {2} to remote server {1} was not successful. Check whether the server is operational or not." S1="%SERVERLONGNAME%" S2="%varExName%" GUID="6c28d83b-45a7-4f66-bc9e-5a2427e8ae83"/>
		<Template Name="tSMTPProxyRunning" Query="starts-with($.[2],'Respond = 220') and contains(upper-case($.[2]), @S4)" Error="Error" Sev="3" ReportIssue="Issue" Title="Possible SMTP proxy detected ({0})" Text="Server {2} may be placed behind a {0} device with the SMTP proxy capability enabled. Please check the configuration and ensure that it is not blocking legitimate messages. You may need to consider turning off the SMTP proxy if severe mail delivery problems occur. {1}" P1="replace($.[2], ',$', '')" S2="%varExName%" GUID="80f59e9e-8d83-4120-bd29-5e8463df05e0"/>
		<Template Name="tDSN" Query="contains($.,@S4)" Error="Warning" Sev="2" Title="Exchange {6} delivery status notification code {4}" S6="2000/2003"/>
		<Template Name="tDirectoryException" Query="../Exception/@Message" Title="Error accessing Active Directory" Text="Error '{0}' while accessing Active Directory."/>
		<Template Name="tWmiException" Query="../Exception/@Message" Title="Error accessing WMI" Text="Error '{0}' accessing Windows Management Instrumentation (WMI) repository."/>
		<Template Name="tRegistryException" Query="../Exception/@Message" Title="Error accessing registry" Text="Error '{0}' accessing registry."/>
		<Template Name="tMetabaseException" Query="../Exception/@Message" Title="Error accessing metabase" Text="Error '{0}' while accessing metabase."/>
		<Template Name="tPdhException" Query="../Exception/@Message" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. Error message: {1}." P1="../Exception/@Message"/>
		<Template Name="tMonadException" Query="../Exception/@Message" Title="Error executing command" Text="Error '{0}' while executing command."/>
		<Template Name="tGenericException" Query="../Exception/@Message" Title="Runtime error" Text="Error '{0}' while executing."/>
	</Configuration>

	<!-- ****************************************************************************************************************** -->
	<!-- The User Input Data Gathering Steps -->
	<!-- ****************************************************************************************************************** -->

	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="ReadConfigurationStep" Title="Retrieving data from executing workstation" Display="Left" SkipSave="True">
		<Object Type="Action" HelpId="html\6f5c22ba-d082-4454-b54c-621376e88703.htm">
			<Object Type="Group" Name="Executing Workstation">
				<Object Type="If" Key1="true()" Display="HideAll">
					<Setting Key1="'1'" SQM="91;Set"/>
				</Object>
				<Setting Key1="Variables">
					<Rule Name="szSymptom0" Query="string(@Title)" Title="Users are receiving unexpected non-delivery reports when sending messages">
						<Variable Name="varSymptom[0]" Scope="Children"/>
					</Rule>
					<Rule Name="szSymptom1" Query="string(@Title)" Title="Expected messages from senders are delayed or are not received by some recipients">
						<Variable Name="varSymptom[1]" Scope="Children"/>
					</Rule>
					<Rule Name="szSymptom2" Query="string(@Title)" Title="Messages destined to recipients are delayed or are not received by some recipients">
						<Variable Name="varSymptom[2]" Scope="Children"/>
					</Rule>
					<Rule Name="szSymptom3" Query="string(@Title)" Title="Messages are backing up in one or more queues on a server">
						<Variable Name="varSymptom[3]" Scope="Children"/>
					</Rule>
					<Rule Name="szSymptom4" Query="string(@Title)" Title="Messages sent by user(s) are pending submission on their mailbox server(s) (for Exchange Server 2007 only)">
						<Variable Name="varSymptom[4]" Scope="Children"/>
					</Rule>
					<Rule Name="szSymptom5" Query="string(@Title)" Title="Problems with Edge Server synchronization with Active Directory (for Exchange Server 2007 only)">
						<Variable Name="varSymptom[5]" Scope="Children"/>
					</Rule>
					<Rule Name="szDC" Query="if($szDCSpecified,string($szDCSpecified),string($szDCDetected))" AlwaysEvaluate="True">
						<Variable Name="varDefDCName" Scope="Global"/>
					</Rule>
					<Rule Name="szExName" Query="if($szServerSpecified,string($szServerSpecified),'')" AlwaysEvaluate="True">
						<Variable Name="varDefExName" Scope="Global"/>
					</Rule>
					<Rule Name="szExGWName" Query="if($szExGWSpecified,string($szExGWSpecified),'')" AlwaysEvaluate="True">
						<Variable Name="varDefExGWName" Scope="Global"/>
					</Rule>
					<Rule Name="szGWName" Query="if($szGWSpecified,string($szGWSpecified),'')" AlwaysEvaluate="True">
						<Variable Name="varDefGWName" Scope="Global"/>
					</Rule>
					<Rule Name="szGWSMTP" Query="if($szGWSMTPPort,string($szGWSMTPPort),'25')" AlwaysEvaluate="True">
						<Variable Name="varDefGWSMTPPort" Scope="Global"/>
					</Rule>
					<!-- Initializing with a null value for now as we may not want to store an e-mail address in the registry -->
					<Rule Name="szEmpty" Query="string()">
						<Variable Name="varMonadDCParameter" Scope="Global"/>
						<Variable Name="varDefTestMailAddress" Scope="Global"/>
						<Variable Name="varDefOutboundSenderAddress" Scope="Global"/>
						<Variable Name="varDefOutboundRecipAddress" Scope="Global"/>
					</Rule>
					<Rule Name="szMailFrom" Query="string('ExMFA-MailAcceptTest@Fabrikam.com')">
						<Variable Name="varDefTestMailFromAddress" Scope="Global"/>
					</Rule>
					<Rule Name="fSkipInfoSteps" Query="if($szSkipInformationalSteps='1','1','0')" AlwaysEvaluate="True">
						<Variable Name="varContinueRun" Scope="Children"/>
					</Rule>
				</Setting>
				<Object Type="WMI" Key1="" Key3="Win32_OperatingSystem">
					<Setting Key1="OSLanguage">
						<Rule Name="fNonEnglishOS" Query="$.!=1033">
							<Variable Name="varNonEnglishOS" Scope="Children"/>
						</Rule>
					</Setting>
					<Setting Key1="LocalDateTime" Format="CIMDateTime">
						<Rule Name="dCurrentDateTime" Query="$.">
							<Variable Name="varCurrentDateTime" Scope="Children"/>
						</Rule>
					</Setting>
				</Object>
				<Object Type="Registry" Key1="" Key3="Software\Microsoft\Windows NT\CurrentVersion">
					<Setting Key1="CurrentVersion">
						<Rule Name="fLocalWinVer2008" Query="$.='6.0'">
							<Variable Name="varLocalIPv6Capable" Scope="Children"/>
						</Rule>
					</Setting>
				</Object>
				<Object Type="Registry" Key1="" Key2="HKEY_CURRENT_USER" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\ExTRA">
					<Setting Key1="DCDetected">
						<Rule Name="szDCDetected" Query="$."/>
					</Setting>
				</Object>
				<Object Type="Registry" Key1="" Key2="HKEY_CURRENT_USER" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\ExMFA">
					<Setting Key1="DCSpecified">
						<Rule Name="szDCSpecified" Query="$."/>
					</Setting>
					<Setting Key1="ServerSpecified">
						<Rule Name="szServerSpecified" Query="$."/>
					</Setting>
					<Setting Key1="ExGatewaySpecified">
						<Rule Name="szExGWSpecified" Query="$."/>
					</Setting>
					<Setting Key1="GatewaySpecified">
						<Rule Name="szGWSpecified" Query="$."/>
					</Setting>
					<Setting Key1="GatewaySMTPPort">
						<Rule Name="szGWSMTPPort" Query="$."/>
					</Setting>
					<Setting Key1="SkipInformationalSteps">
						<Rule Name="szSkipInformationalSteps" Query="$."/>
					</Setting>
				</Object>
				<Object Type="Metabase" Key1="" Key2="LM/">
					<Rule Name="fMetabaseClientMissing" Query="if(../Exception/@HResult = -2147221164,1,0)">
						<Variable Name="varNoMetabaseClient" Scope="Children"/>
					</Rule>
				</Object>
				<Rule NextStep="SelectSymptom" Name="fGotoSelectSymptom" Query="true()"/>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="SelectSymptom" Title="Select Symptom" Text="Symptoms" Display="Left" SkipSave="True">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varSymptom%" Substitution="varSymptom" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varNoMetabaseClient%" Substitution="varNoMetabaseClient" Display="Hide"/>

			<Object Type="Panel" Display="Hide" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Control" SubType="Title" Name="title" Position="Top" Text="Exchange Mail Flow Troubleshooter"/>
				<Object Type="Control" SubType="Label" Name="labelLabel" Position="Below" Width="250" Text="Enter an identifying label for this analysis:"/>
				<Object Type="Control" SubType="TextBox" Name="Label" Position="265," Width="531" Default="" Display="Hide">
					<Setting Key1="LabelName">
						<Rule Name="fSetLabelToServerName" Query="if(string-length($.) &gt; 0, setLabel($.))"/>
					</Setting>
				</Object>
				<Object Type="Control" SubType="GradiatedBox" Name="TopLine" Position="At(labelLabel),After(labelLabel)"/>
				<Object Type="Control" SubType="Label" Name="label1" Position="Below" Text="What symptoms are you seeing?"/>
				<Object Type="Control" SubType="ComboBox" Name="Symptoms" Position="Below" Width="780" Default="%varSymptom%">
					<Setting Key1="SelectedIndex">
						<Rule Name="szSelSymptom" Query="slice('NDR,Inbound,Outbound,Queue,MailboxSubmission,EdgeSyncTroubleshooter',',',$.)" AlwaysEvaluate="True">
							<Variable Name="varSelSymptom" Scope="Children"/>
						</Rule>
						<Rule NextStep="GetServerInfo" Name="fGotoGetServerInfo" Query="$.='0' or $.='1' or $.='2' or $.='3' or $.='4' or $.='5'"/>
						<Rule Name="fSQMNDR" Query="$.='0'" SQM="106;Set"/>
						<Rule Name="fSQMInbound" Query="$.='1'" SQM="107;Set"/>
						<Rule Name="fSQMOutbound" Query="$.='2'" SQM="108;Set"/>
						<Rule Name="fSQMQueue" Query="$.='3'" SQM="109;Set"/>
						<Rule Name="fSQMMailboxSubmission" Query="$.='4'" SQM="110;Set"/>
						<Rule Name="fSQMEdgeSyncTroubleshooter" Query="$.='5'" SQM="111;Set"/>
					</Setting>
				</Object>
				<Object Type="Control" SubType="GradiatedBox" Name="MiddleLine" Position="LeftBelow"/>
				<Object Type="Control" SubType="CheckBox" Name="ContinueRun" Position="Below" Text="Hide Informational Display" Default="%varContinueRun%">
					<Setting Key1="Checked">
						<Rule Name="iContinueRun" Query="$.">
							<Variable Name="varContinueRun" Scope="Local"/>
						</Rule>
						<Rule Name="fSetContinueRun" Query="regSetValue('','SOFTWARE\\Microsoft\\ExchangeServer\\v14\\ExMFA','SkipInformationalSteps',$.)"/>
					</Setting>
				</Object>
				<Object Type="Control" SubType="Label" Name="label6" Position="Below" Text="Selecting this option will hide the detailed analysis results until the end of the analysis."/>

				<Object Type="If" Key1="'%varNoMetabaseClient%'='1'" Display="Hide">
					<Object Type="Control" SubType="Label" Name="nometa" Position="LeftBelow" Text="Warning: This computer does not appear to have Internet Information Services Common Files installed. Troubleshooting capabilities for Exchange 2000 Server and Exchange Server 2003 servers will be limited." ForeColor="Red"/>
				</Object>

				<Object Type="Control" SubType="GradiatedBox" Name="BottomLine" Position="LeftBelow"/>
				<Object Type="Control" SubType="Link" Name="Step0" Position="IndentBelow" Percent="20" Text="Next"/>

			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="GetDSNCode" Title="Delivery Status Notification Code" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varIsExchange2000or2003%" Substitution="varIsExchange2000or2003" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Panel" Display="Hide" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Setting Display="Hide">
					<Rule NextStep="DisplayResultsStep" Name="fDisplayDSNCauseStep" Query="@S1='0' and not($fNotValidDSN)" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="InputErrors" Name="fInputErrorsGetDSNCode" Query="$fNotValidDSN" Error="Error" Priority="2" Text="No valid delivery status notification code provided"/>
					<!-- Further investigation for DSN 5.4.4 (Exchange 2007) and 5.5.0 (both) -->
					<Rule NextStep="CheckDNSAvailability" Name="fDSN550GotoDNSAvilability" Query="($fDSN550 or $fe12DSN550 or $fe12DSN544) and not($fNotValidDSN)" Priority="3" Text="- Check DNS availability" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckDNSRecords" Name="fDSN550GotoDNSRecords" Query="($fDSN550 or $fe12DSN550) and not($fNotValidDSN)" Priority="4" Text="- Check whether the necessary records can be retrieved from the DNS servers" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="ScanE12MessageTracking" Name="fGotoScanE12MessageTracking" Query="'%varIsExchange2007orLater%'='1'" Priority="5" Text="- Scan tracking log for failure events matching the delivery status notification code provided" Display="Hide" AlwaysEvaluate="True"/>
				</Setting>

				<Rule Name="szGetDSNCode" Query="'GetDSNCode'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szDSNErrorStateText" Query="if($fNotValidDSN,string(@Title),$szDSNNoErrorStateText)" Title="One or more errors were found." AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szDSNNoErrorStateText" Query="string(@Title)" Title="Possible delivery status notification causes identified."/>
				<Rule Name="szDSNTestResult" Query="string(@Title)" Title="Delivery Status Notification Analysis Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>
				<Object Type="Control" SubType="Title" Name="title" Position="Top" Text="Enter Delivery Status Notification Code"/>
				<Object Type="Control" SubType="Label" Name="label" Position="Below" Text="This tool will help you identify possible causes of mail flow problems from the delivery status notification code described in the non-delivery report (NDR). You can find a delivery status notification code by locating a 4.X.X or 5.X.X format number in a NDR."/>

				<Object Type="Control" SubType="Label" Name="DSNLabel" Position="LeftBelow" Text="Delivery Status Notification Code"/>

				<!-- Prompt the user to input the DSN code -->
				<Object Type="Group" Name="Delivery Status Notification" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="If" Name="Exchange 2000 and Exchange 2003 DSN Codes" Key1="'%varIsExchange2000or2003%' = '1'">
						<Object Type="Control" SubType="ComboBox" Name="DSN" Position="Below" Default="{5}4.3.1{5}4.3.2{5}4.4.1{5}4.4.2{5}4.4.6{5}4.4.7{5}4.4.9{5}4.6.5{5}5.0.0{5}5.1.0{5}5.1.1{5}5.1.2{5}5.1.3{5}5.1.4{5}5.1.6{5}5.1.7{5}5.2.1{5}5.2.2{5}5.2.3{5}5.3.0{5}5.3.3{5}5.3.5{5}5.4.0{5}5.4.4{5}5.4.6{5}5.4.8{5}5.5.0{5}5.5.2{5}5.5.3{5}5.6.3{5}5.7.1" Width="200">
							<Setting Key1="DSNNumber">
								<Rule Name="fDSN431" Template="tDSN" Text="{4}: This code may be caused by a resource problem such as a disk full condition. This code may also occur if your Simple Mail Transfer Protocol (SMTP) queue is on a File Allocation Table (FAT) partition and the service has reached a Windows-imposed limit on the number of concurrent file handles that can be opened by the SMTP Service. In this case, instead of receiving a disk full error, you might be receiving an out of memory error." S4="4.3.1"/>
								<Rule Name="fDSN432" Template="tDSN" Text="{4}: The message was not delivered because of Administrator action through the queue viewer interface in Exchange System Manager." S4="4.3.2"/>
								<Rule Name="fDSN441" Template="tDSN" Text="{4}: The host is not responding. This code may be caused by transient network conditions. Exchange will automatically try again to connect and deliver the message. If delivery still fails after multiple tries, a permanent failure non-delivery report will be generated." S4="4.4.1"/>
								<Rule Name="fDSN442" Template="tDSN" Text="{4}: The connection has been dropped between servers. This code may be caused by transient network issues or servers that are down. The server tries to deliver the message for a specific time period, and then generates additional status reports." S4="4.4.2"/>
								<Rule Name="fDSN446" Template="tDSN" Text="{4}: The max hop count was exceeded for the message. This code may occur if a loop situation exists between a sending server and a receiving server that are not in the same organization. In this scenario, the message bounces back and forth until the hop count is exceeded. The max hop count property is set for each virtual server, and you can manually override this setting (the default setting is 15 for Exchange 2000 Server and 30 for Exchange Server 2003). Additionally, look for any situations that could cause loops between servers." S4="4.4.6"/>
								<Rule Name="fDSN447" Template="tDSN" Text="{4}: The message in the queue has expired. The sending server tried to relay or deliver the message, but the action was not completed before the message expiration time occurred. This non-delivery report may indicate that a message header limit has been reached on a remote server or that some other protocol timeout occurred during communication with the remote server. This code typically indicates an issue on the receiving server. Verify the validity of the recipient address, and verify that the receiving server is configured to receive messages correctly." S4="4.4.7"/>
								<Rule Name="fDSN449" Template="tDSN" Text="{4}: This code indicates that a temporary routing error occurred or that a bad routing configuration exists. This issue may occur in one or both of the following scenarios: a) A Simple Mail Transfer Protocol (SMTP) connector is configured to use DNS without a smart host and is also configured to use a non-SMTP address space such as an X.400 address space, b) A message was sent to a recipient who was identified as a member of a routing group that was deleted. If the problem persists, use the WinRoute tool to examine the routing groups in the tree view pane, and then examine the address spaces of the route that the problem message takes." S4="4.4.9"/>
								<Rule Name="fDSN465" Template="tDSN" Text="{4}: This code occurs when conversion of an inbound SMTP failed because the code page that is specified in the message is not installed on the receiving server. This delivery status notification contains only the original message headers. None of the original content is provided. Troubleshooting: View the header of the original message. Make sure that the required language files are installed on the server that is receiving the message." S4="4.6.5"/>
								<Rule Name="fDSN500" Template="tDSN" Text="{4}: There are several possible causes for this code. 1)There is no route for the specified address space. For example, an SMTP connector is configured, but this address does not match. 2)DNS returned an authoritative host that was not found for the domain. 3)The routing group does not have a connector defined. Mail from one server in one routing group does not have a route to another routing group. 4)An SMTP protocol error occurred." S4="5.0.0"/>
								<Rule Name="fDSN510" Template="tDSN" Text="{4}: This code indicates a general categorizer-based failure (bad address failure). A mail address or other attribute cannot be found in the directory. This issue may occur if contact entries do not have the 'targetAddress' attribute set. This issue occurs most frequently when the categorizer receives 'object not found' errors when trying to retrieve the 'homeMDB' property. Another possible cause is that the local 'System' account does not have sufficient permissions to read the 'homeMDB' attribute. Troubleshooting: Verify that the recipient address is formatted correctly and resend the message. Check permissions inheritance on the Exchange directory objects." S4="5.1.0"/>
								<Rule Name="fDSN511" Template="tDSN" Text="{4}: There are several possible causes for this code. One of the most common ones is that the mail account does not exist at the organization the message was sent to. This issue may occur if there was a problem when users were moved between sites. For example, if a user is moved to a server in a different administrative group and then replies to an old message, or if the user does not recreate his or her Outlook profile, the old administrative group legacy address is used, and a non-delivery report is generated. Troubleshooting: Verify that the recipient address is formatted correctly and resend the message." S4="5.1.1"/>
								<Rule Name="fDSN512" Template="tDSN" Text="{4}: This code may occur if the 'legacyExchangeDN' attribute on the recipient object is blank or contains an invalid value. The Recipient Update Service may be having a problem or a third-party address generating tool may be failing to populate the attribute. Troubleshooting: Verify that the 'legacyExchangeDN' attribute of the recipient having this issue contains the correct value." S4="5.1.2"/>
								<Rule Name="fDSN513" Template="tDSN" Text="{4}: Bad address syntax. For example, a contact is configured with a 'targetAddress' attribute that has no address type or the fully-qualified domain name of the destination server has a trailing period. Troubleshooting: Verify the recipient address and resend the message. Also, verify that the 'networkAddress' property of the destination server has the correct computer name." S4="5.1.3"/>
								<Rule Name="fDSN514" Template="tDSN" Text="{4}: Two objects have the same mail address, and mail is sent to that address. This issue may also occur if the recipient does not exist on the remote server. Verify the recipient address and resend the message." S4="5.1.4"/>
								<Rule Name="fDSN516" Template="tDSN" Text="{4}: The user directory attributes, such as homeMDB or msExchHomeServerName, may be missing or corrupted. Troubleshooting: Verify the integrity of the user directory attributes, and then run the Recipient Update Service again to make sure that the attributes that are required for transport are valid." S4="5.1.6"/>
								<Rule Name="fDSN517" Template="tDSN" Text="{4}: The sender has a malformed or missing mail attribute in the directory structure. The Transport categorizer cannot deliver the mail item without a valid mail attribute. Troubleshooting: Verify the sender directory structure and determine whether the mail attribute exists." S4="5.1.7"/>
								<Rule Name="fDSN521" Template="tDSN" Text="{4}: Local mail is refused because the message is too big. An absent Master Account Security identifier (SID) on the recipient can also cause this error message. Troubleshooting: Verify access permissions in addition to the message size. Determine if the recipient has an SID." S4="5.2.1"/>
								<Rule Name="fDSN522" Template="tDSN" Text="{4}: The recipient's mailbox is over its storage limit. Troubleshooting: Verify the mailbox storage and the queue storage quota limit." S4="5.2.2"/>
								<Rule Name="fDSN523" Template="tDSN" Text="{4}: The message is too large for the local quota. For example, a remote Exchange user may have delivery restrictions set with max incoming message size. Troubleshooting: Resend the message without attachments, or set the server side limit or the client side limit to permit a larger message size." S4="5.2.3"/>
								<Rule Name="fDSN530" Template="tDSN" Text="{4}: Exchange Server 2003 can be configured to run without the Microsoft Exchange MTA Stacks service. In this configuration, if a message was found to require this service for routing, this delivery status notification is returned to the sender. Troubleshooting: Check your routing topology. Use the WinRoute tool to make sure that the routes are correctly replicated between servers and routing groups." S4="5.3.0"/>
								<Rule Name="fDSN533" Template="tDSN" Text="{4}: The Exchange 2000 remote server or the Exchange 2003 remote server is out of disk storage to hold mail. This issue occurs most frequently when the sending server is sending mail with binary DATA (BDAT). This code may also indicate an SMTP protocol error. Troubleshooting: Make sure the remote server has sufficient storage to hold mail, and examine the SMTP protocol log for errors." S4="5.3.3"/>
								<Rule Name="fDSN535" Template="tDSN" Text="{4}: A situation where the server is configured to loop back on itself was detected. If you have multiple SMTP virtual servers that are configured on your Exchange computer, make sure that they are serving unique incoming ports and that the outgoing SMTP port configuration is valid to avoid looping between local virtual servers. Check the configuration of the server's connectors for loops." S4="5.3.5"/>
								<Rule Name="fDSN540" Template="tDSN" Text="{4}: Possible causes include 1) an authoritative host wasn't found in DNS, 2) the smart host entry is incorrect, 3) the fully qualified domain name (FQDN) in the Hosts file (this issue was fixed in Windows 2000 SP3), 4) a DNS failure or an invalid IP address for your smart host, 5) SMTP VS doesn't have a valid FQDN or SMTP VS FQDN lookup failed, and 6) a contact's SMTP domain doesn't resolve to any SMTP address spaces. Troubleshooting: Use Nslookup to check the DNS. Verify that the IP address is in IPv4 literal format. Verify that there is a valid DNS entry for the server or computer name in question." S4="5.4.0"/>
								<Rule Name="fDSN544" Template="tDSN" Text="{4}: No route to message, next hop not found. You have set up a Routing Group topology but there is no Routing Group Connector set up between the Routing Groups. Troubleshooting: Add or configure your Routing Group Connector between Routing Groups" S4="5.4.4"/>
								<Rule Name="fDSN546" Template="tDSN" Text="{4}: A categorizer forward loop was detected. The 'targetAddress' attribute is set on a mailbox-enabled user. This is a common hosting configuration problem when someone creates a contact in organizational unit (OU) 1 and then creates a user in OU 2 that has the same mail address by using the user provisioning tool. Troubleshooting: Check and remove the 'targetAddress' attribute from mailbox-enabled users." S4="5.4.6"/>
								<Rule Name="fDSN548" Template="tDSN" Text="{4}: This code indicates a looping condition. This issue may occur if one of the recipient policies includes a local domain that matches the fully-qualified domain name (FQDN) of an Exchange server in the organization. When the categorizer processes mail that is destined for a domain that matches the fully-qualified domain name (FQDN) of an Exchange server, a non-delivery report with this code is generated." S4="5.4.8"/>
								<Rule Name="fDSN550" Template="tDSN" Text="{4}: Generic protocol error (SMTP error). The remote SMTP response to our EHLO with a 500 level error and the sending system will QUIT the connection and report this with non-delivery report indicating the remote SMTP server cannot handle the protocol. (For example, if a Hotmail account is no longer active, a 550 SMTP error will occur.) Troubleshooting: Run an SMTP protocol log or a Network Monitor trace to see why the remote SMTP server rejects the protocol request." S4="5.5.0"/>
								<Rule Name="fDSN552" Template="tDSN" Text="{4}: This refers to a general protocol error when SMTP protocols are out of sequence. For example, an SMTP protocol error occurs when AUTH is tried before EHLO. In one observation, this occurred when the system was experiencing an out of disk condition. Troubleshooting: Run an SMTP protocol log or a Network Monitor trace and make sure that there is enough disk storage and virtual memory for SMTP to operate." S4="5.5.2"/>
								<Rule Name="fDSN553" Template="tDSN" Text="{4}: Too many recipients on the sent message. Troubleshooting: The recipient limit is a configurable limit on the receiving server. To resolve this issue, either increase the recipient limit, or break up the message into multiple messages to fit the server limit. Note The default recipient limit on a Simple Mail Transfer Protocol (SMTP) message is 5000." S4="5.5.3"/>
								<Rule Name="fDSN563" Template="tDSN" Text="{4}: Most common possible causes are 1)The message contains more than 250 attachments. More than 250 attachments cause the MAPI_E_TOO_BIG error and 2)Mail has been sent with a malformed addr822 header. Troubleshooting: Reduce the number of attachments in the message, and then resend the message." S4="5.6.3"/>
								<Rule Name="fDSN571" Template="tDSN" Text="{4}: Possible causes: 1)General access denied, sender access denied - the sender of the message does not have the privileges required to complete delivery. 2)You are trying to relay your mail through another SMTP server and it does not permit you to relay. 3)The recipient might have mailbox delivery restrictions enabled. For example, a recipient's mailbox delivery restriction was set to receive from a distribution group only and non-members' e-mail will be rejected with this error. 4)For Exchange Server 2003, a distribution group can be configured to restrict mail delivery from unauthenticated users. Mail that is sent by using an unauthenticated SMTP session are rejected." S4="5.7.1"/>

								<Rule Name="fE2kDSN" Query="$fDSN431 or $fDSN432 or $fDSN441 or $fDSN442 or $fDSN446 or $fDSN447 or $fDSN449 or $fDSN465 or $fDSN500 or $fDSN510 or $fDSN511 or $fDSN512 or $fDSN513 or $fDSN514 or $fDSN516 or $fDSN517 or $fDSN521 or $fDSN522 or $fDSN523 or $fDSN530 or $fDSN533 or $fDSN535 or $fDSN540 or $fDSN544 or $fDSN546 or $fDSN548 or $fDSN550 or $fDSN552 or $fDSN553 or $fDSN563 or $fDSN571"/>
								<Rule Name="fNotValidE2KDSN" Query="string-length($.)=0 or not($fE2kDSN)"/>
							</Setting>
						</Object>
					</Object>
					<Object Type="If" Name="Exchange 2007 DSN Codes" Key1="'%varIsExchange2007orLater%' = '1'">
						<Object Type="Control" SubType="ComboBox" Name="DSN" Position="Below" Default="{5}4.4.7{5}5.0.0{5}5.1.0{5}5.1.1{5}5.1.2{5}5.1.3{5}5.1.4{5}5.1.6{5}5.1.7{5}5.1.8{5}5.2.0{5}5.2.1{5}5.2.2{5}5.2.3{5}5.2.4{5}5.3.0{5}5.3.2{5}5.3.3{5}5.3.4{5}5.3.5{5}5.4.0{5}5.4.4{5}5.4.6{5}5.4.7{5}5.5.0{5}5.5.1{5}5.5.2{5}5.5.3{5}5.5.4{5}5.5.5{5}5.5.6{5}5.6.0{5}5.6.1{5}5.6.2{5}5.6.3{5}5.6.4{5}5.6.5{5}5.7.0{5}5.7.1{5}5.7.2{5}5.7.3{5}5.7.4{5}5.7.5{5}5.7.6{5}5.7.7" Width="200">
							<Setting Key1="DSNNumber">
								<Rule Name="szE12DSNFilter" Query="$.">
									<Variable Name="varE12DSNFilter" Scope="Children"/>
								</Rule>
								<Rule Name="fe12DSN447" Template="tDSN" Text="{4}: The message in the queue has expired. The sending server tried to relay or deliver the message, but the action was not completed before the message expiration time occurred." S4="4.4.7" S6="2007"/>
								<Rule Name="fe12DSN500" Template="tDSN" Text="{4}: An error occurred while trying to deliver a message to the recipients e-mail address. A remote server may reject a message with this code when the error does not belong to any other known codes. Check the extended reason in the diagnostic part of the received non-delivery report." S4="5.0.0" S6="2007"/>
								<Rule Name="fe12DSN510" Template="tDSN" Text="{4}: The e-mail message was rejected by the recipient e-mail system. This code indicates a generic incorrect e-mail address issue. This code may also occur if the submitted e-mail message is considered as a spam. Check the extended reason in the diagnostic part of the received non-delivery report." S4="5.1.0" S6="2007"/>
								<Rule Name="fe12DSN511" Template="tDSN" Text="{4}: The e-mail address is invalid or does not exist in the recipient e-mail system. One of the most common causes is that a recipient cannot be found in the directory for an authoritative domain. Troubleshooting: Verify that the recipient address is formatted correctly and resend the message." S4="5.1.1" S6="2007"/>
								<Rule Name="fe12DSN512" Template="tDSN" Text="{4}: The e-mail address is invalid or does not exist in the recipient e-mail system. This code may be caused by an invalid non-SMTP address of the recipient. Troubleshooting: Verify that the non-SMTP address of the recipient is formatted correctly and resend the message." S4="5.1.2" S6="2007"/>
								<Rule Name="fe12DSN513" Template="tDSN" Text="{4}: The format of the recipient e-mail address is not valid. Valid SMTP e-mail addresses can contain only letters, numbers, hyphens, periods, and only one @ symbol. Troubleshooting: Verify that the SMTP address of the recipient is formatted correctly and resend the message." S4="5.1.3" S6="2007"/>
								<Rule Name="fe12DSN514" Template="tDSN" Text="{4}: Two or more objects have the same mail address, and mail is sent to that address. The duplicated e-mail address may be an SMTP or non-SMTP address. This is usually caused by a configuration problem of Active Directory. Modify the affected recipient directory object to have a unique e-mail address and resend the message." S4="5.1.4" S6="2007"/>
								<Rule Name="fe12DSN516" Template="tDSN" Text="{4}: The recipient e-mail address has changed and is not accepting e-mail messages. No forwarding address is available. This code may occur if the recipient's mailbox was removed entirely. Troubleshooting: Verify that the user object still exists in Active Directory with valid attributes and resend the message." S4="5.1.6" S6="2007"/>
								<Rule Name="fe12DSN517" Template="tDSN" Text="{4}: The sender e-mail address is invalid. There may be an error in the e-mail account configuration. Check for configuration errors in the directory." S4="5.1.7" S6="2007"/>
								<Rule Name="fe12DSN518" Template="tDSN" Text="{4}: The domain name part of the sender's SMTP e-mail address is invalid. The domain part, which is the part of the e-mail address after the @ symbol, can contain only letters, numbers, hyphens, and periods. Troubleshooting: Verify that the SMTP address of the sender is formatted correctly and resend the message." S4="5.1.8" S6="2007"/>
								<Rule Name="fe12DSN520" Template="tDSN" Text="{4}: There is an error in the recipient's mailbox configuration. This code may occur if the categorizer finds a bad or missing primary SMTP proxy address for the recipient. Troubleshooting: Verify that the SMTP proxy address of the recipient exists and it is formatted correctly." S4="5.2.0" S6="2007"/>
								<Rule Name="fe12DSN521" Template="tDSN" Text="{4}: The recipient mailbox is disabled and is not accepting e-mail messages. Verify that the recipient's mailbox is enabled and access permissions are configured correctly." S4="5.2.1" S6="2007"/>
								<Rule Name="fe12DSN522" Template="tDSN" Text="{4}: The recipient mailbox is full. The sender should try sending the e-mail message again later." S4="5.2.2" S6="2007"/>
								<Rule Name="fe12DSN523" Template="tDSN" Text="{4}: The e-mail message exceeded the maximum message size allowed by the recipient mailbox. The sender should make the e-mail message smaller and try sending it again." S4="5.2.3" S6="2007"/>
								<Rule Name="fe12DSN524" Template="tDSN" Text="{4}: The recipient e-mail system had a problem when it tried to expand the distribution list." S4="5.2.4" S6="2007"/>
								<Rule Name="fe12DSN530" Template="tDSN" Text="{4}: An error occurred during delivery of the e-mail message." S4="5.3.0" S6="2007"/>
								<Rule Name="fe12DSN532" Template="tDSN" Text="{4}: The recipient e-mail system is not accepting any e-mail messages. The sender should try sending the message again later." S4="5.3.2" S6="2007"/>
								<Rule Name="fe12DSN533" Template="tDSN" Text="{4}: The recipient e-mail system can't process this e-mail message. The sender should try creating a new message and sending it again." S4="5.3.3" S6="2007"/>
								<Rule Name="fe12DSN534" Template="tDSN" Text="{4}: The e-mail message exceeded the maximum message size allowed by the recipient e-mail system. The sender should make the e-mail message smaller and try sending it again." S4="5.3.4" S6="2007"/>
								<Rule Name="fe12DSN535" Template="tDSN" Text="{4}: The recipient e-mail system can't process this e-mail message." S4="5.3.5" S6="2007"/>
								<Rule Name="fe12DSN540" Template="tDSN" Text="{4}: A network error prevented delivery of the e-mail message." S4="5.4.0" S6="2007"/>
								<Rule Name="fe12DSN544" Template="tDSN" Text="{4}: The recipient e-mail system does not have enough information to deliver the message. Please see the diagnostic text in the non-delivery report to determine whether this was the Resolver or SMTP component that rejected the message. A Resolver error means that routing configuration could not find a delivery path and an SMTP error means that the DNS records for specific domains cannot be identified. Troubleshooting: For Resolver: Verify that address spaces are configured correctly on send connectors. For SMTP: Verify that the domain name is correct and that domain is functional." S4="5.4.4" S6="2007"/>
								<Rule Name="fe12DSN546" Template="tDSN" Text="{4}: The recipient e-mail system could not deliver the message. There was a configuration error." S4="5.4.6" S6="2007"/>
								<Rule Name="fe12DSN547" Template="tDSN" Text="{4}: The e-mail message could not be delivered because it was not delivered within the administrator-specified time limit." S4="5.4.7" S6="2007"/>
								<Rule Name="fe12DSN550" Template="tDSN" Text="{4}: A transmission error prevented delivery of the e-mail message." S4="5.5.0" S6="2007"/>
								<Rule Name="fe12DSN551" Template="tDSN" Text="{4}: A protocol command was either out of order or not supported. The sender can try sending the e-mail message again later." S4="5.5.1" S6="2007"/>
								<Rule Name="fe12DSN552" Template="tDSN" Text="{4}: The syntax for a protocol command was either invalid or not recognized. The sender can try sending the e-mail message again later." S4="5.5.2" S6="2007"/>
								<Rule Name="fe12DSN553" Template="tDSN" Text="{4}: The number of e-mail recipients exceeds the maximum number that is allowed. The sender should reduce the number of e-mail recipients and try sending the e-mail message again." S4="5.5.3" S6="2007"/>
								<Rule Name="fe12DSN554" Template="tDSN" Text="{4}: The e-mail system issued a protocol command with invalid arguments. The sender can try sending the e-mail message again later." S4="5.5.4" S6="2007"/>
								<Rule Name="fe12DSN555" Template="tDSN" Text="{4}: The protocol versions between the sending e-mail system and recipient e-mail system do not match." S4="5.5.5" S6="2007"/>
								<Rule Name="fe12DSN556" Template="tDSN" Text="{4}: The e-mail system experienced protocol errors during delivery." S4="5.5.6" S6="2007"/>
								<Rule Name="fe12DSN560" Template="tDSN" Text="{4}: The e-mail message format was corrupted and could not be delivered. The sender should try creating a new message and sending it again." S4="5.6.0" S6="2007"/>
								<Rule Name="fe12DSN561" Template="tDSN" Text="{4}: The recipient e-mail system cannot accept the format of this e-mail message." S4="5.6.1" S6="2007"/>
								<Rule Name="fe12DSN562" Template="tDSN" Text="{4}: A processing restriction in the e-mail system prohibits the handling of this e-mail message. The sender should try creating a new message and sending it again." S4="5.6.2" S6="2007"/>
								<Rule Name="fe12DSN563" Template="tDSN" Text="{4}: This message format is not supported. The sender should try creating a new message and sending it again." S4="5.6.3" S6="2007"/>
								<Rule Name="fe12DSN564" Template="tDSN" Text="{4}: A required conversion of this message format would have caused data loss." S4="5.6.4" S6="2007"/>
								<Rule Name="fe12DSN565" Template="tDSN" Text="{4}: A failure occurred during conversion of the e-mail message format." S4="5.6.5" S6="2007"/>
								<Rule Name="fe12DSN570" Template="tDSN" Text="{4}: A security error occurred while trying to deliver your e-mail message. Security policies prohibit further explanation of this error." S4="5.7.0" S6="2007"/>
								<Rule Name="fe12DSN571" Template="tDSN" Text="{4}: The sender is not authorized to send e-mail messages to this e-mail address. Possible causes: 1)The session is not authenticated and does not have the 'ms-Exch-SMTP-Submit' permission. 2)The session is authenticated but does not have the 'ms-Exch-SMTP-Submit' permission. 3)The 'MAIL FROM' command specified an address at an authoritative domain and the session does not have the 'ms-Exch-SMTP-Accept-Authoritative-Domain-Sender' permission. 4)The authenticated user does not have permission to submit on behalf of the sender address specified in the header of the message and the session does not have the 'ms-Exch-SMTP-Accept-Any-Sender' permission. 5)The recipient domain does not match any of the accepted domains and the session does not have the 'ms-Exch-SMTP-Accept-Any-Recipient' permission. 6)The recipient domain is rejecting all mail from this server using a block list." S4="5.7.1" S6="2007"/>
								<Rule Name="fe12DSN572" Template="tDSN" Text="{4}: The sender is not authorized to send e-mail messages to this distribution list." S4="5.7.2" S6="2007"/>
								<Rule Name="fe12DSN573" Template="tDSN" Text="{4}: A required security operation could not be performed during delivery of this e-mail message. Either the credentials are incorrect, or the authenticated user does not have the 'ms-Exch-SMTP-Submit' permission. A lack of the 'Submit' permission results in an authentication failure and not an authorization failure because the server would give away information, making the SMTP server a resource for password guess attacks." S4="5.7.3" S6="2007"/>
								<Rule Name="fe12DSN574" Template="tDSN" Text="{4}: The security features that are required for delivery of this e-mail message are not supported by the recipient e-mail system." S4="5.7.4" S6="2007"/>
								<Rule Name="fe12DSN575" Template="tDSN" Text="{4}: The recipient e-mail system could not validate this e-mail message." S4="5.7.5" S6="2007"/>
								<Rule Name="fe12DSN576" Template="tDSN" Text="{4}: A failure in the recipient e-mail system's security processing prevented delivery of the e-mail message." S4="5.7.6" S6="2007"/>
								<Rule Name="fe12DSN577" Template="tDSN" Text="{4}: The e-mail message was corrupted or altered, and the recipient e-mail system that is responsible for validating or decrypting the message was unable to do so. The sender should try creating a new message and sending it again." S4="5.7.7" S6="2007"/>

								<Rule Name="fE12DSN" Query="$fe12DSN447 or $fe12DSN500 or $fe12DSN510 or $fe12DSN511 or $fe12DSN512 or $fe12DSN513 or $fe12DSN514 or $fe12DSN516 or $fe12DSN517 or $fe12DSN518 or $fe12DSN520 or $fe12DSN521 or $fe12DSN522 or $fe12DSN523 or $fe12DSN524 or $fe12DSN530 or $fe12DSN532 or $fe12DSN533 or $fe12DSN534 or $fe12DSN535 or $fe12DSN540 or $fe12DSN533 or $fe12DSN535 or $fe12DSN540 or $fe12DSN544 or $fe12DSN546 or $fe12DSN547 or $fe12DSN550 or $fe12DSN551 or $fe12DSN552 or $fe12DSN553 or $fe12DSN554 or $fe12DSN555 or $fe12DSN556 or $fe12DSN560 or $fe12DSN561 or $fe12DSN562 or $fe12DSN563 or $fe12DSN564 or $fe12DSN565 or $fe12DSN570 or $fe12DSN571 or $fe12DSN572 or $fe12DSN573 or $fe12DSN574 or $fe12DSN575 or $fe12DSN576 or $fe12DSN577"/>
								<Rule Name="fNotValidE12DSN" Query="string-length($.)=0 or not($fE12DSN)"/>
							</Setting>
						</Object>
					</Object>
					<Rule Name="fNotValidDSN" Query="$fNotValidE2KDSN or $fNotValidE12DSN" AlwaysEvaluate="True"/>
				</Object>
				<!--
				<Object Type="Control" SubType="TextBox" Name="DSNNumber" Position="NextTo" Percent="30" Default="" Display="Hide"/>
				-->

				<Object Type="Control" SubType="Link" Name="Previous" Position="LeftBelow" Text="Go Back"/>
				<Object Type="Control" SubType="Link" Name="Next" Position="NextTo" Percent="30" Text="Next"/>

			</Object>
		</Object>
	</Object>

	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="GetServerInfo" Title="Server Name and Credentials" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varDefExName%" Substitution="varDefExName" Display="Hide"/>
			<Setting Key1="%varDefDCName%" Substitution="varDefDCName" Display="Hide"/>
			<Setting Key1="%varDefExGWName%" Substitution="varDefExGWName" Display="Hide"/>
			<Setting Key1="%varDefGWName%" Substitution="varDefGWName" Display="Hide"/>
			<Setting Key1="%varDefGWSMTPPort%" Substitution="varDefGWSMTPPort" Display="Hide"/>
			<Setting Key1="%varDefTestMailAddress%" Substitution="varDefTestMailAddress" Display="Hide"/>
			<Setting Key1="%varDefTestMailFromAddress%" Substitution="varDefTestMailFromAddress" Display="Hide"/>
			<Setting Key1="%varDefOutboundSenderAddress%" Substitution="varDefOutboundSenderAddress" Display="Hide"/>
			<Setting Key1="%varDefOutboundRecipAddress%" Substitution="varDefOutboundRecipAddress" Display="Hide"/>
			<Setting Key1="%varSelSymptom%" Substitution="varSelSymptom" Display="Hide"/>
			<Setting Key1="%EDGEROLE%" Substitution="EDGEROLE" Display="Hide"/>
			<Setting Key1="%LOCALDCNAME%" Substitution="LOCALDCNAME" Display="Hide"/>
			<Setting Key1="%LOCALMACHINENAME%" Substitution="LOCALMACHINENAME" Display="Hide"/>

			<Object Type="Panel" Display="Hide" HelpId="html\1c4b9eca-4714-4a61-ba7c-91f1bf4e53fc.htm">
				<Setting Display="Hide">
					<Rule NextStep="RetrieveBasicServerData" Name="fGotoRetrieveBasicServerData" Query="not ($fInvalidDCName or $fInvalidExName or $fInvalidTestMailAddress or $fInvalidTestMailFromAddress or $fInvalidOutboundSender or $fInvalidOutboundRecipient or $fInvalidExCreds or '%varSelSymptom%'='EdgeSyncTroubleshooter')" AlwaysEvaluate="True"/>
					<Rule NextStep="FindEdgeSubscriptions" Name="fGotoFindEdgeSubscriptions" Query="not($fInvalidDCName or $fInvalidADCreds or $fInvalidEdgeCreds) and '%varSelSymptom%'='EdgeSyncTroubleshooter'" AlwaysEvaluate="True"/>
					<Rule NextStep="InputErrors" Name="fInputErrorsGetServerInfo" Query="not($fGotoRetrieveBasicServerData or $fGotoFindEdgeSubscriptions)" AlwaysEvaluate="True"/>
				</Setting>

				<Object Type="Control" SubType="Title" Name="title" Position="Top" Text="Enter Server and User Information"/>

				<!-- If the selected symptom is Inbound or Outbound, we ask more inputs such as non-exchange gateway and test mail address -->
				<Object Type="If" Name="NDR" Key1="contains('%varSelSymptom%','NDR')" Display="Hide">
					<Object Type="Control" SubType="Label" Name="NDRNoteLabel" Position="Below" Text="Please provide the name of the Exchange server generating the non-delivery report. If the non-delivery report was generated by an external server, please provide the name of the Exchange server sending messages out of the organization."/>
				</Object>
				<Object Type="If" Name="Inbound" Key1="contains('%varSelSymptom%','Inbound')" Display="Hide">
					<Object Type="Control" SubType="Label" Name="GWNotelabel" Position="Below" Text="Please provide the name of a computer running Exchange Server 2003 or Exchange 2000 Server that acts as a gateway to/from the Internet. If your gateway server is not running Exchange, please provide the name of an Exchange server that is 'closest' to the Internet-facing server. In this case, you can provide the name of your non-Exchange gateway server separately below."/>
					<Object Type="Control" SubType="Label" Name="MTlabel" Position="Below" Text="Please enable message tracking on your Exchange servers."/>
					<Object Type="Control" SubType="Link" Name="MTlink" Position="Below" Text="Tell me how to enable message tracking" URL="http://support.microsoft.com/?id=821910"/>
				</Object>
				<Object Type="If" Name="Outbound" Key1="contains('%varSelSymptom%','Outbound')" Display="Hide">
					<Object Type="Control" SubType="Label" Name="GWNotelabel" Position="Below" Text="Please provide the name of a computer running Exchange Server 2003 or Exchange 2000 Server that has mailboxes of the affected senders. Please also provide the name of the Exchange server sending messages out of the organization if it is different. If your Internet-facing gateway server is not running Exchange, you can provide its name separately below."/>
					<Object Type="Control" SubType="Label" Name="MTlabel" Position="Below" Text="Please enable message tracking on your Exchange servers."/>
					<Object Type="Control" SubType="Link" Name="MTlink" Position="Below" Text="Tell me how to enable message tracking" URL="http://support.microsoft.com/?id=821910"/>
				</Object>
				<Object Type="If" Name="Queue" Key1="contains('%varSelSymptom%','Queue')" Display="Hide">
					<Object Type="Control" SubType="Label" Name="label" Position="Below" Text="Please provide the name of a machine running Exchange Server 2003 or Exchange 2000 Server where messages are pending in queues."/>
				</Object>
				<Object Type="If" Name="MailboxSubmission" Key1="contains('%varSelSymptom%','MailboxSubmission')" Display="Hide">
					<Object Type="Control" SubType="Label" Name="label" Position="Below" Text="Please provide the name of a computer with the Mailbox server role installed where submitted messages are not being processed."/>
				</Object>
				<Object Type="If" Name="EdgeSyncTroubleshooter" Key1="'%varSelSymptom%'='EdgeSyncTroubleshooter'" Display="Hide">
					<Object Type="Control" SubType="Label" Name="label" Position="Below" Text="Please provide the following information before the tool begins the EdgeSync Troubleshooter."/>
				</Object>

				<Object Type="If" Key1="'%EDGEROLE%'='1'">
					<Setting Key1="SetMachineName">
						<Rule Name="szExNameEdge" Query="string('%LOCALMACHINENAME%')">
							<Variable Name="varExName" Scope="Children"/>
							<Variable Name="varDefExName" Scope="Global"/>
						</Rule>
					</Setting>
					<Setting Key1="SetDCName">
						<Rule Name="szDCNameEdge" Query="string('%LOCALDCNAME%')">
							<Variable Name="varDCName" Scope="Children"/>
							<Variable Name="varDefDCName" Scope="Global"/>
						</Rule>
					</Setting>
				</Object>

				<Object Type="If" Key1="'%EDGEROLE%'!='1' and not('%varSelSymptom%'='EdgeSyncTroubleshooter')">
					<Object Type="Control" SubType="Label" Name="EXLabel" Position="LeftBelow" Text="Exchange Server Name"/>
					<Object Type="Control" SubType="TextBox" Name="EXName" Position="400," Percent="40" Default="%varDefExName%" Display="Hide">
						<Setting Key1="ExName">
							<Rule Name="szExName" Query="$.">
								<Variable Name="varExName" Scope="Children"/>
								<Variable Name="varDefExName" Scope="Global"/>
							</Rule>
							<Rule Name="fSetExName" Query="regSetValue('','SOFTWARE\\Microsoft\\ExchangeServer\\v14\\ExMFA','ServerSpecified',$.)"/>
							<Rule Name="fInvalidExName" Query="string-length($.)=0" Error="Error" Text="The name of an Exchange server was not provided."/>
						</Setting>
						<Event Type="Changed">
							<Action Type="Enable" ControlName="TestMailAddress3" Query="control-value('EXName')!=''"/>
						</Event>
					</Object>
				</Object>

				<Object Type="If" Key1="'%EDGEROLE%'!='1'">
					<Object Type="Control" SubType="Label" Name="DCLabel" Position="LeftBelow" Text="Global Catalog Server Name"/>
					<Object Type="Control" SubType="TextBox" Name="DCName" Position="400," Default="%varDefDCName%" Display="Hide">
						<Setting Key1="DCName">
							<Rule Name="szDCName" Query="$.">
								<Variable Name="varDCName" Scope="Children"/>
								<Variable Name="varDefDCName" Scope="Global"/>
							</Rule>
							<Rule Name="fSetDCName" Query="($. != @S2) and regSetValue('','SOFTWARE\\Microsoft\\ExchangeServer\\v14\\ExMFA','DCSpecified',$.)" S2="%varDCName%"/>
							<Rule Name="fInvalidDCName" Query="string-length($.)=0" Error="Error" Text="The name of an Active Directory server was not provided."/>
						</Setting>
					</Object>
				</Object>

				<Object Type="If" Name="Exchange Gateway" Key1="contains('%varSelSymptom%','Outbound')" Display="Hide">
					<Object Type="Control" SubType="Label" Name="GWServerLabel" Position="LeftBelow" Text="Exchange Gateway Server Name (if different from above)"/>
					<Object Type="Control" SubType="TextBox" Name="ExGWServerName" Position="400," Default="%varDefExGWName%" Display="Hide">
						<Setting Key1="ExGWName">
							<Rule Name="szExGWName" Query="$.">
								<Variable Name="varExGWName" Scope="Children"/>
								<Variable Name="varDefExGWName" Scope="Global"/>
							</Rule>
							<Rule Name="fExGWProvided" Query="string-length($.) &gt;0" AlwaysEvaluate="True">
								<Variable Name="varExGWProvided" Scope="Children"/>
							</Rule>
							<Rule Name="fSetExGWName" Query="regSetValue('','SOFTWARE\\Microsoft\\ExchangeServer\\v14\\ExMFA','ExGatewaySpecified',$.)"/>
						</Setting>
					</Object>
				</Object>

				<Object Type="If" Name="Non-Exchange Gateway" Key1="contains('%varSelSymptom%','Inbound') or contains('%varSelSymptom%','Outbound')" Display="Hide">
					<Object Type="Control" SubType="Label" Name="GWServerLabel" Position="LeftBelow" Text="Non-Exchange Gateway Server Name (optional)"/>
					<Object Type="Control" SubType="TextBox" Name="GWServerName" Position="400," Default="%varDefGWName%" Display="Hide">
						<Setting Key1="GWName">
							<Rule Name="szGWName" Query="$.">
								<Variable Name="varGWName" Scope="Children"/>
								<Variable Name="varDefGWName" Scope="Global"/>
							</Rule>
							<Rule Name="fGWProvided" Query="string-length($.) &gt;0" AlwaysEvaluate="True">
								<Variable Name="varGWProvided" Scope="Children"/>
							</Rule>
							<Rule Name="fSetGWName" Query="regSetValue('','SOFTWARE\\Microsoft\\ExchangeServer\\v14\\ExMFA','GatewaySpecified',$.)"/>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Label" Name="GWSMTPPortLabel" Position="LeftBelow" Text="Non-Exchange Gateway Server SMTP Port (optional)"/>
					<Object Type="Control" SubType="TextBox" Name="GWSMTPPort" Position="At(GWServerName)," Width="45" Default="%varDefGWSMTPPort%" Display="Hide">
						<Setting Key1="GWSMTPPort">
							<Rule Name="iGWSMTPPort" Query="$.">
								<Variable Name="varGWSMTPPort" Scope="Children"/>
								<Variable Name="varDefGWSMTPPort" Scope="Global"/>
							</Rule>
							<Rule Name="fSetGWSMTPPort" Query="regSetValue('','SOFTWARE\\Microsoft\\ExchangeServer\\v14\\ExMFA','GatewaySMTPPort',$.)"/>
						</Setting>
					</Object>
				</Object>

				<Object Type="If" Name="Get Edge Credentials" Key1="'%varSelSymptom%'='EdgeSyncTroubleshooter'" Display="Hide">
					<Object Type="Control" SubType="GradiatedBox" Name="MidLine1" Position="LeftBelow"/>
					<Object Type="Control" SubType="ShowHide" Name="ShowHideCreds1" Position="Below" Text="Show advanced Active Directory login options,Hide advanced Active Directory login options">
						<Object Type="Control" SubType="Label" Name="EXLabel1" Position="TopNoBorder" Text="If your current credentials do not have sufficient permission to read Active Directory configuration information, enter alternate credentials below."/>
						<Object Type="Credentials" Name="EXLOGON" Position="Below" Key1="385">
							<Rule Name="fInvalidADCreds" Query="not(validate-credentials('EXLOGON'))" Error="Error" Text="The account credentials provided for Active Directory are invalid.  Please enter the credentials again."/>
						</Object>
					</Object>

					<Object Type="Control" SubType="Label" Name="SpaceLabel2" Position="LeftBelow" Text=""/>
					<Object Type="Control" SubType="GradiatedBox" Name="MidLine3" Position="LeftBelow"/>
					<Object Type="Control" SubType="ShowHide" Name="ShowHideCreds2" Position="Below" Text="Show advanced Edge Server login options,Hide advanced Edge Server login options">
						<Object Type="Control" SubType="Label" Name="EXLabel2" Position="TopNoBorder" Text="If your current credentials do not have sufficient permission to read Edge server configuration information, enter alternate credentials below."/>
						<Object Type="Credentials" Name="EDGELOGON" Position="Below" Key1="385">
							<Rule Name="fInvalidEdgeCreds" Query="not(validate-credentials('EXLOGON'))" Error="Error" Text="The account credentials provided for Edge Server are invalid.  Please enter the credentials again."/>
						</Object>
					</Object>
					<Object Type="Control" SubType="GradiatedBox" Name="MidLine4" Position="Below"/>
				</Object>

				<Object Type="If" Name="Get AD/Exchange Server Credentials" Key1="not('%varSelSymptom%'='EdgeSyncTroubleshooter')" Display="Hide">
					<Object Type="Control" SubType="GradiatedBox" Name="MidLine1" Position="LeftBelow"/>
					<Object Type="Control" SubType="ShowHide" Name="ShowHideCreds" Position="Below" Text="Show advanced login options,Hide advanced login options">
						<Object Type="Control" SubType="Label" Name="EXLabel" Position="TopNoBorder" Text="If your current credentials do not have sufficient permission to read Exchange server configuration information, enter alternate credentials below."/>
						<Object Type="Credentials" Name="EXLOGON" Position="Below" Key1="385">
							<Rule Name="fInvalidExCreds" Query="not(validate-credentials('EXLOGON'))" Error="Error" Text="The account credentials provided for Exchange and Active Directory are invalid.  Please enter the credentials again."/>
						</Object>
					</Object>
					<Object Type="Control" SubType="GradiatedBox" Name="MidLine2" Position="Below"/>
				</Object>

				<Object Type="If" Name="NeedTestMailAddress" Key1="contains('%varSelSymptom%','Inbound')" Display="Hide">
					<Setting Key1="string(@S1)" S1="directory-lookup(concat('LDAP://', directory-lookup('LDAP://rootDSE', '(objectClass=*)', 'Base', 'configurationNamingContext')), concat('(&amp;(objectCategory=msExchExchangeServer)(cn=', '%varDefExName%', '))'), 'Subtree', 'distinguishedName')" Substitution="SERVERLOOKUP"/>
					<Setting Key1="'%varDefExName%'!=''" Substitution="SERVERSET"/>

					<Object Type="Control" SubType="Label" Name="TestMailAddressLabel" Position="LeftBelow" Text="Recipient address to use for delivery tests (optional)"/>
					<Object Type="Control" SubType="TextBox" Name="TestMailAddress" Position="400," Width="240" Default="%varDefTestMailAddress%" Display="Hide">
						<Setting Key1="TestMailAddress">
							<Rule Name="szTestMailAddress" Query="$.">
								<Variable Name="varTestMailAddress" Scope="Children"/>
								<Variable Name="varDefTestMailAddress" Scope="Global"/>
							</Rule>
							<Rule Name="fInvalidTestMailAddress" Query="not(matches($.,'^(.+@.+)?$'))" Error="Error" Text="The recipient mail address is invalid. The address should be of the form user@domain."/>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Button" Name="TestMailAddress3" Width="140" Position="NextTo" Text="Use system account" Flags="Enabled=%SERVERSET%">
						<Event Type="Click">
							<Action Type="ExecuteQuery" ControlName="TestMailAddress3" Query="control-value('TestMailAddress', directory-lookup(concat('LDAP://CN=Microsoft System Attendant,', %SERVERLOOKUP%), '(objectClass=*)', 'Base', 'mail'))"/>
						</Event>
					</Object>
					<Object Type="Control" SubType="Label" Name="NoteMailAddress" Position="LeftBelow" Text="(You can leave it blank if you want to use the Postmaster or System Attendant account. If you know that a specific account is having mail flow problems, it is better to use the account for more effective diagnostics.)"/>

					<Object Type="Control" SubType="Label" Name="TestMailFromAddressLabel" Position="LeftBelow" Text="Sender address to use for delivery tests"/>
					<Object Type="Control" SubType="TextBox" Name="TestMailFromAddress" Position="400," Width="240" Default="%varDefTestMailFromAddress%" Display="Hide">
						<Setting Key1="TestMailFromAddress">
							<Rule Name="szTestMailFromAddress" Query="$.">
								<Variable Name="varTestMailFromAddress" Scope="Children"/>
								<Variable Name="varDefTestMailFromAddress" Scope="Global"/>
							</Rule>
							<Rule Name="fInvalidTestMailFromAddress" Query="not(matches($.,'^.+@.+$'))" Error="Error" Text="The sender mail address is invalid. The address should be of the form user@domain."/>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Label" Name="NoteMailFromAddress" Position="LeftBelow" Text="(If the servers are validating the senders, you may need to use a mail address that you have send rights for.)"/>
				</Object>

				<Object Type="If" Name="NeedMailInfo" Key1="contains('%varSelSymptom%','Outbound')" Display="Hide">
					<Object Type="Control" SubType="Label" Name="NoteMailInfo" Position="LeftBelow" Text="Please provide the address of the sender and recipient of one of the messages that encountered this symptom."/>
					<Object Type="Control" SubType="Label" Name="SenderLabel" Position="LeftBelow" Text="Sender SMTP address (Example: user@yourorg.com)"/>
					<Object Type="Control" SubType="TextBox" Name="OutboundSenderAddress" Position="400," Default="%varDefOutboundSenderAddress%" Display="Hide">
						<Setting Key1="OutboundSenderAddress">
							<Rule Name="szOutboundSenderAddress" Query="$.">
								<Variable Name="varOutboundSenderAddress" Scope="Children"/>
								<Variable Name="varDefOutboundSenderAddress" Scope="Global"/>
							</Rule>
							<Rule Name="fInvalidOutboundSender" Query="not(matches($.,'^.+@.+$'))" Error="Error" Text="The sender mail address is invalid. The address should be of the form user@domain."/>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Label" Name="RecipientLabel" Position="LeftBelow" Text="Recipient SMTP address (Example: user@theirorg.com)"/>
					<Object Type="Control" SubType="TextBox" Name="OutboundRecipAddress" Position="At(OutboundSenderAddress)," Default="%varDefOutboundRecipAddress%" Display="Hide">
						<Setting Key1="OutboundRecipAddress">
							<Rule Name="szOutboundRecipAddress" Query="$.">
								<Variable Name="varOutboundRecipAddress" Scope="Children"/>
								<Variable Name="varDefOutboundRecipAddress" Scope="Global"/>
							</Rule>
							<Rule Name="fInvalidOutboundRecipient" Query="not(matches($.,'^.+@.+$'))" Error="Error" Text="The recipient mail address is invalid. The address should be of the form user@domain."/>
						</Setting>
					</Object>
				</Object>

				<Object Type="If" Name="QueueTestMailFromAddress" Key1="contains('%varSelSymptom%','Queue')" Display="Hide">
					<Setting Key1="'%varDefTestMailFromAddress%'">
						<Rule Name="szQueueTestMailFromAddress" Query="$.">
							<Variable Name="varTestMailFromAddress" Scope="Children"/>
						</Rule>
					</Setting>
				</Object>

				<Object Type="Control" SubType="Link" Name="Previous" Position="LeftBelow" Text="Go Back"/>
				<Object Type="Control" SubType="Link" Name="Next" Position="400," Text="Next"/>
			</Object>
			<Rule Name="szGetServerInfo" Query="'GetServerInfo'">
				<Variable Name="varPreviousName" Scope="Children"/>
			</Rule>
		</Object>
	</Object>

	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RetrieveBasicServerData" Title="Retrieving Basic Server Data" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varTestMailAddress%" Substitution="varTestMailAddress" Display="Hide"/>
			<Setting Key1="%varTestMailFromAddress%" Substitution="varTestMailFromAddress" Display="Hide"/>
			<Setting Key1="%varSelSymptom%" Substitution="varSelSymptom" Display="Hide"/>
			<Setting Key1="%EDGEROLE%" Substitution="EDGEROLE" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Retrieving Information about Exchange Server" Text="Please wait while the tool attempts to retrieve basic information about server {2} from the Active Directory and Windows Management Instrumentation (WMI)." S2="%varExName%" HelpId="html\1c4b9eca-4714-4a61-ba7c-91f1bf4e53fc.htm">
				<Object Type="Group" Name="Basic Server Information" Class="Area" GroupingClass="True" Display="Hide">
					<!-- We try to get the basic info about the Exchange server so that we do not have to do it again in the child steps -->
					<Object Type="Directory" Name="cn" Key1="LDAP://%varDCName%/" SecurityContext="EXLOGON">
						<Rule Name="fFatalDirectoryError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error accessing Active Directory" Text="Unable to query the directory on server {2}. {1}" P1="../Exception/@Message" S2="%varDCName%" GUID="b15f87cc-938a-48f8-a14e-24ce1aef5b61" AlwaysEvaluate="True"/>

						<Setting Key1="RootDomainNamingContext" Substitution="ROOTDOMAINDN">
							<Rule Name="szRootDomainDN" Query="$.">
								<Variable Name="varRootDomainDN" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="configurationNamingContext" Substitution="CONFIGDN">
							<Rule Name="szConfigDN" Query="$.">
								<Variable Name="varConfigDN" Scope="Children"/>
							</Rule>
						</Setting>
						<Object Type="Resolve" Name="Server Name" Key1="%varExName%">
							<Setting Key1="Dns" Substitution="RESOLVEDEXNAME" Format="\..*----">
								<Rule Name="fResolveExNameFailed" Query="lower-case($.)!=lower-case(@S2) and lower-case($.)!=lower-case($szExNetBIOSName)" Error="Warning" Sev="1" Title="DNS name resolution failure" Text="DNS name resolution failed for server {2}. Check your DNS configuration or ensure that the name of the server is correct." S2="%varExName%" GUID="c1e33f44-aa05-40be-9167-4f19f2ff0908"/>
							</Setting>
							<Setting Key1="Dns" Substitution="RESOLVEDEXFQDN">
								<Rule Name="szResolvedExFQDN" Query="$."/>
							</Setting>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Microsoft Exchange,cn=Services,%CONFIGDN%">
								<Rule Name="fDirectoryExContainerError" Query="../Exception/@Message or ../Instance/Object/Exception/@Message or $fNoSuchExchangeFound" Error="Error" Sev="1" Title="Error retrieving information from Active Directory" Text="Unable to retrieve server information from Active Directory. User credentials may be incorrect, or server {2} may not be running Exchange server." S2="%varExName%" GUID="f1915b91-0f56-4272-9c24-4914daa8a944" AlwaysEvaluate="True"/>
								<Setting Key1="distinguishedName" Substitution="DN"/>
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%DN%" Key3="objectClass=msExchOrganizationContainer" Key4="OneLevel">
									<Setting Key1="distinguishedName">
										<Rule Name="szExOrgDN" Query="$.">
											<Variable Name="varExOrgDN" Scope="Children"/>
										</Rule>
									</Setting>
								</Object>
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%DN%" Key3="(&amp;(objectCategory=msExchExchangeServer)(|(cn=%RESOLVEDEXNAME%)(cn=%varExName%)))" Class="Server" GroupingClass="True">
									<Rule Name="fNoSuchExchangeFound" Query="count(../Instance)=0"/>
									<Setting Key1="distinguishedName" Substitution="DN">
										<Rule Name="szExDN" Query="$.">
											<Variable Name="varExDN" Scope="Children"/>
										</Rule>
									</Setting>
									<Setting Key1="networkAddress">
										<Rule Name="szExFQDN" Query="substring-after($.[contains(.,'ncacn_ip_tcp')],':')" Error="None" Title="Server fully-qualified domain name (FQDN)" Text="The fully-qualified domain name (FQDN) of server {2} is {1}." P1="substring-after($.[contains(.,'ncacn_ip_tcp')],':')" P2="$szExNetBIOSName">
											<Variable Name="varExFQDN" Scope="Children"/>
										</Rule>
										<Rule Name="szExNetBIOSName" Query="substring-before($szExFQDN,'.')">
											<Variable Name="varExName" Scope="Children"/>
											<Variable Name="varMsgTrackExName" Scope="Children"/>
										</Rule>
									</Setting>
									<Setting Key1="messageTrackingEnabled" Display="Hide">
										<Rule Name="fMessageTrackingEnabled" Query="not ($fExchange2007orLater) and upper-case($.)='TRUE'" Error="None" Title="Message tracking enabled" Text="Message tracking is enabled on server {2}." P2="$szExNetBIOSName"/>
										<Rule Name="fMessageTrackingDisabled" Query="not ($fExchange2007orLater) and upper-case($.)!='TRUE' and @S1='Inbound'" Error="Error" Sev="1" Title="Message tracking disabled" Text="Message tracking is disabled on server {2}. It needs to be enabled to conduct mail flow tests." S1="%varSelSymptom%" P2="$szExNetBIOSName" GUID="296c5b3e-a7f1-49bf-a618-c232ba081f06"/>
									</Setting>
									<Setting Key1="serialNumber" Substitution="EXVERSION">
										<Rule Name="fExchange200x" Query="contains ($., 'Version 6')">
											<Variable Name="varIsExchange2000or2003" Scope="Children"/>
										</Rule>
										<Rule Name="fExchange2003" Query="contains ($., 'Version 6.5')" Error="None" Title="Exchange Server 2003 installed" Text="Server {2} is running Exchange Server 2003." P2="$szExNetBIOSName">
											<Variable Name="varIsExchange2003" Scope="Children"/>
										</Rule>
										<Rule Name="fExchange2000" Query="contains ($., 'Version 6.0')" Error="None" Title="Exchange 2000 Server installed" Text="Server {2} is running Exchange 2000 Server." P2="$szExNetBIOSName">
											<Variable Name="varIsExchange2000" Scope="Children"/>
										</Rule>
										<Rule Name="fExchange55" Query="contains ($., 'Version 5.5')" Error="Error" Sev="1" Title="Exchange Server 5.5 detected" Text="Server {2} is running Exchange Server 5.5. This tool supports only Exchange 2000 Server and Exchange Server 2003." P2="$szExNetBIOSName" GUID="6029ef51-141d-4e76-bda2-2e50dfcc0289"/>
										<Rule Name="fExchange2003SP2" Query="$fExchange2003 and contains ($., 'Service Pack 2')" Error="None" Title="Exchange Server 2003 SP2 installed" Text="Server {2} has Exchange Server 2003 Service Pack 2 installed." P2="$szExNetBIOSName">
											<Variable Name="varIsExchange2003SP2" Scope="Children"/>
										</Rule>
										<Rule Name="fExchange2003SP1" Query="$fExchange2003 and contains ($., 'Service Pack 1')" Error="None" Title="Exchange Server 2003 SP1 installed" Text="Server {2} has Exchange Server 2003 Service Pack 1 installed." P2="$szExNetBIOSName"/>
										<Rule Name="fExchange2003SPn" Query="$fExchange2003 and contains ($., 'Service Pack')"/>
										<Rule Name="fExchange12" Query="contains ($., 'Version 8')" Error="None" Title="Exchange Server 2007 installed" Text="Server {2} is running Exchange Server 2007." P2="$szExNetBIOSName">
											<Variable Name="varIsExchange12" Scope="Children"/>
										</Rule>
										<Rule Name="fExchange12SP1" Query="contains ($., 'Version 8.1')" Error="None" Title="Exchange Server 2007 SP1 installed" Text="Server {2} is running Exchange Server 2007 Service Pack 1." P2="$szExNetBIOSName">
											<Variable Name="varIsExchange12SP1" Scope="Children"/>
										</Rule>
										<Rule Name="fExchange14" Query="contains ($., 'Version 14')"/>
										<Rule Name="fExchange2007orLater" Query="$fExchange12 or $fExchange14">
											<Variable Name="varIsExchange2007orLater" Scope="Children"/>
										</Rule>
									</Setting>
									<Setting Key1="versionNumber">
										<Rule Name="iExVersionNumber" Query="$.">
											<Variable Name="varExVersionNumber" Scope="Children"/>
										</Rule>
									</Setting>
									<Object Type="Group" Name="Server Up Test">
										<Setting Key1="Server Rule">
											<Rule Name="fExConnectRegError" Query="$fFatalRegistyError" Error="Error" Sev="1" Title="Registry cannot be accessed" Text="Cannot connect to the registry on server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="$szExConnectRegException" P2="$szExNetBIOSName" GUID="fa727882-9fdd-4664-9d49-f0ef95193b49" AlwaysEvaluate="True"/>
											<Rule Name="fExConnectWMIError" Query="not ($fExWinVerNT4) and ($fFatalWMIOpError or ($fFatalWMIVolumeError and $fExWinVer2003) or $fFatalWMILogicalError)" Error="Error" Sev="2" Title="WMI cannot be accessed" Text="Cannot connect to the Windows Management Instrumentation (WMI) repository on server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="$szExConnectWMIException" P2="$szExNetBIOSName" GUID="18814786-c925-4ea8-bcd5-2d57174f326f" AlwaysEvaluate="True"/>
											<Rule Name="fExConnectDirectorySMTPError" Query="not ($fExWinVerNT4) and $fFatalDirectorySMTPError" Error="Error" Sev="2" Title="Directory data cannot be accessed" Text="Cannot collect directory data from server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="$szExConnectDirectorySMTPException" S2="%varDCName%" GUID="b15f87cc-938a-48f8-a14e-24ce1aef5b61" AlwaysEvaluate="True"/>
											<Rule Name="fExConnectMetabaseError" Query="not ($fExWinVerNT4) and $fFatalMetabaseError" Error="Error" Sev="2" Title="Metabase cannot be accessed" Text="Cannot connect to the metabase on server {2}. This could be the result of a network or permissions problem. Also, ensure that IIS Common component is installed on workstation. Error: {1}" P1="$szExConnectMetabaseException" P2="$szExNetBIOSName" GUID="4f64e3b8-b1ba-4353-af48-cbf396a026ee" AlwaysEvaluate="True"/>
											<Rule Name="szExConnectWMIException" Query="if ($fFatalWMIOpError, $szExConnectWMIOpException, if ($fFatalWMIVolumeError and $fExWinVer2003, $szExConnectWMIVolumeException, $szExConnectWMILogicalException))" AlwaysEvaluate="True"/>
											<Rule Name="fClusterServiceRunning" Query="$fClusterServiceRunningKey" AlwaysEvaluate="True">
												<Variable Name="varClusterServiceRunning" Scope="Children"/>
											</Rule>
										</Setting>
									</Object>
									<Object Type="Registry" Key1="%varExName%" Key3="Software\Microsoft\Windows NT\CurrentVersion">
										<Rule Name="szExConnectRegException" Query="../Exception/@Message"/>
										<Rule Name="fFatalRegistyError" Query="../Exception/@Message"/>
										<Setting Key1="CurrentVersion">
											<Rule Name="fExWinVer2000" Query="$.='5.0'"/>
											<Rule Name="fExWinVer2003" Query="$.='5.2'"/>
											<Rule Name="fExWinVer2008" Query="$.='6.0'"/>
											<!--Add Rule fExchange12SP1 on LH Server to be used in IPV6 logic-->
											<Rule Name="fExchangeIPv6Capable" Query="$fExWinVer2008 and ($fExchange12SP1 or $fExchange14)" Error="None" Title="Server is IPv6 Capable" Text="Windows Server and Exchange Server are both capable of supporting Internet Protocol Version 6 (IPv6) addresses on server {2}." P2="$szExNetBIOSName" AlwaysEvaluate="True">
												<Variable Name="varExchangeIPv6Capable" Scope="Children"/>
											</Rule>
											<Rule Name="fExWinVerNT4" Query="$.='4.0'" Error="None" Title="Exchange is running on Windows NT 4.0 Server" Text="Server {2} is running Windows NT 4.0 Server." P2="$szExNetBIOSName"/>
										</Setting>
									</Object>
									<Object Type="WMI" Key1="%varExName%" Key3="Win32_OperatingSystem" Key5="*">
										<Rule Name="szExConnectWMIOpException" Query="../Exception/@Message"/>
										<Rule Name="fFatalWMIOpError" Query="../Exception/@Message"/>
										<Setting Key1="OSProductSuite">
											<Rule Name="fWin2008Dtc" Query="$fExWinVer2008 and bitwise-and($.,128)" Error="None" Title="Windows Server 2008 Datacenter Edition" Text="Server {2} is running Windows Server 2008 Datacenter Edition." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2008Ent" Query="$fExWinVer2008 and bitwise-and($.,2)" Error="None" Title="Windows Server 2008 Enterprise Edition" Text="Server {2} is running Windows Server 2008 Enterprise Edition." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2008Sbs" Query="$fExWinVer2008 and bitwise-and($.,1)" Error="None" Title="Windows Server 2008 Small Business Edition" Text="Server {2} is running Windows Server 2008 Small Business Edition." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2008Std" Query="$fExWinVer2008 and not (bitwise-and($.,2)) and not (bitwise-and($.,1))" Error="None" Title="Windows Server 2008 Standard Edition" Text="Server {2} is running Windows Server 2008 Standard Edition." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2003Dtc" Query="$fExWinVer2003 and bitwise-and($.,128)" Error="None" Title="Windows Server 2003 Datacenter Edition" Text="Server {2} is running Windows Server 2003 Datacenter Edition." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2003Ent" Query="$fExWinVer2003 and bitwise-and($.,2)" Error="None" Title="Windows Server 2003 Enterprise Edition" Text="Server {2} is running Windows Server 2003 Enterprise Edition." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2003Sbs" Query="$fExWinVer2003 and bitwise-and($.,1)" Error="None" Title="Windows Server 2003 Small Business Edition" Text="Server {2} is running Windows Server 2003 Small Business Edition." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2003Std" Query="$fExWinVer2003 and not (bitwise-and($.,2)) and not (bitwise-and($.,1))" Error="None" Title="Windows Server 2003 Standard Edition" Text="Server {2} is running Windows Server 2003 Standard Edition." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2000Dtc" Query="$fExWinVer2000 and bitwise-and($.,128)" Error="None" Title="Windows 2000 Datacenter Server" Text="Server {2} is running Windows 2000 Datacenter Server." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2000Adv" Query="$fExWinVer2000 and bitwise-and($.,2)" Error="None" Title="Windows 2000 Advanced Server" Text="Server {2} is running Windows 2000 Advanced Server." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2000Sbs" Query="$fExWinVer2000 and bitwise-and($.,1)" Error="None" Title="Windows 2000 Small Business Server" Text="Server {2} is running Windows 2000 Small Business Server." P2="$szExNetBIOSName"/>
											<Rule Name="fWin2000Std" Query="$fExWinVer2000 and not (bitwise-and($.,2)) and not (bitwise-and($.,1))" Error="None" Title="Windows 2000 Server Standard Edition" Text="Server {2} is running Windows 2000 Server Standard Edition." P2="$szExNetBIOSName"/>
										</Setting>
									</Object>
									<!-- Let's check if this is a cluster or not -->
									<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='ClusSvc'">
										<Setting Key1="StartName"/>
										<Setting Key1="Started">
											<Rule Name="iStatExchangeCluster" Query="count($.)"/>
											<Rule Name="fClusterServiceRunningKey" Query="$.='True'" Error="None" Title="Exchange cluster server" Text="Server {2} is a node of an Exchange server cluster." P2="$szExNetBIOSName"/>
										</Setting>
									</Object>
									<Object Type="Group" Name="Server Hardware Configuration">
										<!-- We need an array of logical drives including mount points and get them both from Win32_Volume (can be used against W2K3 detecting mount points) and Win32_LogicalDisk (can be used against W2K) -->
										<Object Type="WMI" Key1="%varExName%" Key3="Win32_Volume">
											<Rule Name="szExConnectWMIVolumeException" Query="../Exception/@Message"/>
											<Rule Name="fFatalWMIVolumeError" Query="../Exception/@Message"/>
											<Setting Key1="Name">
												<Rule Name="szVolume" Query="substring($.,1,string-length($.)-1)"/>
											</Setting>
										</Object>
										<Object Type="WMI" Key1="%varExName%" Key3="Win32_LogicalDisk">
											<Rule Name="szExConnectWMILogicalException" Query="../Exception/@Message"/>
											<Rule Name="fFatalWMILogicalError" Query="../Exception/@Message"/>
											<Setting Key1="Name">
												<Rule Name="szLogicalDisk" Query="$."/>
											</Setting>
										</Object>

										<Object Type="WMI" Key1="%varExName%" Key3="Win32_ComputerSystem" Key5="*">
											<Setting Key1="Manufacturer"/>
											<Setting Key1="Model"/>
											<Setting Key1="NumberOfProcessors"/>
											<Setting Key1="SystemType"/>
											<Setting Key1="TotalPhysicalMemory"/>
											<Setting Key1="PartOfDomain"/>
											<Setting Key1="Domain"/>
											<Setting Key1="DomainRole"/>
										</Object>

										<Object Type="WMI" Key1="%varExName%" Key3="Win32_NetworkAdapterConfiguration" Key4="IPEnabled='TRUE'">
											<Setting Key1="Caption">
												<Rule Name="szAdapterCaption" Query="$."/>
											</Setting>
											<Setting Key1="DHCPEnabled">
												<Rule Name="fDHCPEnabled" Query="$.='True'"/>
											</Setting>
											<Setting Key1="DNSDomain"/>
											<Setting Key1="DNSDomainSuffixSearchOrder"/>
											<Setting Key1="DNSServerSearchOrder">
												<Rule Name="fAdapterDnsServerIpv4" Query="matches($.,'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')"/>
												<Rule Name="fDNSServerSearchOrderValid" Query="if($fDHCPEnabled,true(),$fAdapterDnsServerIpv4)" AlwaysEvaluate="True"/>
											</Setting>
											<Setting Key1="DomainDNSRegistrationEnabled"/>
											<Setting Key1="FullDNSRegistrationEnabled"/>
											<Setting Key1="IPConnectionMetric"/>
											<Setting Key1="IPFilterSecurityEnabled"/>
											<Setting Key1="IPAddress">
												<Rule Name="szAdapterIpv6local" Query="$.[matches(.,'fe[0-9a-fA-F]{0,2}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}')]"/>
												<Rule Name="fAdapterIpv6LocalNotSupported" Query="string-length($szAdapterIpv6local) &gt; 0 and not($fExchangeIPv6Capable)" Error="Warning" Sev="1" Title="IPv6 Protocol Not Supported" Text="Exchange Server is not capable of supporting Internet Protocol Version 6 (IPv6) addresses on server {2}.  The IPv6 link-local address '{0}' was found on the adapter '{5}'." P0="$szAdapterIpv6local" P2="$szExNetBIOSName" P5="$szAdapterCaption" AlwaysEvaluate="True"/>
												<Rule Name="szAdapterIpv6global" Query="$.[matches(.,'\d{1,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}')]"/>
												<Rule Name="fAdapterIpv6GlobalNotSupported" Query="string-length($szAdapterIpv6global) &gt; 0 and not($fExchangeIPv6Capable)" Error="Warning" Sev="1" Title="IPv6 Protocol Not Supported" Text="Exchange Server is not capable of supporting Internet Protocol Version 6 (IPv6) addresses on server {2}.  The IPv6 global address '{0}' was found on the adapter '{5}'." P0="$szAdapterIpv6global" P2="$szExNetBIOSName" P5="$szAdapterCaption" AlwaysEvaluate="True"/>
											</Setting>
											<Setting Key1="IPConnectionMetric"/>
											<Setting Key1="IPSecPermitIPProtocols"/>
											<Setting Key1="IPSecPermitTCPPorts"/>
											<Setting Key1="IPSecPermitUDPPorts"/>
											<Setting Key1="IPSubnet">
												<Rule Name="fAdapterIpv6Subnet" Query="$.[.='64']"/>
												<Rule Name="fAdapterIPv6AddressNotSupported" Query="not($fExchangeIPv6Capable) and $fAdapterIpv6Subnet" Error="Warning" Sev="1" Title="Network Adapter IPv6 Address Not Supported" Text="Exchange Server is not capable of supporting Internet Protocol Version 6 (IPv6) addresses on server {2}.  An IPv6 address was found on adapter '{5}'." P2="$szExNetBIOSName" P5="$szAdapterCaption" AlwaysEvaluate="True"/>
											</Setting>
											<Setting Key1="MACAddress" Substitution="MACADDRESS"/>
											<Setting Key1="SettingID">
												<Rule Name="szE12PossibleAdapterGuid" Query="if($fDNSServerSearchOrderValid,substring-before(substring-after($.,'{'),'}'))" AlwaysEvaluate="True"/>
											</Setting>
											<Object Type="WMI" Key1="%varExName%" Key3="Win32_NetworkAdapter" Key4="MACADDRESS='%MACADDRESS%'" Key5="*">
												<Setting Key1="AdapterType"/>
												<Setting Key1="NetConnectionID"/>
												<Setting Key1="TimeOfLastReset"/>
											</Object>
											<Rule Name="szAllE12PossibleAdapterGuids" Query="pack($szE12PossibleAdapterGuid)" AlwaysEvaluate="True">
												<Variable Name="varAllE12PossibleAdapterGuids" Scope="Children"/>
											</Rule>
										</Object>
									</Object>

									<!--Start Exchange 2007 Information-->
									<Object Type="If" Name="Exchange Server 2007 Information" Key1="contains ('%EXVERSION%', 'Version 8') or contains ('%EXVERSION%', 'Version 14')">
										<Setting Key1="true()">
											<Rule Name="szE12RCPTAddress" Query="slice(join(',', $szE12TestRCPTAddress), ',' , 0)">
												<Variable Name="varRCPTAddress" Scope="Children"/>
											</Rule>
											<Rule Name="szAllE12ConcatRCPTAddressServerBindingList" Query="pack($szE12ConcatRCPTAddressServerBindingList)">
												<Variable Name="varAllConcatRCPTAddressServerBindingList" Scope="Children"/>
											</Rule>
											<Rule Name="szAllE12SMTPLogicalDisks" Query="pack($szE12SMTPLogicalDisks)">
												<Variable Name="varAllSMTPLogicalDisks" Scope="Children"/>
											</Rule>
											<Rule Name="szAllE12SMTPInstanceName" Query="pack($szReceiveConnectorName)">
												<Variable Name="varAllSMTPInstanceName" Scope="Children"/>
											</Rule>
											<Rule Name="szAllE12SMTPInstance" Query="pack($szReceiveConnectorName)">
												<Variable Name="varAllSMTPInstance" Scope="Children"/>
											</Rule>
											<Rule Name="szAllE12SMTPInstanceFQDN" Query="pack($szE12SMTPInstanceFQDN)">
												<Variable Name="varAllSMTPInstanceFQDN" Scope="Children"/>
											</Rule>
										</Setting>
										<Setting Key1="if(not('%EDGEROLE%'='1'),'-DomainController %varDCName%','')" Substitution="MONADDCPARAMETER">
											<Rule Name="szMonadDomainControllerParameter" Query="$.">
												<Variable Name="varMonadDCParameter" Scope="Global"/>
											</Rule>
										</Setting>
										<Object Type="MonadCommand" Name="Identity" Key1="get-ExchangeServer -Identity %varExName% -status %MONADDCPARAMETER%">
											<Setting Key1="IsHubTransportServer">
												<Rule Name="fIsHubTransportServer" Query="upper-case($.)='TRUE'">
													<Variable Name="varIsHubTransportServer" Scope="Children"/>
												</Rule>
											</Setting>
											<Setting Key1="IsClientAccessServer">
												<Rule Name="fIsClientAccessServer" Query="upper-case($.)='TRUE'">
													<Variable Name="varIsClientAccessServer" Scope="Children"/>
												</Rule>
											</Setting>
											<Setting Key1="IsEdgeServer">
												<Rule Name="fIsEdgeServer" Query="upper-case($.)='TRUE'">
													<Variable Name="varIsEdgeServer" Scope="Children"/>
												</Rule>
											</Setting>
											<Setting Key1="IsMailboxServer">
												<Rule Name="fIsMailboxServer" Query="upper-case($.)='TRUE'">
													<Variable Name="varIsMailboxServer" Scope="Children"/>
												</Rule>
											</Setting>
											<Setting Key1="IsUnifiedMessagingServer">
												<Rule Name="fIsUnifiedMessagingServer" Query="upper-case($.)='TRUE'">
													<Variable Name="varIsUnifiedMessagingServer" Scope="Children"/>
												</Rule>
											</Setting>
											<Setting Key1="IsMemberOfCluster">
												<Rule Name="fIsMemberOfCluster" Query="upper-case($.)='YES'">
													<Variable Name="varIsMemberOfCluster" Scope="Children"/>
												</Rule>
											</Setting>
											<Setting Key1="Site">
												<Rule Name="szSiteIdentity" Query="$." Error="None" Title="Active Directory site" Text="'{3}' is in the '{2}' Active Directory site." P2="$." S3="%varExName%">
													<Variable Name="varSiteIdentity" Scope="Children"/>
												</Rule>
											</Setting>
											<Setting Key1="Site.ObjectGuid">
												<Rule Name="szSiteGuid" Query="$.">
													<Variable Name="varSiteGuid" Scope="Children"/>
												</Rule>
											</Setting>
											<Setting Key1="CurrentConfigDomainController">
												<Rule Name="fCurrentConfigDomainController" Query="$." Error="None" Title="Current Configuration Domain Controller" Text="'{3}' is using '{2}' as the domain controller for configuration data." P2="$." S3="%varExName%">
													<Variable Name="varCurrentConfigDomainController" Scope="Children"/>
												</Rule>
											</Setting>
											<Setting Key1="CurrentDomainControllers"/>
											<Setting Key1="CurrentGlobalCatalogs"/>
											<Setting Key1="StaticDomainControllers"/>
											<Setting Key1="StaticGlobalCatalogs"/>
											<Setting Key1="StaticConfigDomainController"/>
											<Setting Key1="StaticExcludedDomainControllers"/>
											<Setting Key1="WhenChanged"/>
											<Setting Key1="OriginatingServer"/>
										</Object>
										<Object Type="Directory" Key1="GC://%varDCName%/" Key2="%ROOTDOMAINDN%" Key3="(&amp;(objectCategory=computer)(ServicePrincipalName=SMTPSVC/%RESOLVEDEXFQDN%))" Key4="Subtree">
											<Setting Key1="ServicePrincipalName"/>
											<Rule Name="fSmtpSvcSpnNotFound" Query="count(../Instance)=0 and $fIsHubTransportServer" Error="Error" ReportIssue="RootCause" Sev="1" Title="Computer account for '{3}' not found in Active Directory" Text="No computer account in Active Directory has '{5}' set to '{3}'. This will result in Kerberos authentication failures when server {1} attempts to create an SMTP connection to another Hub Transport server." S1="%varExName%" S3="SMTPSVC/%RESOLVEDEXFQDN%" S5="ServicePrincipalName"/>
											<Rule Name="fMultipleSmtpSvcSpnSpnFound" Query="count(../Instance)&gt;1 and $fIsHubTransportServer" Error="Error" ReportIssue="RootCause" Sev="1" Title="More than one computer account for '{3}' found in Active Directory" Text="More than one computer account in Active Directory has '{5}' set to '{3}'. This will result in Kerberos authentication failures when server {1} attempts to create an SMTP connection to another Hub Transport server." S1="%varExName%" S3="SMTPSVC/%RESOLVEDEXFQDN%" S5="ServicePrincipalName"/>
										</Object>
										<!-- Determine the recipient mailbox for the test mail -->
										<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Microsoft System Attendant,%DN%">
											<Setting Key1="mail">
												<Rule Name="szTargetServerSystemAddress" Query="$."/>
											</Setting>
										</Object>
										<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Microsoft Exchange,cn=Services,%CONFIGDN%" Key3="(&amp;(objectCategory=exchangeAdminService)(cn=Microsoft System Attendant))">
											<Setting Key1="distinguishedName" Substitution="SYSTEMMBXDN"/>
											<Setting Key1="mail" Substitution="SYSTEMMBXADDRESS"/>
											<Object Type="If" Key1="contains('%SYSTEMMBXDN%', 'FYDIBOHF23SPDLT')">
												<Setting Key1="'%SYSTEMMBXADDRESS%'">
													<Rule Name="szOtherServerSystemAddress" Query="$."/>
												</Setting>
											</Object>
											<Rule Name="szE12TestRCPTAddress" Query="if(matches(@S1,'^.+@.+$'),@S1,if(count($szTargetServerSystemAddress) &gt;0,$szTargetServerSystemAddress,($szOtherServerSystemAddress)[1]))" S1="%varTestMailAddress%" AlwaysEvaluate="True"/>
										</Object>
										<!--Test-ServiceHealth does not support -DomainController parameter-->
										<Object Type="MonadCommand" Name="Test-ServiceHealth Results" Key1="test-ServiceHealth -Server %varExName%">
											<Setting Key1="Role">
												<Rule Name="szRole" Query="$."/>
											</Setting>
											<Setting Key1="ServicesRunning">
												<Rule Name="szServicesRunning" Query="$."/>
												<Rule Name="fPopServiceRunning" Query="$.[contains(.,'MSExchangePOP3')]"/>
												<Rule Name="fImapServiceRunning" Query="$.[contains(.,'MSExchangeIMAP4')]"/>
												<Rule Name="fW3ServiceRunning" Query="$.[contains(.,'W3Svc')]"/>
												<Rule Name="fISServiceRunning" Query="$.[contains(.,'MSExchangeIS')]"/>
												<Rule Name="fSubmissionServiceRunning" Query="$.[contains(.,'MSExchangeMailSubmission')]"/>
												<Rule Name="fADTopologyServiceRunning" Query="$.[contains(.,'MSExchangeADTopology')]"/>
												<Rule Name="fEdgeSyncServiceRunning" Query="$.[contains(.,'MSExchangeEdgeSync')]"/>
												<Rule Name="fMessageTrackingLogServiceRunning" Query="$.[contains(.,'MSExchangeTransportLogSearch')]"/>
												<Rule Name="fTransportServiceRunning" Query="$.[.='MSExchangeTransport']"/>
												<Rule Name="fUnifiedMessagingServiceRunning" Query="$.[contains(.,'MSExchangeUM')]"/>

												<Rule Name="fMessageTrackingLogServiceEnabled" Query="$fMessageTrackingLogServiceRunning and ($fIsEdgeServer or $fIsHubTransportServer)"/>
												<Rule Name="fEdgeTransportEnabled" Query="$fTransportServiceRunning and $fIsEdgeServer" Error="None" Title="Edge Transport server role found" Text="Server {3} has the Edge Transport server role installed and the required services are started." S3="%varExName%"/>
												<Rule Name="fHubTransportEnabled" Query="$fTransportServiceRunning and $fADTopologyServiceRunning and $fIsHubTransportServer" Error="None" Title="Hub Transport server role found" Text="Server {3} has the Hub Transport server role installed and the required services are started." S3="%varExName%"/>
												<Rule Name="fStoreServiceEnabled" Query="$fISServiceRunning and $fSubmissionServiceRunning and $fIsMailboxServer" Error="None" Title="Mailbox server role found" Text="Server {3} has the Mailbox server role installed and the required services are started." S3="%varExName%"/>
												<Rule Name="fClientAccessEnabled" Query="$fW3ServiceRunning and $szRole = 'Client Access Role'" Error="None" Title="Client Access server role found" Text="Server {3} has the Client Access server role installed and the required services are started." S3="%varExName%"/>
												<Rule Name="fUnifiedMessagingEnabled" Query="$fUnifiedMessagingServiceRunning and $fIsUnifiedMessagingServer" Error="None" Title="Unified Messaging server role found" Text="Server {3} has the Unified Messaging server role installed and the required services are started." S3="%varExName%"/>
											</Setting>
											<Setting Key1="ServicesNotRunning">
												<Rule Name="fW3ServiceNotRunning" Query="$.[contains(.,'W3Svc')]"/>
												<Rule Name="szW3ServiceNotRunning" Query="if ($fW3ServiceNotRunning, ' W3Svc', '')"/>
												<Rule Name="fISServiceNotRunning" Query="$.[contains(.,'MSExchangeIS')]"/>
												<Rule Name="szISNotRunning" Query="if ($fISServiceNotRunning, ' MSExchangeIS', '')"/>
												<Rule Name="fSubmissionServiceNotRunning" Query="$.[contains(.,'MSExchangeMailSubmission')]"/>
												<Rule Name="szSubmissionServiceNotRunning" Query="if ($fSubmissionServiceNotRunning, ' MSExchangeMailSubmission', '')"/>
												<Rule Name="fADTopologyServiceNotRunning" Query="$.[contains(.,'MSExchangeADTopology')]"/>
												<Rule Name="szADTopologyServiceNotRunning" Query="if ($fADTopologyServiceNotRunning, ' MSExchangeADTopology', '')"/>
												<Rule Name="fEdgeSyncServiceNotRunning" Query="$.[contains(.,'MSExchangeEdgeSync')]"/>
												<Rule Name="szEdgeSyncNotRunning" Query="if ($fEdgeSyncServiceNotRunning, ' MSExchangeEdgeSync', '')"/>
												<Rule Name="fMessageTrackingLogServiceNotRunning" Query="$.[contains(.,'MSExchangeTransportLogSearch')]"/>
												<Rule Name="szMessageTrackingLogServiceNotRunning" Query="if ($fMessageTrackingLogServiceNotRunning, ' MSExchangeTransportLogSearch', '')"/>
												<Rule Name="fTransportServiceNotRunning" Query="$.[.='MSExchangeTransport']"/>
												<Rule Name="szTransportServiceNotRunning" Query="if ($fTransportServiceNotRunning, ' MSExchangeTransport', '')"/>
												<Rule Name="fUnifiedMessagingServiceNotRunning" Query="$.[contains(.,'MSExchangeUM')]"/>
												<Rule Name="szUnifiedMessagingServiceNotRunning" Query="if ($fUnifiedMessagingServiceNotRunning, ' MSExchangeUM', '')"/>

												<Rule Name="fMessageTrackingLogServiceNotEnabled" Query="$fMessageTrackingLogServiceNotRunning and ($fIsEdgeServer or $fIsHubTransportServer)"/>
												<Rule Name="fEdgeTransportNotEnabled" Query="$fTransportServiceNotRunning and $fIsEdgeServer" Error="Error" Sev="1" Title="Edge Transport server role found and the one or more required services are not started" Text="Server {3} has the Edge Transport server role and the following services are not started: {4}. These services need to be started for mail to flow properly." S3="%varExName%" P4="$szTransportServiceNotRunning"/>
												<Rule Name="fHubTransportNotEnabled" Query="($fTransportServiceNotRunning or $fADTopologyServiceNotRunning) and $fIsHubTransportServer" Error="Error" Sev="1" Title="Hub Transport server role found and one or more required services are not started" Text="Server {3} has the Hub Transport server role and the following services are not started: {4}{5}. These services need to be running for mail to flow properly." S3="%varExName%" P4="$szTransportServiceNotRunning" P5="$szADTopologyServiceNotRunning"/>
												<Rule Name="fStoreServiceNotEnabled" Query="($fISServiceNotRunning or $fSubmissionServiceNotRunning) and $fIsMailboxServer" Error="Error" Sev="1" Title="Mailbox server role found and the one or more required services are not started" Text="Server {3} has the Mailbox server role and the following services are not started: {4}{5}." S3="%varExName%" P4="$szISNotRunning" P5="$szSubmissionServiceNotRunning"/>
												<Rule Name="fClientAccessNotEnabled" Query="$fW3ServiceNotRunning and $fIsClientAccessServer" Error="Warning" Sev="1" Title="Client Access server role found and one or more required services are not started" Text="Server {3} has the Client Access server role and the following services are not started: {4}. These services need to be started in order to access mail through the appropriate non-MAPI clients." S3="%varExName%" P4="$szW3ServiceNotRunning"/>
												<Rule Name="fUnifiedMessagingNotEnabled" Query="$fUnifiedMessagingServiceNotRunning and $fIsUnifiedMessagingServer" Error="Warning" Sev="1" Title="Unified Messaging server role found and one or more required services are not started" Text="Server {3} has the Unified Messaging server role and the following services are not started: {4}. These services need to be running for incoming fax and voicemails to be delivered." S3="%varExName%" P4="$szUnifiedMessagingServiceNotRunning"/>
											</Setting>
										</Object>
										<Object Type="MonadCommand" Name="Organization Transport Configuration" Key1="get-TransportConfig %MONADDCPARAMETER%">
											<Setting Key1="GenerateCopyOfDSNFor"/>
											<Setting Key1="JournalingReportNdrTo"/>
											<Setting Key1="MaxDumpsterSizePerDatabase"/>
											<Setting Key1="MaxDumpsterTime"/>
											<Setting Key1="ClearCategories"/>
											<Setting Key1="VoicemailJournalingEnabled"/>
											<Setting Key1="HeaderPromotionModeSetting"/>
											<Setting Key1="Xexch50Enabled"/>
											<Setting Key1="Rfc2231EncodingEnabled"/>
											<Setting Key1="InternalSMTPServers"/>
											<Setting Key1="MaxReceiveSize"/>
											<Setting Key1="MaxSendSize"/>
											<Setting Key1="MaxRecipientEnvelopeLimit"/>
											<Setting Key1="TLSReceiveDomainSecureList"/>
											<Setting Key1="TLSSendDomainSecureList"/>
											<Setting Key1="VerifySecureSubmitEnabled"/>
										</Object>

										<Object Type="MonadCommand" Name="Identity" Key1="get-ExchangeServer -Identity %varExName% %MONADDCPARAMETER%">
											<Setting Key1="IsHubTransportServer" Substitution="ISHUBTRANSPORTSERVER"/>
											<Setting Key1="IsEdgeServer" Substitution="ISEDGESERVER"/>

											<Object Type="If" Name="Transport Server Settings" Key1="'%ISEDGESERVER%'='True' or '%ISHUBTRANSPORTSERVER%'='True'">
												<Object Type="MonadCommand" Name="Name" Key1="get-TransportServer -Identity %varExName% %MONADDCPARAMETER%">
													<Setting Key1="MessageTrackingLogPath">
														<Rule Name="szMessageTrackingLogPath" Query="$."/>
														<Rule Name="szE12MessageTrackingDrive" Query="longest-starts-with($.,$szAllDrives)"/>
													</Setting>
													<Setting Key1="MessageTrackingLogEnabled">
														<Rule Name="fE12MessageTrackingEnabledAndRunning" Query="upper-case($.)='TRUE' and $fMessageTrackingLogServiceEnabled" Error="None" Title="Message tracking enabled" Text="Message tracking is enabled on server {2}, the log service is started, and the log files are located at '{3}'." P2="$szExNetBIOSName" P3="$szMessageTrackingLogPath"/>
														<Rule Name="fE12MessageTrackingEnabledAndNotRunning" Query="upper-case($.)='TRUE' and $fMessageTrackingLogServiceNotEnabled" Error="Warning" Title="Message tracking enabled" Text="Message tracking is enabled on server {2}, however, the log service '{4}' is not started. No message tracking queries can be issued until the service is started." P2="$szExNetBIOSName" P4="$szMessageTrackingLogServiceNotRunning"/>
														<Rule Name="fE12MessageTrackingDisabled" Query="upper-case($.)='FALSE'" Error="Error" Sev="1" Title="Message tracking disabled" Text="Message tracking is disabled on server {2}. It needs to be enabled to conduct mail flow tests. No message tracking queries can be issued until the service is started. It can be enabled within the Exchange Management Shell by issuing the command &quot;set-TransportServer -Identify {2} -MessageTrackingLogEnabled:$True&quot;." P2="$szExNetBIOSName"/>
													</Setting>
													<Setting Key1="PickupDirectoryPath">
														<Rule Name="szPickupDirectoryPath" Query="$."/>
														<Rule Name="szE12PickUpDrive" Query="longest-starts-with($.,$szAllDrives)" Error="None" Title="SMTP pickup folder is on logical disk {4}" Text="The pickup folder on server {2} is located at {5}." P2="$szExNetBIOSName" P4="$szE12PickUpDrive" P5="$szPickupDirectoryPath"/>
													</Setting>
													<Setting Key1="RoutingTableLogPath">
														<Rule Name="szE12RoutingTableDrive" Query="longest-starts-with($.,$szAllDrives)"/>
													</Setting>
													<Setting Key1="AntispamAgentsEnabled"/>
													<Setting Key1="DelayNotificationTimeout"/>
													<Setting Key1="ConnectivityLogPath">
														<Rule Name="szConnectivityLogPath" Query="$.">
															<Variable Name="varConnectivityLogPath" Scope="Children"/>
														</Rule>
														<Rule Name="szConnectivityLogDrive" Query="longest-starts-with($.,$szAllDrives)"/>
													</Setting>
													<Setting Key1="ConnectivityLogEnabled">
														<Rule Name="fConnectivityLogEnabled" Query="upper-case($.)='TRUE'" Error="None" Title="Connectivity logging is enabled" Text="The connectivity log folder on server {2} is {3}." P2="$szExNetBIOSName" P3="$szConnectivityLogPath"/>
													</Setting>
													<Setting Key1="ConnectivityLogMaxAge"/>
													<Setting Key1="ConnectivityLogMaxDirectorySize"/>
													<Setting Key1="ConnectivityLogMaxFileSize"/>
													<Setting Key1="ExternalDelayDsnEnabled"/>
													<Setting Key1="ExternalDNSAdapterEnabled">
														<Rule Name="fExternalDNSAdapterEnabled" Query="$.='True'"/>
													</Setting>
													<Setting Key1="ExternalDNSAdapterGuid">
														<Rule Name="fExternalDNSAdapterGuidOK" Query="$.='00000000-0000-0000-0000-000000000000' or contains(upper-case($szAllE12PossibleAdapterGuids),upper-case($.))" AlwaysEvaluate="True"/>
														<Rule Name="fExternalDNSAdapterGuidValid" Query="$fExternalDNSAdapterEnabled and $fExternalDNSAdapterGuidOK" Error="None" Title="Valid '{1}' setting found" Text="An valid '{1}' value ({4}) was found for server {2}." S1="ExternalDNSAdapterGuid" S2="%varExName%" P4="$." AlwaysEvaluate="True"/>
														<Rule Name="fExternalDNSAdapterGuidInValid" Query="$fExternalDNSAdapterEnabled and not($fExternalDNSAdapterGuidOK)" Error="Error" Sev="1" ReportIssue="RootCause" Title="Invalid '{1}' setting found" Text="An invalid '{1}' value ({4}) was found for server {2}.  This may prevent the '{0}' service from resolving DNS names correctly." S0="MSExchangeTransport" S1="ExternalDNSAdapterGuid" S2="%varExName%" P4="$." AlwaysEvaluate="True"/>
													</Setting>
													<Setting Key1="ExternalDNSProtocolOption"/>
													<Setting Key1="ExternalDNSServers">
														<Rule Name="szTransportServerExtDnsIpv6global" Query="$.[matches(.,'\d{1,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}')]"/>
														<Rule Name="fTransportServerExtDnsIpv6NotSupported" Query="not($fExternalDNSAdapterEnabled or $fExchangeIPv6Capable) and string-length($szTransportServerExtDnsIpv6global) &gt;0" Error="Warning" Sev="1" Title="Transport Server External DNS Settings Not Supported" Text="Exchange Server is not capable of supporting a transport server external Domain Name Server (DNS) setting specifying an Internet Protocol Version 6 (IPv6) address on server {2}." P2="$szExNetBIOSName" AlwaysEvaluate="True"/>
													</Setting>
													<Setting Key1="ExternalIPAddress"/>
													<Setting Key1="ExternalDsnDefaultLanguage"/>
													<Setting Key1="ExternalDsnLanguageDetectionEnabled"/>
													<Setting Key1="ExternalDsnMaxMessageAttachSize"/>
													<Setting Key1="ExternalDsnReportingAuthority"/>
													<Setting Key1="ExternalDsnSendHtml"/>
													<Setting Key1="ExternalPostmasterAddress"/>
													<Setting Key1="InternalDelayDsnEnabled"/>
													<Setting Key1="InternalDNSAdapterEnabled">
														<Rule Name="fInternalDNSAdapterEnabled" Query="$.='True'"/>
													</Setting>
													<Setting Key1="InternalDNSAdapterGuid">
														<Rule Name="fInternalDNSAdapterGuidOK" Query="$.='00000000-0000-0000-0000-000000000000' or contains(upper-case($szAllE12PossibleAdapterGuids),upper-case($.))" AlwaysEvaluate="True"/>
														<Rule Name="fInternalDNSAdapterGuidValid" Query="$fInternalDNSAdapterEnabled and $fInternalDNSAdapterGuidOK" Error="None" Title="Valid '{1}' setting found" Text="A valid '{1}' value ({4}) was found for server {2}." S1="InternalDNSAdapterGuid" S2="%varExName%" P4="$." AlwaysEvaluate="True"/>
														<Rule Name="fInternalDNSAdapterGuidInValid" Query="$fInternalDNSAdapterEnabled and not($fInternalDNSAdapterGuidOK)" Error="Error" Sev="1" ReportIssue="RootCause" Title="Invalid '{1}' setting found" Text="An invalid '{1}' value ({4}) was found for server {2}.  This may prevent the '{0}' service from resolving DNS names correctly." S0="MSExchangeTransport" S1="InternalDNSAdapterGuid" S2="%varExName%" P4="$." AlwaysEvaluate="True"/>
													</Setting>
													<Setting Key1="InternalDNSProtocolOption"/>
													<Setting Key1="InternalDNSServers">
														<Rule Name="szTransportServerIntDnsIpv6global" Query="$.[matches(.,'\d{1,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}:[0-9a-fA-F]{0,4}')]"/>
														<Rule Name="fTransportServerIntDnsIpv6NotSupported" Query="not($fInternalDNSAdapterEnabled or $fExchangeIPv6Capable) and string-length($szTransportServerIntDnsIpv6global) &gt;0" Error="Warning" Sev="1" Title="Transport Server Internal DNS Settings Not Supported" Text="Exchange Server is not capable of supporting a transport server internal Domain Name Server (DNS) setting specifying an Internet Protocol Version 6 (IPv6) address on server {2}." P2="$szExNetBIOSName" AlwaysEvaluate="True"/>
													</Setting>
													<Setting Key1="InternalDsnDefaultLanguage"/>
													<Setting Key1="InternalDsnLanguageDetectionEnabled"/>
													<Setting Key1="InternalDsnMaxMessageAttachSize"/>
													<Setting Key1="InternalDsnReportingAuthority"/>
													<Setting Key1="InternalDsnSendHtml"/>
													<Setting Key1="MaxConcurrentMailboxDeliveries"/>
													<Setting Key1="MaxConcurrentMailboxSubmissions"/>
													<Setting Key1="MaxConnectionRatePerMinute"/>
													<Setting Key1="MaxOutboundConnections"/>
													<Setting Key1="MaxPerDomainOutboundConnections"/>
													<Setting Key1="MessageTrackingLogMaxAge"/>
													<Setting Key1="MessageTrackingLogMaxDirectorySize"/>
													<Setting Key1="MessageTrackingLogMaxFileSize"/>
													<Setting Key1="MessageTrackingLogSubjectLoggingEnabled"/>
													<Setting Key1="MessageExpirationTimeout">
														<Rule Name="szMessageExpirationTimeout" Query="$.">
															<Variable Name="varMessageExpirationTimeout" Scope="Children"/>
														</Rule>
													</Setting>
													<Setting Key1="MessageRetryInterval"/>
													<Setting Key1="OutboundConnectionFailureRetryInterval"/>
													<Setting Key1="IntraOrgConnectorProtocolLoggingLevel"/>
													<Setting Key1="ContentConversionTracingEnabled"/>
													<Setting Key1="PipelineTracingEnabled"/>
													<Setting Key1="PipelineTracingPath"/>
													<Setting Key1="PipelineTracingSenderAddress"/>
													<Setting Key1="PoisonMessageDetectionEnabled"/>
													<Setting Key1="PoisonThreshold">
														<Rule Name="szPoisonThreshold" Query="$.">
															<Variable Name="varPoisonThreshold" Scope="Children"/>
														</Rule>
													</Setting>
													<Setting Key1="QueueMaxIdleTime"/>
													<Setting Key1="ReceiveProtocolLogMaxAge"/>
													<Setting Key1="ReceiveProtocolLogMaxDirectorySize"/>
													<Setting Key1="ReceiveProtocolLogMaxFileSize"/>
													<Setting Key1="ReceiveProtocolLogPath"/>
													<Setting Key1="RecipientValidationCacheEnabled"/>
													<Setting Key1="ReplayDirectoryPath"/>
													<Setting Key1="RootDropDirectoryPath"/>
													<Setting Key1="RoutingTableLogMaxAge"/>
													<Setting Key1="RoutingTableLogMaxDirectorySize"/>
													<Setting Key1="SendProtocolLogMaxAge"/>
													<Setting Key1="SendProtocolLogMaxDirectorySize"/>
													<Setting Key1="SendProtocolLogMaxFileSize"/>
													<Setting Key1="SendProtocolLogPath"/>
													<Setting Key1="TransientFailureRetryCount"/>
													<Setting Key1="TransientFailureRetryInterval"/>
													<Setting Key1="Guid"/>
													<Setting Key1="WhenChanged"/>
													<Setting Key1="OriginatingServer"/>
													<Rule Name="szE12SMTPLogicalDisks" Query="concat ($szE12MessageTrackingDrive,',',$szConnectivityLogDrive,',',$szE12PickUpDrive)" AlwaysEvaluate="True"/>
												</Object>
												<Object Type="MonadCommand" Name="Identity" Key1="get-ReceiveConnector -Server %varExName% %MONADDCPARAMETER%">
													<Setting Key1="Name">
														<Rule Name="szReceiveConnectorName" Query="$."/>
													</Setting>
													<Setting Key1="BinaryMimeEnabled"/>
													<Setting Key1="Bindings">
														<Rule Name="szE12ConcatRCPTAddressServerBindingList" Query="concat($szE12TestRCPTAddress, ',%varTestMailFromAddress%,', $.)"/>
													</Setting>
													<Setting Key1="Fqdn">
														<Rule Name="szE12SMTPInstanceFQDN" Query="$."/>
													</Setting>
													<Setting Key1="AuthMechanism"/>
													<Setting Key1="ChunkingEnabled"/>
													<Setting Key1="DefaultDomain"/>
													<Setting Key1="DeliveryStatusNotificationEnabled"/>
													<Setting Key1="EightBitMimeEnabled"/>
													<Setting Key1="DomainSecureEnabled"/>
													<Setting Key1="EnableAuthGSSAPI"/>
													<Setting Key1="EnhancedStatusCodesEnabled"/>
													<Setting Key1="Enabled"/>
													<Setting Key1="ConnectionTimeout"/>
													<Setting Key1="ConnectionInactivityTimeout"/>
													<Setting Key1="MessageRateLimit"/>
													<Setting Key1="MessageRateSource"/>
													<Setting Key1="MaxInboundConnection"/>
													<Setting Key1="MaxInboundConnectionPerSource"/>
													<Setting Key1="MaxInboundConnectionPercentagePerSource"/>
													<Setting Key1="MaxHeaderSize"/>
													<Setting Key1="MaxHopCount"/>
													<Setting Key1="MaxLocalHopCount"/>
													<Setting Key1="MaxLogonFailures"/>
													<Setting Key1="MaxMessageSize"/>
													<Setting Key1="MaxProtocolErrors"/>
													<Setting Key1="MaxRecipientsPerMessage"/>
													<Setting Key1="PermissionGroups"/>
													<Setting Key1="PipeliningEnabled"/>
													<Setting Key1="ProtocolLoggingLevel"/>
													<Setting Key1="RemoteIPRanges"/>
													<Setting Key1="RequireEHLODomain"/>
													<Setting Key1="RequireTLS"/>
													<Setting Key1="Server"/>
													<Setting Key1="SizeEnabled"/>
													<Setting Key1="TarpitInterval"/>
													<Setting Key1="Guid"/>
													<Setting Key1="WhenChanged"/>
													<Setting Key1="OriginatingServer"/>
												</Object>
											</Object>
										</Object>
									</Object>
									<!--End Exchange 2007 Information-->
									<!--Start Exchange 2000/2003 Information-->
									<Object Type="If" Name="Exchange200xInfo" Key1="contains('%EXVERSION%', 'Version 6')">
										<Setting Key1="true()">
											<Rule Name="szLegacyRCPTAddress" Query="slice(join(',', $szTestRCPTAddress), ',' , 0)">
												<Variable Name="varRCPTAddress" Scope="Children"/>
											</Rule>
											<Rule Name="szAllLegacyConcatRCPTAddressServerBindingList" Query="pack($szConcatRCPTAddressServerBindingList)">
												<Variable Name="varAllConcatRCPTAddressServerBindingList" Scope="Children"/>
											</Rule>
											<Rule Name="szAllLegacySMTPQueueDirectory" Query="pack($szQueueDirectory)">
												<Variable Name="varAllSMTPQueueDirectory" Scope="Children"/>
											</Rule>
											<Rule Name="szAllLegacySMTPLogicalDisks" Query="pack($szSMTPLogicalDisks)">
												<Variable Name="varAllSMTPLogicalDisks" Scope="Children"/>
											</Rule>
											<Rule Name="szAllLegacySMTPInstanceName" Query="pack($szSMTPInstanceName)">
												<Variable Name="varAllSMTPInstanceName" Scope="Children"/>
											</Rule>
											<Rule Name="szAllLegacySMTPInstance" Query="pack($szSMTPInstance)">
												<Variable Name="varAllSMTPInstance" Scope="Children"/>
											</Rule>
											<Rule Name="szAllLegacySMTPInstanceFQDN" Query="pack($szSMTPInstanceFQDN)">
												<Variable Name="varAllSMTPInstanceFQDN" Scope="Children"/>
											</Rule>
										</Setting>
										<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%DN%" Key3="objectClass=protocolCfgSMTPServer">
											<Rule Name="szExConnectDirectorySMTPException" Query="../Exception/@Message"/>
											<Rule Name="fFatalDirectorySMTPError" Query="../Exception/@Message"/>
											<Setting Key1="adminDisplayName" Retrieve="FailHard">
												<Rule Name="szSMTPInstanceName" Query="$." Error="None" Title="SMTP instance '{3}' detected" Text="SMTP instance '{3}' was detected on server {2}." P2="$szExNetBIOSName" P3="$."/>
											</Setting>
											<Setting Key1="name" Substitution="SMTPINSTANCE">
												<Rule Name="szSMTPInstance" Query="$."/>
											</Setting>
											<Setting Key1="msExchSmtpFullyQualifiedDomainName">
												<Rule Name="szSMTPInstanceFQDN" Query="$." Error="None" Title="SMTP instance fully-qualified domain name (FQDN)" Text="The fully-qualified domain name (FQDN) of SMTP instance '{3}' on server {2} is {1}." P1="$." P2="$szExNetBIOSName" P3="$szSMTPInstanceName"/>
												<Rule Name="fDefaultSMTPNoMatchNetWorkAddress" Query="$szSMTPInstance='1' and lower-case($.)!=lower-case($szExFQDN)" Error="Warning" Sev="2" Title="SMTP instance fully-qualified domain name does not match server name" Text="The fully-qualified domain name of SMTP virtual server '{3}' on server {2} does not match the fully-qualified domain name of the server. This may cause mail routing problems. SMTP virtual server: {1}. Server: {4}." P1="$." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" P4="$szExFQDN" GUID="391087ca-4544-4c26-a9b3-51bc46328bf4"/>
												<Rule Name="fDefaultSMTPNoMatchResolvedName" Query="not(count($szResolvedExFQDN)=0 or $szResolvedExFQDN='') and contains($szResolvedExFQDN, '.') and $szSMTPInstance='1' and lower-case($.)!=lower-case($szResolvedExFQDN)" Error="Warning" Sev="2" Title="SMTP instance fully-qualified domain name does not match DNS resolved server name" Text="The fully-qualified domain name of SMTP virtual server '{3}' on server {2} does not match the DNS resolved server name. This may cause mail routing problems. SMTP virtual server: {1}. DNS resolved server name: {4}." P1="$." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" P4="$szResolvedExFQDN" GUID="ecf8effc-c1fb-4d5f-ac9c-c91a46468107"/>
											</Setting>
											<Setting Key1="msExchSmtpSmartHost">
												<Rule Name="fSMTPInstanceSmartHostSet" Query="$.!=''" Error="Warning" Sev="1" Title="Smart host is set on SMTP instance" Text="SMTP instance '{3}' on server {2} is configured to route all messages via smart host '{1}'. This option can cause mail flow problems if set incorrectly. If an external SMTP server is set as a smart host, ensure that no messages to local recipients are picked up by this SMTP instance." P1="$." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" GUID="8e853999-f072-466f-bd72-923c6d7447a6"/>
											</Setting>
											<Setting Key1="msExchAlternateServer">
												<Rule Name="fSMTPAlternateServerSet" Query="true()" Error="NonDefault" Title="SMTP '{4}' value changed" Text="The value for configuration setting '{4}' for SMTP instance '{3}' on server {2} has changed. Default value: {8}. Current value: {9}." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" P4="../@Key1" S8="&lt;not set&gt;" P9="$." GUID="c1d28dc9-4447-4616-9cc4-89d5585a5d3d"/>
											</Setting>
											<!-- Check the metabase to get the SMTP VS info -->

											<Object Type="Metabase" Key1="%varExName%" Key2="LM/SmtpSvc/%SMTPINSTANCE%" Timeout="%300" SecurityContext="EXLOGON">
												<Rule Name="szExConnectMetabaseException" Query="../Exception/@Message"/>
												<Rule Name="fFatalMetabaseError" Query="../Exception/@Message"/>
												<Setting Key1="1023" Key2="ServerBindings" Substitution="SERVERBINDINGS" SubstitutionFormat="$----;">
													<Rule Name="fSMTPPortNot25" Query="not(contains('%SERVERBINDINGS%',':25:'))" Error="Warning" Sev="3" Title="SMTP non-standard port" Text="SMTP instance '{3}' on server {2} is not using the default port of 25. Current port number: {9}." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" P9="join(';', $szSMTPPort)" GUID="ebb39e35-fe87-4464-9f2b-a62835ea04d4"/>
													<Rule Name="szServerBindingList" Query="join(';', $szServerBinding)"/>
												</Setting>
												<Setting Key1="36908" Key2="DefaultDomain" Substitution="DEFSMTPDOMAIN">
													<Rule Name="szSMTPDomain" Query="$."/>
												</Setting>
												<Setting Key1="36923" Key2="SendBadTo" Substitution="POSTMASTER">
													<Rule Name="szPostmasterMailAddress" Query="concat($.,'@',$szSMTPDomain)"/>
													<Rule Name="szTestRCPTAddress" Query="if(matches(@S1,'.+@.+'),@S1,$szPostmasterMailAddress)" S1="%varTestMailAddress%"/>
													<Rule Name="szConcatRCPTAddressServerBindingList" Query="concat($szTestRCPTAddress, ',%varTestMailFromAddress%,', $szServerBindingList)"/>
												</Setting>
												<!-- We need to know what logical disks and mountpoints the SMTP instance uses -->
												<Setting Key1="4001" Key2="LogFileDirectory">
													<Rule Name="szLogDrive" Query="longest-starts-with($.,$szAllDrives)" Error="None" Title="SMTP log folder for SMTP instance '{3}' is on {5}" Text="The log folder of SMTP instance '{3}' on server {2} is located on logical disk {5}." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" P5="$szLogDrive"/>
												</Setting>
												<Setting Key1="36875" Key2="QueueDirectory" Substitution="SMTPQUEUEDIR" SubstitutionFormat="\\----\\">
													<Rule Name="szQueueDrive" Query="longest-starts-with($.,$szAllDrives)" Error="None" Title="SMTP queue folder for SMTP instance '{3}' is on {5}" Text="The queue folder of SMTP instance '{3}' on server {2} is located on logical disk {5}." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" P5="$szQueueDrive"/>
													<Rule Name="szQueueDirectory" Query="upper-case('%SMTPQUEUEDIR%')"/>
												</Setting>
												<Setting Key1="36880" Key2="PickupDirectory">
													<Rule Name="szPickUpDrive" Query="longest-starts-with($.,$szAllDrives)" Error="None" Title="SMTP pickup folder for SMTP instance '{3}' is on {5}" Text="The pickup folder of SMTP instance '{3}' on server {2} is located on logical disk {5}." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" P5="$szPickUpDrive"/>
												</Setting>
												<Setting Key1="36909" Key2="BadMailDirectory">
													<Rule Name="szBadMailDrive" Query="longest-starts-with($.,$szAllDrives)" Error="None" Title="SMTP Badmail folder for SMTP instance '{3}' is on {5}" Text="The Badmail folder of SMTP instance '{3}' on server {2} is located on logical disk {5}." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" P5="$szBadMailDrive"/>
													<Rule Name="szSMTPLogicalDisks" Query="concat ($szLogDrive,',',$szQueueDrive,',',$szPickUpDrive,',',$szBadMailDrive)" AlwaysEvaluate="True"/>
												</Setting>
												<Object Type="Cache" Name="SMTPBindingCache" Key1="Add" Key2="SMTPBindingList-%SMTPINSTANCE%" Key3="%SERVERBINDINGS%" Key4=";" Display="Hide">
													<Setting Key1="ServerBinding" Format="^(.*:\d{1,5}):$----$1">
														<Rule Name="szServerBinding" Query="$."/>
													</Setting>
													<Setting Key1="SMTPPort" Format="^.*:(\d{1,5}):$----$1">
														<Rule Name="szSMTPPort" Query="$." Error="None" Title="SMTP port for SMTP instance '{3}': {9}" Text="SMTP instance '{3}' on server {2} uses port {9}." P2="$szExNetBIOSName" P3="$szSMTPInstanceName" P9="$."/>
													</Setting>
												</Object>
											</Object>
											<Rule Name="iNumberOfSMTPInstance" Query="count($szSMTPInstance)" Error="None" Title="{9} SMTP instance(s) found" Text="There are {9} SMTP instance(s) on server {2}." P2="$szExNetBIOSName" P9="count($szSMTPInstance)"/>
										</Object>
									</Object>
									<!--End Exchange 2000/2003 Information-->
								</Object>
							</Object>
						</Object>
					</Object>

					<Rule Name="szRetrieveBasicServerData" Query="'RetrieveBasicServerData'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fErrorConnect,string(@Title),$szExNoErrorStateText)" Title="One or more errors were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="Successfully retrieved basic server data."/>
					<Rule Name="szRetrieveBasicServerDataResult" Query="string(@Title)" Title="Basic Server Information">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="szAllDrives" Query="$szVolume | $szLogicalDisk" AlwaysEvaluate="True"/>

					<Rule Name="szMAILFROMAddress" Query="'%varTestMailFromAddress%'">
						<Variable Name="varMAILFROMAddress" Scope="Children"/>
					</Rule>

					<Rule Name="fErrorConnect" Query="$fFatalDirectoryError or $fDirectoryExContainerError or $fMessageTrackingDisabled or $fExConnectRegError or $fExConnectWMIError or $fExConnectDirectorySMTPError or $fExConnectMetabaseError" Error="Error" Sev="1" Title="Fatal error found" Text="Fatal errors were found. No further steps will be taken." GUID="e0fe576a-3e4e-4194-88a7-7bc044475ac2" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayRetrieveDataProcessStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="ConnectExchange" Name="fGotoConnectExchange" Query="not($fErrorConnect) and @S1='Inbound'" Priority="2" S1="%varSelSymptom%" AlwaysEvaluate="True"/>
					<Rule NextStep="SearchMessage" Name="fGotoSearchMessage" Query="not($fErrorConnect) and @S1='Outbound' and not($fExchange2007orLater)" Priority="2" S1="%varSelSymptom%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckQueueStatus" Name="fGotoCheckQueueStatus" Query="not($fErrorConnect) and @S1='Queue' and not($fExchange2007orLater)" Priority="3" S1="%varSelSymptom%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckE12QueueStatus" Name="fGotoCheckE12QueueStatus" Query="not($fErrorConnect) and @S1='Queue' and $fExchange2007orLater" Priority="4" S1="%varSelSymptom%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckMailboxRoleHealth" Name="fGotoCheckMailboxRoleHealth" Query="not($fErrorConnect) and @S1='MailboxSubmission' and $fExchange2007orLater" Priority="5" S1="%varSelSymptom%" AlwaysEvaluate="True"/>
					<Rule NextStep="GetDSNCode" Name="fGotoGetDSNCode" Query="not($fErrorConnect) and @S1='NDR'" Priority="6" S1="%varSelSymptom%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="ConnectExchange" Title="Connectivity Check" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstance%" Substitution="varAllSMTPInstance" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstanceName%" Substitution="varAllSMTPInstanceName" Display="Hide"/>
			<Setting Key1="%varAllConcatRCPTAddressServerBindingList%" Substitution="varAllConcatRCPTAddressServerBindingList" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Connectivity to Exchange Server" Text="Please wait while the tool checks connectivity to Exchange server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Connectivity" Class="Area" GroupingClass="True" Display="Hide">
					<!-- Let's ping the Exchange server -->
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<Object Type="Group" Name="Ping Test">
							<Object Type="Enumerator" Name="Ping" Key1="1" Key2="6" Key3="1">
								<Object Type="WMI" Key1="%varDCName%" Key3="Win32_PingStatus" Key4="Address='%varExName%' and BufferSize=4096 and Timeout=2000" SecurityContext="EXLOGON">
									<Rule Name="fNoPing" Query="count(../Instance)=0"/>
									<Setting Key1="ResponseTime">
										<Rule Name="iPingExRespTime" Query="$."/>
									</Setting>
									<Setting Key1="PrimaryAddressResolutionStatus"/>
									<Setting Key1="ProtocolAddress"/>
									<Setting Key1="ProtocolAddressResolved"/>
									<Setting Key1="TimeToLive"/>
									<Setting Key1="ResponseTimeToLive"/>
									<Setting Key1="NoFragmentation"/>
									<Setting Key1="BufferSize"/>
									<Setting Key1="ReplySize"/>
									<Setting Key1="RouteRecord"/>
									<Setting Key1="RouteRecordResolved"/>
									<Setting Key1="StatusCode">
										<Rule Name="fPingExSuccess" Query="$.=0"/>
									</Setting>
								</Object>
							</Object>
							<Rule Name="fPingTestSuccess" Query="count($fPingExSuccess) &gt;0" Error="None" Title="Ping successful" Text="Ping from Active Directory server {1} to Exchange server {2} was successful." S1="%varDCName%" S2="%varExName%" AlwaysEvaluate="True"/>
							<Rule Name="fPingTestError" Query="not($fPingTestSuccess or $fPingTestNotPerformed)" Error="Warning" Sev="2" Title="Ping unsuccessful" Text="Ping from Active Directory server {1} to Exchange server {2} was not successful. Check whether the server is operational or not." S1="%varDCName%" S2="%varExName%" GUID="77d140a8-1f8b-4c3c-8694-b8cb6f368d31"/>
							<Rule Name="fPingTestNotPerformed" Query="count($fNoPing)=6" Error="Warning" Sev="3" Title="Ping test not performed" Text="Ping from Active Directory server {1} to Exchange server {2} was not performed. Unless server {1} is running Windows 2000, this could be the result of a network or permissions problem." S1="%varDCName%" S2="%varExName%" GUID="91aac86e-60e8-4b90-9453-1c209cf75fd5" AlwaysEvaluate="True"/>
						</Object>
						<!-- Next, check whether each SMTP port designated by all the SMTP virtual servers can respond or not -->
						<Object Type="Variable" Name="SMTP Port List" Key1="Unpack" Key2="%varAllConcatRCPTAddressServerBindingList%">
							<Setting Key1="__KEY" Substitution="SORTKEY"/>
							<Setting Key1="__VALUE" Substitution="SERVERBINDINGLIST" Format="^.*,.*,(.*?)$----$1">
								<Rule Name="szProbSMTPInstance" Query="if(count($fSMTPPortExError) &gt;0, unpack('%varAllSMTPInstance%', '%SORTKEY%'))"/>
								<Rule Name="szProbSMTPInstanceName" Query="if(count($fSMTPPortExError) &gt;0, unpack('%varAllSMTPInstanceName%', '%SORTKEY%'))"/>
							</Setting>
							<Object Type="Cache" Name="SMTPPortCache" Key1="Add" Key2="SMTPPortList-%SORTKEY%" Key3="%SERVERBINDINGLIST%" Key4=";" Display="Hide">
								<Setting Key1="ServerIP" Substitution="SERVERIP" Format="^(.*?):.*$----$1"/>
								<Setting Key1="SMTPPort" Substitution="SMTPPORT" Format="^.*:(\d{1,5})$----$1"/>
								<Object Type="If" Name="Substitutions" Key1="true()" Display="Hide">
									<Setting Key1="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" Substitution="SMTPINSTANCE" Display="Hide"/>
									<Setting Key1="if('%SERVERIP%'='' or '%SERVERIP%'='0.0.0.0', '%varExName%', '%SERVERIP%')" Substitution="EXSERVER" Display="Hide"/>
									<Object Type="Port" Name="SMTP Port Test" Key1="%EXSERVER%">
										<Setting Key1="%SMTPPORT%">
											<Rule Name="fSMTPPortExSuccess" Query="contains($.[2], concat(@S9,' Available'))" Error="None" Title="Port {9} responded" Text="Port {9}, which is used by SMTP instance '{3}', successfully responded on server {2}." S2="%EXSERVER%" S3="%SMTPINSTANCE%" S9="%SMTPPORT%"/>
											<Rule Name="fSMTPPortExError" Query="not($fSMTPPortExSuccess)" Error="Error" Sev="1" ReportIssue="Summary" Title="Port {9} did not respond" Text="Port {9}, which is used by SMTP instance '{3}', did not respond on server {2}." S2="%EXSERVER%" S3="%SMTPINSTANCE%" S9="%SMTPPORT%" GUID="80503d53-ada9-4bc1-b6c3-1266b10de3af"/>
										</Setting>
									</Object>
								</Object>
							</Object>
						</Object>
					</Object>

					<Rule Name="szConnectExchange" Query="'ConnectExchange'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fConnectivityIssueFound,string(@Title),$szExNoErrorStateText)" Title="One or more errors were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="Exchange and Active Directory connectivity test passed."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Exchange Connectivity Test Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>
					<Rule Name="szAllProbSMTPInstance" Query="join('',pack($szProbSMTPInstance))">
						<Variable Name="varAllProbSMTPInstance" Scope="Children"/>
					</Rule>
					<Rule Name="szAllProbSMTPInstanceName" Query="join('',pack($szProbSMTPInstanceName))">
						<Variable Name="varAllProbSMTPInstanceName" Scope="Children"/>
					</Rule>

					<Rule Name="fConnectivityIssueFound" Query="$fPingTestError or count($fSMTPPortExError) &gt;0" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayExProcessStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckExchangeSMTPPort" Name="fGotoCheckExchangeSMTPPort" Query="$fConnectivityIssueFound" Priority="2" Text="- Diagnose the SMTP port of the Exchange server" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="MailAcceptanceTest" Name="fGotoMailAcceptanceTest" Query="true()" Priority="3" Text="- Send a test message to check whether it is accepted successfully" Display="Hide" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckExchangeSMTPPort" Title="Check SMTP Port" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varAllProbSMTPInstance%" Substitution="varAllProbSMTPInstance" Display="Hide"/>
			<Setting Key1="%varAllProbSMTPInstanceName%" Substitution="varAllProbSMTPInstanceName" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking SMTP Port" Text="Please wait while the tool diagnoses SMTP port settings of server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Connectivity" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<Object Type="If" Key1="true()">
							<Setting Key1="if ('%varIsExchange2007orLater%'='1', 'MSExchangeTransport', 'SMTPSVC')" Substitution="SMTPSERVICE"/>
							<!-- Check whether the SMTP service is up and running -->
							<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='%SMTPSERVICE%'" SecurityContext="EXLOGON">
								<Setting Key1="Started">
									<Rule Name="fSMTPStarted" Query="$.='True'" Error="None" Title="SMTP service running" Text="'{0}' service on server {2} is started." S0="%SMTPSERVICE%" S2="%varExName%"/>
									<Rule Name="fSMTPNotStarted" Query="$.='False'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not started" Text="'{0}' service on server {2} is not started. It is important for this service to be started to route messages." S0="%SMTPSERVICE%" S2="%varExName%" GUID="64ba818b-8789-41bb-ac20-f3eb9c7d1594"/>
								</Setting>
								<Setting Key1="StartMode">
									<Rule Name="fSMTPDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service disabled" Text="'{0}' service on server {2} is disabled. It is important for this service to be running to route messages." S0="%SMTPSERVICE%" S2="%varExName%" GUID="7e8ef54b-1be2-4955-8123-f0ddd39e0d84"/>
									<Rule Name="fSMTPManual" Query="$.='Manual'" Error="Warning" Sev="2" Title="SMTP service manual startup" Text="'{0}' service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="%SMTPSERVICE%" S2="%varExName%" GUID="423d680b-5861-4bcb-a512-3189c7a6a33d"/>
								</Setting>
								<Setting Key1="State">
									<Rule Name="fSMTPNotRunning" Query="not($.='Running') and $fSMTPStarted" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service is started but not running" Text="'{0}' service on server {2} is started but not running. It is important for this service to be running to route messages. Current service state: {4}" S0="%SMTPSERVICE%" S2="%varExName%" P4="$."/>
								</Setting>
							</Object>
							<!-- Next, check whether the SMTP virtual server is up and running -->
							<Object Type="Variable" Name="SMTP Instance List" Key1="Unpack" Key2="%varAllProbSMTPInstance%">
								<Setting Key1="__KEY" Substitution="SORTKEY"/>
								<Setting Key1="__VALUE" Substitution="SMTPINSTANCE"/>
								<Object Type="Metabase" Key1="%varExName%" Key2="LM/SmtpSvc/%SMTPINSTANCE%" Timeout="%300" SecurityContext="EXLOGON">
									<Setting Key1="1016" Key2="ServerState" Substitution="SMTPVSSTATUS">
										<Rule Name="fSMTPVSStarted" Query="$.=2" Error="None" Title="SMTP instance started" Text="SMTP instance '{3}' on server {2} is started." S2="%varExName%" P3="unpack('%varAllProbSMTPInstanceName%', '%SORTKEY%')"/>
										<Rule Name="fSMTPVSStopped" Query="$.=4" Error="Error" Sev="1" ReportIssue="RootCause" Title="SMTP instance stopped" Text="SMTP instance '{3}' on server {2} is stopped. This virtual server cannot route any messages." S2="%varExName%" P3="unpack('%varAllProbSMTPInstanceName%', '%SORTKEY%')" GUID="369d863f-7702-4ffc-80fd-a9f86eb26ce0"/>
										<Rule Name="fSMTPVSPaused" Query="$.=6" Error="Error" Sev="2" ReportIssue="RootCause" Title="SMTP instance paused" Text="SMTP instance '{3}' on server {2} is paused." S2="%varExName%" P3="unpack('%varAllProbSMTPInstanceName%', '%SORTKEY%')" GUID="ca7cb622-13da-40f7-b8d8-ce020a0380c7"/>
									</Setting>
									<!-- Check for event 429 -->
									<Object Type="If" Key1="not('%SMTPVSSTATUS%'='2')">
										<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
										<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='System' AND EventCode=429 AND SourceName='smtpsvc' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
											<Setting Key1="EventCode"/>
											<Setting Key1="EventType"/>
											<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
											<Setting Key1="Data"/>
											<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
												<Rule Name="fEvt429WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="An '{0}' error event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the system log of server {2} within the last 24 hours. Verify that the '{3}', '{4}' and '{5}' folders exist for this SMTP instance under the designated path and they are not corrupt. Last occurrence at {8}. Event description: {1}" S0="SMTPSVC" S1="%EVTMESSAGE%" S2="%varExName%" S3="BadMail" S4="PickUp" S5="Queue" S8="%EVTTIME%" S9="429" GUID="a1144c62-475b-4a46-af3e-39ec35c3ed64"/>
											</Setting>
										</Object>
									</Object>
								</Object>
							</Object>
						</Object>
						<Rule Name="szCheckExchangeSMTPPort" Query="'CheckExchangeSMTPPort'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fPotentialCauseFound, string(@Title), $szExNoErrorStateText)" Title="A potential issue with mail acceptance on the server was identified." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="More investigation necessary."/>
						<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="SMTP Port Diagnosis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fPotentialCauseFound" Query="$fSMTPNotRunning or $fSMTPNotStarted or count($fSMTPVSStopped) &gt;0 or count ($fSMTPVSPaused) &gt;0 or count ($fEvt429WithinLast24hours) &gt;0" AlwaysEvaluate="True"/>
						<Rule Name="fMoreInv" Query="not($fPotentialCauseFound)" Error="Warning" Sev="2" ReportIssue="Summary" Title="Other root causes" Text="It appears that the SMTP service and SMTP instance(s) on server {2} are started but the port did not respond. Check if there are any network errors or hung services." S2="%varExName%" GUID="34ebb527-9bbd-4fb2-b4c2-5c638e397e3e"/>

						<Rule NextStep="DisplayResultsStep" Name="fCheckExchangeSMTPortStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MailAcceptanceTest" Title="Mail Acceptance Test" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstanceName%" Substitution="varAllSMTPInstanceName" Display="Hide"/>
			<Setting Key1="%varAllConcatRCPTAddressServerBindingList%" Substitution="varAllConcatRCPTAddressServerBindingList" Display="Hide"/>
			<Setting Key1="%varRootDomainDN%" Substitution="varRootDomainDN" Display="Hide"/>
			<Setting Key1="%varConfigDN%" Substitution="varConfigDN" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Conducting Mail Acceptance Test" Text="Please wait while the tool conducts a mail acceptance test on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Mail Acceptance" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Send a test mail and check the response of each SMTP command -->
						<Object Type="Variable" Name="SMTP Port Mail Acceptance" Key1="Unpack" Key2="%varAllConcatRCPTAddressServerBindingList%">
							<Setting Key1="__KEY" Substitution="SORTKEY"/>
							<Setting Key1="__VALUE" Substitution="RCPTADDRESS" Format="^(.*?),.*,.*$----$1">
								<Rule Name="szRCPTAddress" Query="$.">
									<Variable Name="varRCPTAddress" Scope="Children"/>
								</Rule>
							</Setting>
							<Setting Key1="__VALUE" Substitution="MAILFROM" Format="^.*,(.*?),.*$----$1">
								<Rule Name="szMAILFROMAddress" Query="$.">
									<Variable Name="varMAILFROMAddress" Scope="Children"/>
								</Rule>
							</Setting>
							<Setting Key1="__VALUE" Substitution="SERVERBINDINGLIST" Format="^.*,.*,(.*?)$----$1"/>
							<Object Type="Cache" Name="SMTPPortMailAcceptance" Key1="Add" Key2="SMTPPortList-%SORTKEY%" Key3="%SERVERBINDINGLIST%" Key4=";" Display="Hide">
								<Setting Key1="ServerIP" Substitution="SERVERIP" SubstitutionFormat="^(.*?):.*$----$1"/>
								<Setting Key1="SMTPPort" Substitution="SMTPPORT" SubstitutionFormat="^.*:(\d{1,5})$----$1"/>
								<Object Type="If" Key1="not('%varIsExchange2007orLater%'='1')">
									<Setting Key1="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" Substitution="SMTPINSTANCE"/>
									<Setting Key1="if('%SERVERIP%'='', '%varExName%', '%SERVERIP%')" Substitution="EXSERVER"/>
									<Object Type="Protocol" Name="SMTP Mail Acceptance Test" Key1="%EXSERVER%" Key2="TCP" Key3="%SMTPPORT%" Key4="60000" Timeout="%300">
										<Setting Key1="Connect">
											<Rule Name="fSMTPSocketAliveExTestOkay" Query="not ($.[2]='Respond = Remote socket is not available' or $.[2]='Respond = ')"/>
											<Rule Name="fSMTPSocketAliveExTestError" Query="not ($fSMTPSocketAliveExTestOkay)" Error="Error" Sev="1" ReportIssue="Summary" Title="Mail acceptance failure" Text="SMTP instance '{3}' on server {2} failed the mail acceptance test over port {9} when trying to open the remote socket: {1}." P1="$.[2]" S2="%varExName%" S3="%SMTPINSTANCE%" S9="%SMTPPORT%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
											<Rule Name="fSMTPSocketPIXFireWall" Query="starts-with($.[2],'Respond = 220') and (contains($.[2], '***') or contains(upper-case($.[2]),'SMTP/CMAP'))" Template="tSMTPProxyRunning" S0="Cisco PIX firewall"/>
											<Rule Name="fSMTPSocketWatchGuard" Template="tSMTPProxyRunning" S0="WatchGuard Firebox firewall" S4="SMTP SERVICE READY"/>
											<Rule Name="fSMTPSocketCheckPoint" Template="tSMTPProxyRunning" S0="Checkpoint Firewall" S4="CHECKPOINT"/>
											<Rule Name="fSMTPSocketRaptor" Query="contains(upper-case($.[2]), 'GENERIC SMTP HANDLER')" Template="tSMTPProxyRunning" S0="Raptor Firewall"/>
											<Rule Name="fSMTPSocketCyberGuard" Template="tSMTPProxyRunning" S0="CyberGuard firewall" S4="FW1 SMTP PROXY SERVICE READY"/>
											<Rule Name="fSMTPSocketPraetor" Template="tSMTPProxyRunning" S0="CMS Praetor" S4="CMSPRAETOR"/>
											<Rule Name="fSMTPSocketMerak" Template="tSMTPProxyRunning" S0="Merak Mail Server" S4="ESMTP MERAK"/>
											<Rule Name="fSMTPBannerCustomized" Query="not ($fSMTPSocketPIXFireWall or $fSMTPSocketWatchGuard or $fSMTPSocketCheckPoint or $fSMTPSocketRaptor or $fSMTPSocketCyberGuard or $fSMTPSocketPraetor or $fSMTPSocketMerak) and (starts-with($.[2],'Respond = 220') and not (contains($.[2], 'Microsoft ESMTP MAIL Service')))" Error="Warning" Sev="3" Title="SMTP Banner is customized" Text="SMTP banner received from SMTP instance '{3}' on server {2} appears to be modified." S2="%varExName%" S3="%SMTPINSTANCE%" GUID="cce2de73-378b-455c-8460-c3f850c4aead"/>
										</Setting>
										<Setting Key1="EHLO">
											<Rule Name="fLinkStateRegistered" Query="$fSMTPSocketAliveExTestOkay and not(contains ($.[2], '250-X-LINK2STATE'))" Error="Warning" Sev="2" Title="Link state not registered" Text="SMTP instance '{3}' on server {2} does not support the X-LINK2STATE verb. This will prevent routing updates from being received." S2="%varExName%" S3="%SMTPINSTANCE%" GUID="96f27ebc-427b-4249-aaed-1333594f28f5"/>
										</Setting>
										<Setting Key1="MAIL FROM: %MAILFROM%" Key5="MAIL FROM">
											<Rule Name="fAcceptTestMailFromExOkay" Query="starts-with($.[2], 'Respond = 250')"/>
											<Rule Name="fAcceptTestMailFromExError" Query="$fSMTPSocketAliveExTestOkay and not ($fAcceptTestMailFromExOkay)" Error="Error" Sev="1" ReportIssue="Summary" Title="Mail acceptance failure" Text="SMTP instance '{3}' on server {2} failed the mail acceptance test over port {9}. MAIL FROM command: {1}." P1="$szMailFromExResponse" S2="%varExName%" S3="%SMTPINSTANCE%" S9="%SMTPPORT%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
											<Rule Name="szMailFromExResponse" Query="replace($.[2], ',$', '')"/>
										</Setting>
										<Setting Key1="RCPT TO: %RCPTADDRESS%" Key5="RCPT TO">
											<Rule Name="fAcceptTestRcptToExOkay" Query="starts-with($.[2], 'Respond = 250')"/>
											<Rule Name="fAcceptTestRcptToExError" Query="$fSMTPSocketAliveExTestOkay and $fAcceptTestMailFromExOkay and not ($fAcceptTestRcptToExOkay)" Error="Error" Sev="1" ReportIssue="Summary" Title="Mail acceptance failure" Text="SMTP instance '{3}' on server {2} failed the mail acceptance test over port {9}. RCPT TO command: {1}." P1="$szRcptToExResponse" S2="%varExName%" S3="%SMTPINSTANCE%" S9="%SMTPPORT%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
											<Rule Name="szRcptToExResponse" Query="replace($.[2], ',$', '')"/>
										</Setting>
										<Setting Key1="DATA"/>
										<Setting Key1="From: %MAILFROM%" Key2="SkipRead" Key5="RFC822-FROM"/>
										<Setting Key1="To: %RCPTADDRESS%" Key2="SkipRead" Key5="RFC822-TO"/>
										<Setting Key1="" Key2="SkipRead"/>
										<Setting Key1="This message has been sent by the Microsoft Exchange Troubleshooting Assistant tool. The purpose of this message is to test the SMTP transport. It is safe to delete this message." Key2="SkipRead"/>
										<Setting Key1=".">
											<Rule Name="fAcceptTestDataExOkay" Query="starts-with ($.[2], 'Respond = 250')"/>
											<Rule Name="fAcceptTestDataExError" Query="$fSMTPSocketAliveExTestOkay and $fAcceptTestMailFromExOkay and $fAcceptTestRcptToExOkay and not ($fAcceptTestDataExOkay)" Error="Error" Sev="1" ReportIssue="Summary" Title="Mail acceptance failure" Text="SMTP instance '{3}' on server {2} failed the mail acceptance test over port {9}. DATA command: {1}." P1="$szDataExResponse" S2="%varExName%" S3="%SMTPINSTANCE%" S9="%SMTPPORT%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
											<Rule Name="szDataExResponse" Query="replace($.[2], ',$', '')"/>
											<Rule Name="szExMessageID" Query="substring-before(substring-after($.[2],'&lt;'),'&gt;')">
												<Variable Name="varExMessageID" Scope="Children"/>
											</Rule>
										</Setting>
										<Setting Key1="Disconnect"/>
										<Rule Name="fMailAcceptExSuccess" Query="$fSMTPSocketAliveExTestOkay and $fAcceptTestMailFromExOkay and $fAcceptTestRcptToExOkay and $fAcceptTestDataExOkay" Error="None" Title="Mail acceptance success" Text="SMTP instance '{3}' on server {2} successfully completed the mail acceptance test over port {9}." S2="%varExName%" S3="%SMTPINSTANCE%" S9="%SMTPPORT%"/>
										<Rule Name="fMailAcceptExFailure" Query="not($fMailAcceptExSuccess)"/>
									</Object>
								</Object>
								<Object Type="If" Name="Exchange Server 2007" Key1="'%varIsExchange2007orLater%'='1'">
									<Setting Key1="if('%SERVERIP%'='0.0.0.0', '%varExName%', '%SERVERIP%')" Substitution="EXSERVER"/>
									<Object Type="SmtpClient" Key1="%EXSERVER%" Key2="%SMTPPORT%" Key3="EnableSsl=true;Validation=disabled;UseDefaultCredentials=true" SecurityContext="EXLOGON">
										<Rule Name="fMailSubmitFailure" Query="../Exception/@Message" Error="Error" Title="Error submitting mail" Text="Mail submission failed: Error message: {1}." P1="../Exception/@Message"/>
										<Setting Key1="From" Key2="%MAILFROM%"/>
										<Setting Key1="To" Key2="%RCPTADDRESS%"/>
										<Setting Key1="Subject" Key2=""/>
										<Setting Key1="Message-ID" Key2="">
											<Rule Name="fMailSubmitSuccess" Query="true()" Error="None" Title="Mail acceptance success" Text="SMTP mail sent to {2}:{9} was accepted." S2="%EXSERVER%" S9="%SMTPPORT%"/>
											<Rule Name="szE12MessageID" Query="$.">
												<Variable Name="varExMessageID" Scope="Children"/>
											</Rule>
										</Setting>
										<Setting Key1="Body" Key2="This message has been sent by the Microsoft Exchange Troubleshooting Assistant tool. The purpose of this message is to test the SMTP transport. It is safe to delete this message."/>
									</Object>
								</Object>
							</Object>
							<!-- Let's check if global distribution groups are used in a multi-domain topology. We use cache to remove duplicates -->
							<Object Type="Cache" Name="Global Distribution Group" Key1="Add" Key2="Recipient" Key3="%RCPTADDRESS%" Display="Hide">
								<Object Type="Directory" Key1="GC://%varDCName%/" Key2="%varRootDomainDN%" Key3="(&amp;(groupType:1.2.840.113556.1.4.803:=2)(proxyAddresses=smtp:%RCPTADDRESS%))">
									<Setting Key1="cn">
										<Rule Name="fGlobalGroupUsedMultiDomains" Query="count($szDomainDN) &gt;1" Error="Warning" Sev="1" Title="Global distribution group used in multi-domain forest" Text="The specified recipient '{1}' was found to be global distribution group '{3}', while the topology appears to be a multi-domain forest. Messages may not be delivered correctly to its members. Follow Microsoft Knowledge Base article 271930 and consider using universal distribution groups instead." S1="%RCPTADDRESS%" P3="$." GUID="304abc5e-8470-46cd-98e8-6ed501e1c753" AlwaysEvaluate="True"/>
									</Setting>
								</Object>
							</Object>
						</Object>
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Partitions,%varConfigDN%" Key3="systemFlags=3" Key4="OneLevel">
							<Setting Key1="nCName">
								<Rule Name="szDomainDN" Query="$."/>
							</Setting>
						</Object>
					</Object>

					<Rule Name="fExchange2007orLater" Query="@S1='1'" S1="%varIsExchange2007orLater%" AlwaysEvaluate="True"/>
					<Rule Name="szMailAcceptanceTest" Query="'MailAcceptanceTest'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fMailAcceptanceIssueFound or count($fGlobalGroupUsedMultiDomains) &gt;0, string(@Title), $szExNoErrorStateText)" Title="One or more errors were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="Exchange mail acceptance test passed."/>
					<Rule Name="szMailAcceptanceTestResult" Query="string(@Title)" Title="Exchange Mail Acceptance Test Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="fMailAcceptanceIssueFound" Query="count($fMailAcceptExFailure) &gt;0 or count($fMailSubmitFailure) &gt; 0" AlwaysEvaluate="True"/>
					<Rule Name="iIniScanMsgTrackingLoopCount" Query="1">
						<Variable Name="varScanMsgTrackLoopCount" Scope="Children"/>
					</Rule>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayMailAcceptanceStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="ScanMessageTracking" Name="fGotoScanMessageTracking" Query="not($fMailAcceptanceIssueFound) and not($fExchange2007orLater)" Priority="2" Text="- Check the message tracking log entries for the last test message sent from the tool" Display="Hide"/>
					<Rule NextStep="ScanE12MessageTracking" Name="fGotoScanE12MessageTracking" Query="not($fMailAcceptanceIssueFound) and $fExchange2007orLater" Priority="2" Text="- Check the message tracking log entries for the last test message sent from the tool" Display="Hide"/>
					<Rule NextStep="CheckExchangeVariousTransportConfig" Name="fGotoCheckExchangeVariousTransportConfig" Query="$fMailAcceptanceIssueFound" Priority="3" Text="- Check the transport configuration of the Exchange server" Display="Hide"/>
					<Rule NextStep="CheckDomainRouting" Name="fGotoCheckDomainRouting" Query="$fMailAcceptanceIssueFound and not($fExchange2007orLater)" Priority="4" Text="- Check the domain routing information stored in recipient policies, connectors and the metabase" Display="Hide"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckExchangeVariousTransportConfig" Title="Check Transport Configuration" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varExDN%" Substitution="varExDN" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Transport Settings of the Exchange Server" Text="Please wait while the tool checks various transport settings of the Exchange server." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Mail Acceptance" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True">
						<!-- Check Sender and Recipient filter global settings -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Default Message Filter,cn=Message Delivery,cn=Global Settings,%varExOrgDN%" SecurityContext="EXLOGON">
							<Setting Key1="msExchTurfListNames">
								<Rule Name="fTurfListNames" Query="count($.) &gt;0" Error="None" Title="Sender filter contains mail addresses" Text="The sender filter contains mail addresses to be filtered. Number of those addresses: {9}" P9="count($.)"/>
							</Setting>
							<Setting Key1="msExchTurfListOptions">
								<Rule Name="fFilterBlankSenderEnabled" Query="bitwise-and($.,2)" Error="None" Title="Blank sender filtered" Text="Sender filtering is set to filter messages with blank sender."/>
								<Rule Name="fDropConnectionEnabled" Query="not(bitwise-and($.,8))" Error="None" Title="Sender filtering may drop connection" Text="Sender filtering is set to drop connection if address matches filter."/>
							</Setting>
							<Setting Key1="msExchRecipTurfListNames">
								<Rule Name="fRecipTurfListNames" Query="count($.) &gt;0" Error="None" Title="Recipient filter contains mail addresses" Text="The recipient filter contains mail addresses to be filtered. Number of those addresses: {9}" P9="count($.)"/>
							</Setting>
							<Setting Key1="msExchRecipTurfListOptions">
								<Rule Name="fRecipDirectoryEnabled" Query="bitwise-and($.,1)" Error="None" Title="Recipient filtering directory checks" Text="Recipient filtering is set to filter recipients who are not in the Directory."/>
							</Setting>
						</Object>
						<!-- Check Connection filter global settings -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Default Connection Filter,cn=Default Message Filter,cn=Message Delivery,cn=Global Settings,%varExOrgDN%" SecurityContext="EXLOGON">
							<Setting Key1="msExchSmtpConnectionRulesPriority">
								<Rule Name="fBlockListExists" Query="count($.) &gt;0" Error="None" Title="Realtime Block List" Text="Connection filtering is configured to use Realtime Block List service."/>
							</Setting>
							<Setting Key1="msExchSmtpConnectionWhiteList">
								<Rule Name="fConnectionSafeList" Query="count($.) &gt;0" Error="None" Title="Connection filtering safe list" Text="The connection filter contains mail addresses that are not filtered as exception. Number of those addresses: {9}" P9="count($.)"/>
							</Setting>
							<Setting Key1="msExchSMTPGlobalIPAcceptList">
								<Rule Name="fGlobalAcceptExists" Query="contains($.,'18000080200000803C00008044000080010000004C00000000000000000000000100000001000000020000000200000004000000000000004C00008000000000000000000000000000000000FFFFFFFF')" Error="None" Title="Global Accept list" Text="Global Accept list contains IP addresses."/>
							</Setting>
							<Setting Key1="msExchSMTPGlobalIPDenyList">
								<Rule Name="fGlobalDenyExists" Query="contains($.,'18000080340000803C00008044000080010000004C0000000100000001000000020000000200000004000000000000004C000080000000000000000000000000000000000000000000000000FFFFFFFF')" Error="None" Title="Global Deny list" Text="Global Deny list contains IP addresses."/>
							</Setting>
						</Object>
						<!-- Check Sender ID and IMFV2 global settings for TiSP2 -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Uce Content Filter,cn=Message Delivery,cn=Global Settings,%varExOrgDN%" SecurityContext="EXLOGON">
							<Setting Key1="msExchUceEnabled">
								<Rule Name="fUceEnabled" Query="$.=1"/>
							</Setting>
							<Setting Key1="msExchUceStoreActionThreshold">
								<Rule Name="fUceStoreActionThreshold" Query="$fUceEnabled" Error="None" Title="Intelligent Message Filter store threshold" Text="For the store threshold, messages with an spam confidence level (SCL) greater than or equal to {9} will be moved to the Junk E-mail folder." P9="$."/>
							</Setting>
							<Setting Key1="msExchUceBlockThreshold">
								<Rule Name="fSenderIDAccept" Query="substring-after($.,';')=0 or substring-after($.,';')=1 or substring-after($.,';')=2 or substring-after($.,';')=5" Error="None" Title="Sender ID accepts failed messages" Text="Sender ID filtering is set to accept messages that fail the Sender ID validation test."/>
								<Rule Name="fSenderIDDelete" Query="bitwise-and(substring-after($.,';'),512)" Error="None" Title="Sender ID deletes failed messages" Text="Sender ID filtering is set to delete messages that fail the Sender ID validation test."/>
								<Rule Name="fSenderIDReject" Query="bitwise-and(substring-after($.,';'),1024)" Error="None" Title="Sender ID rejects failed messages" Text="Sender ID filtering is set to reject messages that fail the Sender ID validation test."/>
								<Rule Name="fUceBlockThresholdNoAction" Query="$fUceEnabled and substring-after($.,';')=0 or substring-after($.,';')=512 or substring-after($.,';')=1024" Error="None" Title="Intelligent Message Filter gateway action" Text="Messages with an spam confidence level (SCL) greater than or equal to {9} will be untouched at the gateway." P9="substring($.,1,1)"/>
								<Rule Name="fUceBlockThresholdDelete" Query="$fUceEnabled and bitwise-and(substring-after($.,';'),1) and not(bitwise-and(substring-after($.,';'),4))" Error="None" Title="Intelligent Message Filter gateway action" Text="Messages with an spam confidence level (SCL) greater than or equal to {9} will be deleted at the gateway." P9="substring($.,1,1)"/>
								<Rule Name="fUceBlockThresholdReject" Query="$fUceEnabled and bitwise-and(substring-after($.,';'),2)" Error="None" Title="Intelligent Message Filter gateway action" Text="Messages with an spam confidence level (SCL) greater than or equal to {9} will be rejected at the gateway." P9="substring($.,1,1)"/>
								<Rule Name="fUceBlockThresholdArchive" Query="$fUceEnabled and bitwise-and(substring-after($.,';'),4) and bitwise-and(substring-after($.,';'),1)" Error="None" Title="Intelligent Message Filter gateway action" Text="Messages with an spam confidence level (SCL) greater than or equal to {9} will be archived at the gateway." P9="substring($.,1,1)"/>
							</Setting>
							<Setting Key1="wWWHomePage">
								<Rule Name="fPerimeterIPExists" Query="count($.) &gt;0" Error="None" Title="Perimeter IP list" Text="Perimeter IP list contains entries for Sender ID and Connection filtering."/>
							</Setting>
						</Object>
						<!--Check IMFV1 settings for TiSP1-->
						<Object Type="Group" Name="IMFV1" SecurityContext="EXLOGON">
							<Object Type="Registry" Key1="%varExName%" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\Setup">
								<Setting Key1="Services" Substitution="EXCHBINPATHD" SubstitutionFormat="\\----\\"/>
								<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\MSCFv1\\MSExchange.UceContentFilter.dll'">
									<Setting Key1="Version">
										<Rule Name="fIMFV1Installed" Query="$." Error="None" Title="Intelligent Message Filter V1 installed" Text="The Exchange Server 2003 SP1 version of Intelligent Message Filter is installed on this server."/>
									</Setting>
								</Object>
							</Object>
							<Object Type="Registry" Key1="%varExName%" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\ContentFilter">
								<Setting Key1="ContentFilteringBindings">
									<Rule Name="fIMFV1Enabled" Query="$fIMFV1Installed and $.!=''" Error="Warning" Sev="3" Title="The Exchange Server 2003 SP1 version of Intelligent Message Filter is enabled" Text="The Exchange Server 2003 RTM or SP1 version of Intelligent Message Filter is enabled on server {2}." S2="%varExName%" GUID="b98bc9f3-5c09-4a5b-874e-3b66be1663e4"/>
								</Setting>
							</Object>
						</Object>
						<!-- Now Check virtual server settings -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%varExDN%" Key3="objectClass=protocolCfgSMTPServer" SecurityContext="EXLOGON">
							<Setting Key1="adminDisplayName" Retrieve="FailHard">
								<Rule Name="szSMTPInstanceName" Query="$."/>
							</Setting>
							<Setting Key1="msExchServerBindingsFiltering">
								<Rule Name="fSMTPServerBindingsFilteringRecipient" Query="bitwise-and(substring-after(substring-after(substring-after($.,':'),':'),':'), 1)" Error="None" Title="Recipient filtering on SMTP VS" Text="Recipient filtering is set for SMTP instance '{3}' on server {2}." S2="%varExName%" P3="$szSMTPInstanceName"/>
								<Rule Name="fSMTPServerBindingsFilteringConnection" Query="bitwise-and(substring-after(substring-after(substring-after($.,':'),':'),':'), 2)" Error="None" Title="Connection filtering on SMTP VS" Text="Connection filtering is set for SMTP instance '{3}' on server {2}." S2="%varExName%" P3="$szSMTPInstanceName"/>
								<Rule Name="fSMTPServerBindingsFilteringIMF" Query="bitwise-and(substring-after(substring-after(substring-after($.,':'),':'),':'), 8)" Error="None" Title="Intelligent Message Filter on SMTP VS" Text="Intelligent Message Filter is set for SMTP instance '{3}' on server {2}." S2="%varExName%" P3="$szSMTPInstanceName"/>
								<Rule Name="fSMTPServerBindingsFilteringSenderID" Query="bitwise-and(substring-after(substring-after(substring-after($.,':'),':'),':'), 16)" Error="None" Title="Sender ID filtering on SMTP VS" Text="Sender ID filtering is set for SMTP instance '{3}' on server {2}." S2="%varExName%" P3="$szSMTPInstanceName"/>
								<Rule Name="fRecipientFilteringEnabled" Query="($fRecipTurfListNames or $fRecipDirectoryEnabled) and $fSMTPServerBindingsFilteringRecipient" Error="Warning" Sev="3" Title="Recipient filtering enabled" Text="Recipient filtering is effectively enabled on server {2} as it is configured both at Global Settings and SMTP virtual server. Please ensure that it is not blocking authentic messages." S2="%varExName%" GUID="f8fae0b9-2e3c-4c72-a68c-dc30d3a02ce5"/>
								<Rule Name="fConnectionFilteringEnabled" Query="($fBlockListExists or $fGlobalAcceptExists or $fGlobalDenyExists) and $fSMTPServerBindingsFilteringConnection" Error="Warning" Sev="3" Title="Connection filtering enabled" Text="Connection filtering is effectively enabled on server {2} as it is configured both at Global Settings and SMTP virtual server. Please ensure that it is not blocking authentic messages." S2="%varExName%" GUID="c5c9bd0f-7677-4301-bb56-9cd617a1fdb9"/>
								<Rule Name="fIMFV2Enabled" Query="$fUceEnabled and $fSMTPServerBindingsFilteringIMF" Error="Warning" Sev="3" Title="The Exchange Server 2003 SP2 version of Intelligent Message Filter enabled" Text="The Exchange Server 2003 SP2 version of Intelligent Message Filter is effectively enabled on server {2} as it is configured both at Global Settings and SMTP virtual server. Please ensure that it is not blocking authentic messages." S2="%varExName%" GUID="5d746dff-8e4b-4dc0-9d95-036cc3c99daa"/>
								<Rule Name="fSenderIDEnabled" Query="$fPerimeterIPExists and $fSMTPServerBindingsFilteringSenderID" Error="Warning" Sev="3" Title="Sender ID filtering enabled" Text="Sender ID filtering is effectively enabled on server {2} as it is configured both at Global Settings and SMTP virtual server. Please ensure that it is not blocking authentic messages." S2="%varExName%" GUID="214ca7a5-8f08-4ca9-84c2-280b11cf9809"/>
							</Setting>
							<Setting Key1="msExchServerBindingsTurflist">
								<Rule Name="fSMTPServerBindingsTurflistSender" Query="count($.) &gt;0" Error="None" Title="Sender filtering on SMTP VS" Text="Sender filtering is set for SMTP instance '{3}' on server {2}." S2="%varExName%" P3="$szSMTPInstanceName"/>
								<Rule Name="fSenderFilteringEnabled" Query="($fTurfListNames or $fFilterBlankSenderEnabled) and $fSMTPServerBindingsTurflistSender" Error="Warning" Sev="3" Title="Sender filtering enabled" Text="Sender filtering is effectively enabled on server {2} as it is configured both at Global Settings and SMTP virtual server. Please ensure that it is not blocking authentic messages." S2="%varExName%" GUID="79144969-3cbb-4d6e-8ca9-a423d3f06a4b"/>
							</Setting>
							<Setting Key1="msExchSmtpInboundCommandSupportOptions">
								<Rule Name="fESMTPDSNDisabled" Query="not(bitwise-and($.,64))" Error="Warning" Sev="2" Title="ESMTP {0} verb not supported" Text="SMTP instance '{3}' on server {2} does not support the {0} Extended Simple Mail Transfer Protocol (ESMTP) verb." S0="DSN" S2="%varExName%" P3="$szSMTPInstanceName" GUID="dee368b2-dd81-42cb-8757-b44ebfaffc9f"/>
								<Rule Name="fESMTPEtrnDisabled" Query="not(bitwise-and($.,128))" Error="Warning" Sev="2" Title="ESMTP {0} verb not supported" Text="SMTP instance '{3}' on server {2} does not support the {0} Extended Simple Mail Transfer Protocol (ESMTP) verb." S0="ETRN" S2="%varExName%" P3="$szSMTPInstanceName" GUID="dee368b2-dd81-42cb-8757-b44ebfaffc9f"/>
								<Rule Name="fESMTPTurnAtrnDisabled" Query="not(bitwise-and($.,1024))" Error="Warning" Sev="2" Title="ESMTP {0} verbs not supported" Text="SMTP instance '{3}' on server {2} does not support the {0} Extended Simple Mail Transfer Protocol (ESMTP) verbs." S0="TURN/ATRN" S2="%varExName%" P3="$szSMTPInstanceName" GUID="dee368b2-dd81-42cb-8757-b44ebfaffc9f"/>
								<Rule Name="fESMTPEnhancedDisabled" Query="not(bitwise-and($.,4096))" Error="Warning" Sev="2" Title="ESMTP {0} verb not supported" Text="SMTP instance '{3}' on server {2} does not support the {0} Extended Simple Mail Transfer Protocol (ESMTP) verb." S0="ENHANCEDSTATUSCODES" S2="%varExName%" P3="$szSMTPInstanceName" GUID="dee368b2-dd81-42cb-8757-b44ebfaffc9f"/>
								<Rule Name="fESMTPChunkingDisabled" Query="not(bitwise-and($.,1048576))" Error="Warning" Sev="2" Title="ESMTP {0} verb not supported" Text="SMTP instance '{3}' on server {2} does not support the {0} Extended Simple Mail Transfer Protocol (ESMTP) verb." S0="CHUNKING" S2="%varExName%" P3="$szSMTPInstanceName" GUID="dee368b2-dd81-42cb-8757-b44ebfaffc9f"/>
								<Rule Name="fESMTPBinaryMimeDisabled" Query="not(bitwise-and($.,2097152))" Error="Warning" Sev="2" Title="ESMTP {0} verb not supported" Text="SMTP instance '{3}' on server {2} does not support the {0} Extended Simple Mail Transfer Protocol (ESMTP) verb." S0="BINARYMIME" S2="%varExName%" P3="$szSMTPInstanceName" GUID="dee368b2-dd81-42cb-8757-b44ebfaffc9f"/>
								<Rule Name="fESMTP8bitMimeDisabled" Query="not(bitwise-and($.,4194304))" Error="Warning" Sev="2" Title="ESMTP {0} verb not supported" Text="SMTP instance '{3}' on server {2} does not support the {0} Extended Simple Mail Transfer Protocol (ESMTP) verb." S0="8BITMIME" S2="%varExName%" P3="$szSMTPInstanceName" GUID="dee368b2-dd81-42cb-8757-b44ebfaffc9f"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NetworkAdapter" Key4="MacAddress!=null and ServiceName!='RasPppoe' and ServiceName!='NIC1394' and ServiceName!='PptpMiniport'" Key5="*" SecurityContext="EXLOGON">
							<Setting Key1="Caption" Substitution="NICDEVICEID" SubstitutionFormat=".0000(\d{4}).*----$1"/>
							<Object Type="Registry" Key1="%varExName%" Key3="SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\%NICDEVICEID%">
								<Setting Key1="DriverDate">
									<Rule Name="szNICDriverDate" Query="$."/>
								</Setting>
								<Setting Key1="DriverDesc">
									<Rule Name="szNICDriverDesc" Query="$."/>
								</Setting>
								<Setting Key1="DriverVersion">
									<Rule Name="szNICDriverVersion" Query="$."/>
								</Setting>
								<Setting Key1="TeamAdapters">
									<Rule Name="fNICTeamingEnabled" Query="$. &gt;0" Error="Warning" Sev="3" Title="Network interface card (NIC) teaming is enabled" Text="Network interface card (NIC) teaming is enabled on server {2}. Ensure that the latest drivers are installed. Current driver: {0} - {6} - {8}." P0="$szNICDriverDesc" S2="%varExName%" P6="$szNICDriverVersion" P8="$szNICDriverDate" GUID="8a2767f7-65f4-4a7e-b1ff-ddd7cec40de7"/>
								</Setting>
							</Object>
						</Object>

						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%varExDN%" Key3="objectClass=protocolCfgSMTPServer" SecurityContext="EXLOGON">
							<Setting Key1="msExchSmtpMaxMessageSize">
								<Rule Name="iSMTPMaxMessageSize" Query="$."/>
								<Rule Name="fSMTPMaxMessageSizeNonDefault" Query="$.!=0" Error="Warning" Sev="2" Title="SMTP configuration warning" Text="The {4} value for SMTP instance '{3}' on server {2} has been altered from its default of 0. This will cause mail flow problems if this server routes mail between Exchange servers. Current value: {9}." S2="%varExName%" P3="$szSMTPInstanceName" P4="../@Key1" P9="$." GUID="3f6bce3f-723d-4914-9c87-c61adb61583d"/>
							</Setting>
						</Object>

						<Rule Name="szCheckExchangeTransportConfig" Query="'CheckExchangeVariousTransportConfig'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fPotentialCauseFound,string(@Title),$szExNoErrorStateText)" Title="A potential issue with mail acceptance on the server was identified." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No known issues were found."/>
						<Rule Name="szTransportConfigTestResult" Query="string(@Title)" Title="Results of Transport Configuration Analysis">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>
						<Rule Name="fPotentialCauseFound" Query="$fRecipientFilteringEnabled or $fConnectionFilteringEnabled or $fIMFV2Enabled or $fSenderIDEnabled or $fSenderFilteringEnabled or $fIMFV1Enabled" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayMailAcceptanceStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>

					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="ScanMessageTracking" Title="Scan Message Tracking" Display="Left">
		<Object Type="Progress" Title="Scanning Message Tracking Logs of the Exchange Server" Text="Please wait while the tool scans the message tracking logs of the Exchange server. This process may repeat depending on the number of hops to reach the destination server." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
			<Object Type="Variable" Key1="Scalar" Display="Hide">
				<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
				<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
				<Setting Key1="%varExGWName%" Substitution="varExGWName" Display="Hide"/>
				<Setting Key1="%varMsgTrackExName%" Substitution="varMsgTrackExName" Display="Hide"/>
				<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
				<Setting Key1="%varExMessageID%" Substitution="varExMessageID" Display="Hide"/>
				<Setting Key1="%varGWProvided%" Substitution="varGWProvided" Display="Hide"/>
				<Setting Key1="%varRCPTAddress%" Substitution="varRCPTAddress" Display="Hide"/>
				<Setting Key1="%varOutboundSenderAddress%" Substitution="varOutboundSenderAddress" Display="Hide"/>
				<Setting Key1="%varOutboundRecipAddress%" Substitution="varOutboundRecipAddress" Display="Hide"/>
				<Setting Key1="%varScanMsgTrackLoopCount%" Substitution="varScanMsgTrackLoopCount" Display="Hide"/>
				<Setting Key1="%varSelSymptom%" Substitution="varSelSymptom" Display="Hide"/>
				<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
				<Object Type="Group" Name="Message Tracking Log" Class="Area" GroupingClass="True" Display="Hide">
					<!-- Use Cache as there may be multiple servers to query against -->
					<Object Type="Cache" Name="MsgTrackServerList" Key1="Add" Key2="MsgTrackServer" Key3="%varMsgTrackExName%" Key4="," Display="Hide" Class="Server" GroupingClass="True">
						<Setting Key1="MsgTrackServer" Substitution="MSGTRACKEXNAME"/>
						<!-- Access the message tracking log of each Exchange server on the path -->
						<Object Type="WMI" Key1="%MSGTRACKEXNAME%" Key2="root\MicrosoftExchangeV2" Key3="Exchange_MessageTrackingEntry" Key4="MessageID='%varExMessageID%'" SecurityContext="EXLOGON">
							<Rule Name="fErrorAccessMessageTracking" Query="count(../Instance)=0" Error="Error" Sev="1" Title="Error accessing message tracking log" Text="Unable to scan message tracking log on server {2}. Make sure that message tracking is enabled." S2="%MSGTRACKEXNAME%" GUID="69ac3558-330c-4c55-afa1-2951fd47343b" AlwaysEvaluate="True"/>
							<Rule Name="fStuckRemoteDeliveryInbound" Query="$fQueuedforRemoteDelivery and not($fTransferredOut or $fNDRGenerated) and @S0='Inbound'" Error="Error" Sev="2" ReportIssue="Issue" Title="Test message is sitting in a 'Remote delivery' queue" Text="It appears that the test message sent from server {1} is sitting in a 'Remote delivery' queue on server {2}. Further analysis is necessary." S0="%varSelSymptom%" S1="%varExName%" S2="%MSGTRACKEXNAME%" GUID="e0d73857-a3bf-4a69-8e36-51d0ddfdc685" AlwaysEvaluate="True"/>
							<Rule Name="fStuckUnknownQueueInbound" Query="not($fErrorAccessMessageTracking or $fTransferredOut or $fNDRGenerated or $fBadMail or $fQueuedforRemoteDelivery or $fLocalDeliverySuccess or $fRetryCat or $fRetryRouting or $fRetryLocalDelivery) and @S0='Inbound'" Error="Error" Sev="2" ReportIssue="Issue" Title="Test message is sitting in one of the SMTP queues" Text="It appears that the test message sent from server {1} is sitting in one of the SMTP queues on server {2}. Further analysis is necessary." S0="%varSelSymptom%" S1="%varExName%" S2="%MSGTRACKEXNAME%" GUID="e9efcd9e-f8f5-410f-bb21-b15c6ab7da61" AlwaysEvaluate="True"/>
							<Rule Name="fStuckRemoteDeliveryOutbound" Query="$fQueuedforRemoteDelivery and not($fTransferredOut or $fNDRGenerated) and @S0='Outbound'" Error="Error" Sev="2" ReportIssue="Issue" Title="Specified message is sitting in a 'Remote delivery' queue" Text="It appears that the specified message sent from server {1} is sitting in a 'Remote delivery' queue on server {2}. Further analysis is necessary." S0="%varSelSymptom%" S1="%varExName%" S2="%MSGTRACKEXNAME%" GUID="e0d73857-a3bf-4a69-8e36-51d0ddfdc685" AlwaysEvaluate="True"/>
							<Rule Name="fStuckUnknownQueueOutbound" Query="not($fErrorAccessMessageTracking or $fTransferredOut or $fNDRGenerated or $fBadMail or $fQueuedforRemoteDelivery or $fLocalDeliverySuccess or $fRetryCat or $fRetryRouting or $fRetryLocalDelivery) and @S0='Outbound'" Error="Error" Sev="2" ReportIssue="Issue" Title="Specified message is sitting in one of the SMTP queues" Text="It appears that the specified message sent from server {1} is sitting in one of the SMTP queues on server {2}. Further analysis is necessary." S0="%varSelSymptom%" S1="%varExName%" S2="%MSGTRACKEXNAME%" GUID="e9efcd9e-f8f5-410f-bb21-b15c6ab7da61" AlwaysEvaluate="True"/>
							<Rule Name="fNeedQueueAnalysis" Query="$fRetryCat or $fRetryRouting or $fRetryLocalDelivery or $fStuckRemoteDeliveryInbound or $fStuckUnknownQueueInbound or $fStuckRemoteDeliveryOutbound or $fStuckUnknownQueueOutbound" AlwaysEvaluate="True"/>
							<Rule Name="fStuckOtherThanExGW" Query="$fNeedQueueAnalysis and lower-case('%MSGTRACKEXNAME%') != $szExGWShortName"/>
							<Rule Name="szStuckNonExGW" Query="if($fStuckOtherThanExGW, '%MSGTRACKEXNAME%')"/>
							<Rule Name="fStuckExGW" Query="$fNeedQueueAnalysis and lower-case('%MSGTRACKEXNAME%') = $szExGWShortName"/>
							<Rule Name="szNewExName" Query="if($fNeedQueueAnalysis, @S2)" S2="%MSGTRACKEXNAME%">
								<Variable Name="varExName" Scope="Children"/>
							</Rule>
							<Setting Key1="KeyID"/>
							<Setting Key1="DeliveryTime"/>
							<Setting Key1="EntryType" Substitution="ENTRYTYPE">
								<Rule Name="fSubmittedtoAQ" Query="$.='1019'" Error="None" Title="Submitted to advanced queue" Text="Server {2}: SMTP: Message submitted to advanced queue." S2="%MSGTRACKEXNAME%"/>
								<Rule Name="fStartedOutbound" Query="$.='1020'" Error="None" Title="Started outbound transfer" Text="Server {2}: SMTP: Started outbound transfer of message." S2="%MSGTRACKEXNAME%"/>
								<Rule Name="fBadMail" Query="$.='1021'" Error="Error" Sev="2" ReportIssue="Issue" Title="Test mail sent to badmail directory" Text="Server {2}: SMTP: Message sent to badmail directory. The test message sent from server {1} was sent to the badmail directory on server {2}. Recipient: {3}" S1="%varExName%" S2="%MSGTRACKEXNAME%" P3="$szRecipientAddress" GUID="4917e5a3-c284-4a7c-a0d2-f0550f33ed57"/>
								<Rule Name="fDeliveredLocally" Query="$.='1023'" Error="None" Title="Delivered locally" Text="Server {2}: SMTP: Message delivered locally" S2="%MSGTRACKEXNAME%"/>
								<Rule Name="fSubmittedtoCAT" Query="$.='1024'" Error="None" Title="Submitted to categorizer" Text="Server {2}: SMTP: Message submitted to categorizer." S2="%MSGTRACKEXNAME%"/>
								<Rule Name="fStartedSubtoAQ" Query="$.='1025'" Error="None" Title="Started submission to advanced queue" Text="Server {2}: SMTP: Started message submission to advanced queue." S2="%MSGTRACKEXNAME%"/>
								<Rule Name="fSubmittedfromStore" Query="$.=1027" Error="None" Title="Submitted from store" Text="Server {2}: SMTP Store Driver: Message submitted from store." S2="%MSGTRACKEXNAME%"/>
								<Rule Name="fLocalDeliverySuccess" Query="$.='1028'" Error="None" Title="Delivered locally to store" Text="Server {2}: SMTP Store Driver: Message sent from server {1} was delivered locally to store to {3}." S1="%varExName%" S2="%MSGTRACKEXNAME%" P3="$szRecipientAddress"/>
								<Rule Name="fNDRGenerated" Query="$.='1030'" Error="Error" Sev="1" ReportIssue="Issue" Title="Non-delivery report generated for test message." Text="Server {2}: SMTP: Non-delivery report (NDR) generated. A non-delivery report was generated on server {2} for the test message sent from server {1}." S1="%varExName%" S2="%MSGTRACKEXNAME%" GUID="32688473-93c7-42f1-8033-5fadfba84dd7"/>
								<Rule Name="fTransferredOut" Query="$.='1031'" Error="None" Title="Transferred to another server" Text="Server {2}: SMTP: Message transferred out. The test message sent from server {1} was successfully transferred to server {3}." S1="%varExName%" S2="%MSGTRACKEXNAME%" P3="$szPartnerServer"/>
								<Rule Name="fRetryCat" Query="$.='1032'" Error="Error" Sev="2" ReportIssue="Issue" Title="Retry categorization" Text="Server {2}: SMTP: Message scheduled to retry categorization. The test message sent from server {1} is scheduled to retry categorization on server {2}." S1="%varExName%" S2="%MSGTRACKEXNAME%" GUID="3030f8cb-f2d4-4c54-a229-cd1bf672a880"/>
								<Rule Name="fQueuedforRouting" Query="$.='1033'" Error="None" Title="Queued for routing" Text="Server {2}: SMTP: Message categorized and queued for routing." S2="%MSGTRACKEXNAME%"/>
								<Rule Name="fQueuedforRemoteDelivery" Query="$.='1034'" Error="None" Title="Queued for remote delivery" Text="Server {2}: SMTP: Message routed and queued for remote delivery." S2="%MSGTRACKEXNAME%"/>
								<Rule Name="fRetryRouting" Query="$.='1035'" Error="Error" Sev="2" ReportIssue="Issue" Title="Retry routing" Text="Server {2}: SMTP: Message scheduled to retry routing. The test message sent from server {1} is scheduled to retry routing on server {2}." S1="%varExName%" S2="%MSGTRACKEXNAME%" GUID="d73fb3ae-eb5c-4a9a-8e88-85877c471a0f"/>
								<Rule Name="fQueuedLocalDelivery" Query="$.='1036'" Error="None" Title="Queued for local delivery" Text="Server {2}: SMTP: Message queued for local delivery." S2="%MSGTRACKEXNAME%"/>
								<Rule Name="fRetryLocalDelivery" Query="$.='1037'" Error="Error" Sev="2" ReportIssue="Issue" Title="Retry local delivery" Text="Server {2}: SMTP: Message scheduled to retry local delivery. The test message sent from server {1} is scheduled to retry local delivery on server {2}." S1="%varExName%" S2="%MSGTRACKEXNAME%" GUID="1cfa212c-24b1-42c0-81d9-22932e271f92"/>
							</Setting>
							<Setting Key1="OriginationTime"/>
							<Setting Key1="AttemptedPartnerServer"/>
							<Setting Key1="PartnerServer" Substitution="REMOTEFQDN">
								<Rule Name="szPartnerServer" Query="lower-case(substring-before($.,'.'))"/>
								<Rule Name="fRoutedExternal" Query="string-length($.) &gt;0 and not($fDirectoryException) and count($szPartnerSMTPVS) &lt;1" AlwaysEvaluate="True"/>
								<Rule Name="szExternalPartnerServer" Query="if($fRoutedExternal, lower-case($.))"/>
							</Setting>
							<Setting Key1="RecipientAddress">
								<Rule Name="szRecipientAddress" Query="$."/>
							</Setting>
							<Setting Key1="ServerName"/>
							<Setting Key1="ServerIP"/>
							<Setting Key1="Version"/>
							<Object Type="If" Key1="'%ENTRYTYPE%'='1031'">
								<Setting Key1="Gateway">
									<Rule Name="fSentButNotExGW" Query="$fRoutedExternal and @S1='Outbound' and lower-case('%MSGTRACKEXNAME%') != $szExGWShortName" Error="Warning" Sev="2" Title="Specified gateway server not used" Text="The message submitted by '{4}' to '{3}' was routed outside the Exchange organization by server {2} whereas the specified Exchange gateway server was {0}. Please check the routing topology and the specified gateway is correct." P0="$szExGWShortName" S1="%varSelSymptom%" S2="%MSGTRACKEXNAME%" S3="%varOutboundRecipAddress%" S4="%varOutboundSenderAddress%" GUID="56103632-2d6b-4f7b-9ec3-d55da5401bd9"/>
								</Setting>
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%varExOrgDN%" Key3="(&amp;(objectCategory=protocolCfgSMTPServer)(msExchSmtpFullyQualifiedDomainName=%REMOTEFQDN%))">
									<Rule Name="fDirectoryException" Query="../Exception/@Message" Error="Error" Sev="2" Title="Directory data cannot be accessed" Text="Cannot collect directory data from server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="../Exception/@Message" S2="%varDCName%" GUID="b15f87cc-938a-48f8-a14e-24ce1aef5b61"/>
									<Setting Key1="distinguishedName" Substitution="SERVERNAME" SubstitutionFormat="^CN=.*?,CN=.*?,CN=.*?,CN=(.*?[^\\]),.*$----$1">
										<Rule Name="szPartnerSMTPVS" Query="lower-case('%SERVERNAME%')"/>
									</Setting>
								</Object>
							</Object>
						</Object>
					</Object>

					<Object Type="Group" Name="Message Tracking Final Result">
						<Rule Name="szMsgTrackExName" Query="if(count($szPartnerSMTPVS) &gt;0, join(',', $szPartnerSMTPVS), join(',', $szPartnerServer))" AlwaysEvaluate="True">
							<Variable Name="varMsgTrackExName" Scope="Children"/>
						</Rule>

						<Rule Name="fMessageDeliverSuccess" Query="not($fErrorAccessMessageTracking) and $fLocalDeliverySuccess and not($fTransferredOut or $fNDRGenerated or $fBadMail or $fNeedQueueAnalysis)" AlwaysEvaluate="True"/>
						<Rule Name="fMessageRemoteRouteSuccess" Query="not($fErrorAccessMessageTracking) and $fTransferredOut and not($fNDRGenerated or $fBadMail or $fNeedQueueAnalysis)" AlwaysEvaluate="True"/>

						<Rule Name="fInboundTestMessageDelivered" Query="$fMessageDeliverSuccess and @S1='Inbound'" Error="None" ReportIssue="Summary" Title="No routing issue within Exchange organization" Text="It appears that the message routing within the Exchange organization is working based on the successful delivery of the message sent from server {2} to recipient {3}." S1="%varSelSymptom%" S2="%varExName%" S3="%varRCPTAddress%"/>
						<Rule Name="fInboundOtherRootCauses" Query="$fInboundTestMessageDelivered and @S0!='1'" Error="None" ReportIssue="Summary" Title="Possible external problem" Text="Based on the successful delivery of the message sent from server {2} to recipient {3}, external factors may be related to the symptom. If you suspect there is still a problem within the Exchange organization, specify a different server and mail address and rerun the tool. Alternatively, check the corporate firewall and non-Exchange gateway servers if they exist." S0="%varGWProvided%" S2="%varExName%" S3="%varRCPTAddress%"/>

						<Rule Name="fOutboundMessageDeliveredWithinOrg" Query="$fMessageDeliverSuccess and @S1='Outbound'" Error="None" Title="Message successfully delivered within organization" Text="The message submitted by '{4}' was delivered successfully to recipient '{3}'. It appears that this message was not addressed to external recipients." S1="%varSelSymptom%" S3="%varOutboundRecipAddress%" S4="%varOutboundSenderAddress%"/>
						<Rule Name="fOutboundMessageRoutedExternal" Query="$fMessageRemoteRouteSuccess and $fRoutedExternal and @S1='Outbound'" Error="None" Title="Message successfully routed outside Exchange organization" Text="The message submitted by '{4}' to '{3}' was routed to server {2}, which resides outside of the Exchange organization." S1="%varSelSymptom%" P2="join(',', $szExternalPartnerServer)" S3="%varOutboundRecipAddress%" S4="%varOutboundSenderAddress%" AlwaysEvaluate="True"/>
						<Rule Name="fOutboundMessageStuckOtherThanExGW" Query="$fStuckOtherThanExGW and @S1='Outbound'" Error="Error" Sev="2" ReportIssue="Summary" Title="Possible non-gateway problem" Text="The message submitted by '{4}' to '{3}' appears to be stuck on non-gateway server {2}. Further analysis is necessary to determine whether messages may not go out to the Internet due to this." S1="%varSelSymptom%" P2="$szStuckNonExGW" S3="%varOutboundRecipAddress%" S4="%varOutboundSenderAddress%" GUID="46e41d0f-5503-43b4-8cef-e008b8c25ad2"/>
						<Rule Name="fOutboundMessageStuckExGW" Query="$fStuckExGW and @S1='Outbound'" Error="Error" Sev="2" ReportIssue="Summary" Title="Possible gateway problem" Text="The message submitted by '{4}' to '{3}' appears to be stuck on Exchange gateway server {2}. Further analysis is necessary to determine whether messages may not go out to the Internet due to this." S1="%varSelSymptom%" P2="$szExGWShortName" S3="%varOutboundRecipAddress%" S4="%varOutboundSenderAddress%" GUID="2d22c11e-902f-418f-8378-0ff2972a878d"/>

						<Rule Name="szSwitchSymptom" Query="if($fNeedQueueAnalysis, 'Queue', '%varSelSymptom%')" AlwaysEvaluate="True">
							<Variable Name="varSelSymptom" Scope="Children"/>
						</Rule>

						<Rule Name="iScanMsgTrackLoopCount" Query="@S9 + 1" S9="%varScanMsgTrackLoopCount%">
							<Variable Name="varScanMsgTrackLoopCount" Scope="Children"/>
						</Rule>
						<Rule Name="fScanMsgTrackLoopExceedsMax" Query="not($fErrorAccessMessageTracking) and $fTransferredOut and not($fNeedQueueAnalysis) and not($fNDRGenerated) and not($fBadMail) and @S9 = 30" Error="Error" Sev="1" Title="Too many hops" Text="The test message exceeds {9} hops. The tool aborts scanning message tracking logs for safety reasons." S9="%varScanMsgTrackLoopCount%" GUID="7ec6aca9-4bc4-47e9-96f4-8098dcf1a26e" AlwaysEvaluate="True"/>
					</Object>

					<Rule Name="szCheckMessageTracking" Query="'ScanMessageTracking'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fErrorAccessMessageTracking or $fNeedQueueAnalysis or $fNDRGenerated or $fBadMail, string(@Title), $szExNoErrorStateText)" Title="One or more errors were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="Message Tracking test passed."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Message Tracking Test Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="szExGWShortName" Query="if('%varExGWName%'='', lower-case('%varExName%'), if(contains('%varExGWName%', '.'), lower-case(substring-before('%varExGWName%', '.')), lower-case('%varExGWName%')))">
						<Variable Name="varExGWName" Scope="Children"/>
					</Rule>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayMessageTrackingStep" Query="@S1='0' and ($fErrorAccessMessageTracking or $fScanMsgTrackLoopExceedsMax or $fMessageDeliverSuccess or $fOutboundMessageRoutedExternal or $fNeedQueueAnalysis or $fNDRGenerated or $fBadMail)" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="ScanMessageTracking" Name="fRepeatScanMessageTracking" Query="$fMessageRemoteRouteSuccess and not($fOutboundMessageRoutedExternal or $fScanMsgTrackLoopExceedsMax)" Priority="2" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckQueueStatus" Name="fGotoCheckQueue" Query="$fNeedQueueAnalysis and $szNewExName=@S2" Priority="3" Text="- Check the status of various queues of server {1}." P1="$szNewExName" S2="%varExName%" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RetrieveBasicServerData" Name="fFirstNeedBasicData" Query="$fNeedQueueAnalysis and $szNewExName!=@S2" Priority="4" Text="- Retrieve basic information of server {1} and then check the status of queues" P1="$szNewExName" S2="%varExName%"/>
					<Rule NextStep="CheckExGateway" Name="fGotoCheckExGateway" Query="not($fRepeatScanMessageTracking) and @S1='Outbound'" Priority="5" Text="- Check the specified Exchange gateway server for possible issues" S1="%varSelSymptom%" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="ConnectNonExGateway" Name="fGotoConnectNonExGateway" Query="($fInboundTestMessageDelivered and @S0='1') or ($fOutboundMessageRoutedExternal and not($fSentButNotExGW) and @S0='1')" Priority="5" Text="- It appears that the message routing within the Exchange organization is working. The tool will check the non-Exchange gateway server next." S0="%varGWProvided%" Display="Hide" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="ScanE12MessageTracking" Title="Scan Message Tracking" Display="Left">
		<Object Type="Progress" Title="Scanning Message Tracking Logs of the Exchange Server" Text="Please wait while the tool scans the message tracking logs of the Exchange server. This process may repeat depending on the number of hops to reach the destination server.">
			<Object Type="Variable" Key1="Scalar" Display="Hide">
				<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
				<Setting Key1="%varSelSymptom%" Substitution="varSelSymptom" Display="Hide"/>
				<Setting Key1="%varE12DSNFilter%" Substitution="varE12DSNFilter" Display="Hide"/>
				<Setting Key1="%varConnectivityLogPath%" Substitution="varConnectivityLogPath" Display="Hide"/>
				<Setting Key1="%varMessageExpirationTimeout%" Substitution="varMessageExpirationTimeout" Display="Hide"/>
				<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
				<Setting Key1="%varMsgTrackExName%" Substitution="varMsgTrackExName" Display="Hide"/>
				<Setting Key1="%varExMessageID%" Substitution="varExMessageID" Display="Hide"/>
				<Setting Key1="%varGWProvided%" Substitution="varGWProvided" Display="Hide"/>
				<Setting Key1="%varRCPTAddress%" Substitution="varRCPTAddress" Display="Hide"/>
				<Setting Key1="%varScanMsgTrackLoopCount%" Substitution="varScanMsgTrackLoopCount" Display="Hide"/>
				<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
				<Object Type="Group" Name="Message Tracking" Class="Area" GroupingClass="True" Display="Hide">
					<!-- Use Cache as there may be multiple servers to query against -->
					<Object Type="Cache" Name="MsgTrackServerList" Key1="Add" Key2="MsgTrackServer" Key3="%varMsgTrackExName%" Key4="," Display="Hide" Class="Server" GroupingClass="True">
						<Setting Key1="MsgTrackServer" Substitution="MSGTRACKEXNAME"/>

						<Object Type="If" Name="Retrieve Message Tracking Log" Key1="true()" Display="Hide">
							<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(7 * 24 * 3600)))" Substitution="STARTTIME" Display="Hide"/>
							<Setting Key1="if('%varSelSymptom%'='NDR', '-EventID FAIL | where {$_.RecipientStatus -match &quot;%varE12DSNFilter%&quot;}', '-MessageId &quot;%varExMessageID%&quot;')" Substitution="MSGTRACKPARAMETERS" Display="Hide"/>

							<!-- Access the message tracking log of each Exchange server on the path -->
							<!--Get-MessageTrackingLog does not support the -domainController parameter-->
							<Object Type="MonadCommand" Key1="get-MessageTrackingLog -Server %MSGTRACKEXNAME% -Start &quot;%STARTTIME%&quot; %MSGTRACKPARAMETERS%" TrackProgress="TrackProgress">
								<Rule Name="fExceptionAccessMessageTracking" Query="count(../Exception) &gt; 0" Error="Error" Title="Error accessing message tracking log" Text="An exception occurred while executing the command '{3}' to query the message tracking logs on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%MSGTRACKEXNAME%" S3="get-MessageTrackingLog"/>
								<Rule Name="fErrorAccessMessageTracking" Query="count(../Instance)=0 and not($fExceptionAccessMessageTracking)" Error="Warning" Sev="1" Title="Unable to find message tracking log events" Text="Unable to find message tracking log events since {3} on server {2}. Make sure that message tracking is enabled." S2="%MSGTRACKEXNAME%" S3="%STARTTIME%" AlwaysEvaluate="True"/>
								<Rule Name="fNeedQueueAnalysis" Query="$fPotentialQueueProblem and $fFailed" AlwaysEvaluate="True"/>
								<Rule Name="szNewExName2" Query="if($fNeedQueueAnalysis, @S2)" S2="%MSGTRACKEXNAME%">
									<Variable Name="varExName" Scope="Children"/>
								</Rule>
								<Setting Key1="Timestamp" Substitution="TIMESTAMP">
									<!-- Need to figure out what to do here
									<Rule Name="dFailEvtAdjustGMTinSec" Template="tEvtAdjustGMTinSec" />
									<Rule Name="dFailEvtRawTimeDiffinSec" Query="get-seconds(date-difference(@S8, $.), 'yyyyMMddHHmmss')" S8="%varCurrentDateTime%" />
									<Rule Name="fFailEvtWithinLast24hours" Query="($dFailEvtRawTimeDiffinSec + $dFailEvtAdjustGMTinSec) &lt; 86400" Error="Warning" Sev="2" Title="A transport connection manager 'FAIL' event was logged within the last 24 hours" Text="There was a '{9}' event with Internal Message ID of '{1}' in the application log of server {2} from the source component '{5}' that resulted in a '{6}' problem." S1="%MessageId%" S2="%varExName%" S5="%Source%" S6="%RecipientStatus%" S9="FAIL" />
									-->
								</Setting>
								<Setting Key1="EventId">
									<Rule Name="fReceived" Query="$.='RECEIVE'" Error="None" Title="Message received by SMTP" Text="Server {1}: The message was received by SMTP protocol." S1="%varExName%"/>
									<Rule Name="fSend" Query="$.='SEND'" Error="None" Title="Message sent by SMTP" Text="Server {1}: The message was sent by SMTP protocol." S1="%varExName%"/>
									<Rule Name="fFailedDelivery" Query="$.='FAIL' and matches('%varE12DSNFilter%','^(\d)\.(\d)\.(\d)')" Error="Error" Sev="2" ReportIssue="Issue" AlwaysEvaluate="True" Title="Message delivery to '{8}' failed on server {2}" Text="A message tracking log entry was generated on server {2} at {6} indicating that a message sent by {4} could not be delivered to '{8}'. Check the status to determine the reason for the failure. Recipients: {3} Status: {7}" S2="%MSGTRACKEXNAME%" P3="$szRecipientAddresses" P4="$szSender" S6="%TIMESTAMP%" P7="$szRecipientStatus" P8="$szRecipientAddressRHS"/>
									<Rule Name="fFailed" Query="$.='FAIL' and not($fFailedDelivery)" Error="Error" Sev="2" ReportIssue="Issue" Title="Test mail sent failed" Text="Server {2}: SMTP: Message failed to be processed. The test message sent from server {1} was sent to the badmail directory on server {2}. Recipient: {3}" S1="%varExName%" S2="%MSGTRACKEXNAME%" P3="$szRecipientAddresses"/>
									<Rule Name="fNDRGenerated" Query="$.='DSN'" Error="Error" Sev="1" ReportIssue="Issue" Title="Non-delivery report generated for test message." Text="Server {2}: SMTP: Non-delivery report (NDR) generated. A non-delivery report was generated on server {2} for the test message sent from server {1}." S1="%varExName%" S2="%MSGTRACKEXNAME%"/>
									<Rule Name="fDeliveredLocally" Query="$.='DELIVER'" Error="None" Title="Delivered locally" Text="Server {2}: SMTP: Message delivered locally" S2="%MSGTRACKEXNAME%"/>
									<Rule Name="fBadMail" Query="$.='BADMAIL'" Error="Error" Sev="2" ReportIssue="Issue" Title="Test mail sent to badmail directory" Text="Server {2}: SMTP: Message sent to badmail directory. The test message sent from server {1} was sent to the badmail directory on server {2}. Recipient: {3}" S1="%varExName%" S2="%MSGTRACKEXNAME%" P3="$szRecipientAddresses"/>
									<Rule Name="fRecipientResolved" Query="$.='RESOLVE'" Error="None" Title="Recipient Resolved" Text="Server {2}: The recipient on the message sent from server {1} was successfully resolved." S1="%varExName%" S2="%MSGTRACKEXNAME%"/>
									<Rule Name="fDLExpanded" Query="$.='EXPAND'" Error="None" Title="Distribution Group Expanded" Text="Server {2}: The distribution group on the message sent from server {1} was successfully expanded." S1="%varExName%" S2="%MSGTRACKEXNAME%"/>
									<Rule Name="fRecipientRedirected" Query="$.='REDIRECT'" Error="None" Title="Recipient Redirected" Text="Server {1}: The message was redirected (e.g. alternate recipient)." S1="%varExName%"/>
									<Rule Name="fTransferredOut" Query="$.='TRANSFER'" Error="None" Title="Transferred to another server" Text="Server {2}: SMTP: Message transferred out. The test message sent from server {1} was successfully transferred." S1="%varExName%" S2="%MSGTRACKEXNAME%"/>
									<Rule Name="fMapiSubmit" Query="$.='SUBMIT'" Error="None" Title="Submitted to Transport from Mailbox Server" Text="Server {2}: SMTP: Message submitted to transport." S2="%MSGTRACKEXNAME%"/>
								</Setting>
								<Setting Key1="ClientIp"/>
								<Setting Key1="ClientHostname" Substitution="ClientHostname"/>
								<Setting Key1="ServerIp" Substitution="SERVERIP">
									<Rule Name="szServerIp" Query="$."/>
									<Rule Name="szPartnerServer" Query="resolve($.)"/>
									<Rule Name="fServerIpName" Query="$.!=''"/>
								</Setting>
								<Setting Key1="ServerHostname" Substitution="ServerHostname"/>
								<Setting Key1="SourceContext"/>
								<Setting Key1="ConnectorId" Substitution="CONNECTORID">
									<Rule Name="szConnectorId" Query="$."/>
									<Rule Name="fMessageRelayed" Query="($fSend and contains(upper-case($.), 'INTRAORG SMTP SEND CONNECTOR')) or $fDeliveredLocally"/>
								</Setting>
								<Setting Key1="Source" Substitution="SOURCE">
									<Rule Name="szSource" Query="$."/>
									<Rule Name="fPotentialQueueProblem" Query="$.='STOREDRIVER' or $.='ROUTING'"/>
								</Setting>
								<Setting Key1="MessageId" Substitution="MESSAGE"/>
								<Setting Key1="Recipients">
									<Rule Name="szRecipientAddresses" Query="join(',', $.)"/>
									<Rule Name="szRecipientAddressRHS" Query="replace($., '(.*?)\@(.*)', '$2')"/>
								</Setting>
								<Setting Key1="RecipientStatus">
									<Rule Name="szRecipientStatus" Query="$."/>
									<Rule Name="fRecipientStatus544NonExistentDomain" Query="contains($.,'5.4.4') and contains($.,'NonExistentDomain')"/>
									<Rule Name="fRecipientStatus571" Query="contains($.,'5.7.1')"/>
								</Setting>
								<Setting Key1="TotalBytes"/>
								<Setting Key1="RecipientCount"/>
								<Setting Key1="RelatedRecipientAddress"/>
								<Setting Key1="Reference"/>
								<Setting Key1="MessageSubject"/>
								<Setting Key1="Sender">
									<Rule Name="szSender" Query="$."/>
								</Setting>
								<Setting Key1="ReturnPath"/>
								<Setting Key1="MessageInfo"/>

								<Rule Name="szAllRecipientAddressRHS" Query="join(',',$szRecipientAddressRHS)">
									<Variable Name="varAllRemoteServerDomain" Scope="Children"/>
								</Rule>
								<Rule Name="szAllRemoteServerFQDN" Query="''">
									<Variable Name="varAllRemoteServerFQDN" Scope="Children"/>
								</Rule>

								<Rule Name="fFailedDeliveryMany" Query="count($fFailedDelivery) &gt; 0 and matches('%varE12DSNFilter%','^(\d)\.(\d)\.(\d)')" Error="Error" Sev="2" ReportIssue="Summary" AlwaysEvaluate="True" Title="Found {1} message tracking log entries indicating delivery failure with delivery status '{3}'" Text="A total of {1} message tracking log entries were generated on server {2} indicating that messages could not be delivered with delivery status notification code '{3}'." P1="count($fFailedDelivery)" S2="%MSGTRACKEXNAME%" S3="%varE12DSNFilter%"/>
								<Rule Name="fRecipientStatus544Many" Query="count($fRecipientStatus544NonExistentDomain) &gt; 0" Error="None" ReportIssue="Recommendation" AlwaysEvaluate="True" Title="One or more messages have failed delivery due to DNS response 'non-existent domain'" Text="One or more messages have failed delivery due to DNS response 'non-existent domain'.  This will occur if one of the DNS servers in use does not know how to resolve the recipient domain.  Check the recipient domain and ensure it is correct.  If you believe this response was received in error, the connectivity log should be enabled to determine which DNS server is providing the incorrect response. The connectivity log can be enabled within the Exchange Management Shell by issuing the command &quot;Set-TransportServer -Identity '{2}' -ConnectivityLogEnabled:$TRUE&quot;. The log is located in directory {3}" S1="5.4.4" S2="%MSGTRACKEXNAME%" S3="%varConnectivityLogPath%"/>
								<Rule Name="fRecipientStatus571Many" Query="count($fRecipientStatus571) &gt; 0" Error="None" ReportIssue="Recommendation" AlwaysEvaluate="True" Title="One or more messages have failed delivery due to reason '{1}'" Text="One or more messages have failed delivery due to insufficient permissions on the remote server.  If the remote server is in another domain, the message may have been rejected due to an IP Block List or IP Block List Provider. Please contact the remote system administrator to have your IP address added to the IP Allow List. If your server is being blocked by several domains, please review additional information available in Microsoft Support Knowledge Base article 928123." S1="5.7.1"/>

							</Object>

						</Object>
					</Object>

					<Rule Name="szCheckE12MessageTracking" Query="'ScanE12MessageTracking'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fErrorAccessMessageTracking or $fNeedQueueAnalysis or $fNDRGenerated or $fBadMail, string(@Title), $szExNoErrorStateText)" Title="One or more errors were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="Message Tracking test passed."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Message Tracking Test Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<!-- Need to add the Foreign Connectors
						<Rule Name="szMsgTrackExName" Query="join(',', $szPartnerServer)" >
							<Variable Name="varMsgTrackExName" Scope="Children" />
						</Rule>
						-->

					<Rule Name="fInboundOtherRootCauses" Query="not($fErrorAccessMessageTracking) and not($fTransferredOut) and $fDeliveredLocally and not($fNDRGenerated) and not($fBadMail) and not($fNeedQueueAnalysis) and @S1!='1'" Error="None" ReportIssue="Summary" Title="Test message successfully delivered" Text="It appears that the message routing within the Exchange organization is okay based on the successful delivery of the message sent from server {2} to recipient {3}. If you suspect there is still a problem, specify a different server and mail address and rerun the tool. Alternatively, check the corporate firewall and non-Exchange gateway servers if they exist." S1="%varGWProvided%" S2="%varExName%" S3="%varRCPTAddress%" AlwaysEvaluate="True"/>
					<Rule Name="szSwitchSymptom" Query="if($fNeedQueueAnalysis, 'Queue', 'Inbound')" AlwaysEvaluate="True">
						<Variable Name="varSelSymptom" Scope="Children"/>
					</Rule>

					<Rule Name="iScanMsgTrackLoopCount" Query="@S9 + 1" S9="%varScanMsgTrackLoopCount%">
						<Variable Name="varScanMsgTrackLoopCount" Scope="Children"/>
					</Rule>
					<Rule Name="fScanMsgTrackLoopExceedsMax" Query="not($fErrorAccessMessageTracking) and $fTransferredOut and not($fNeedQueueAnalysis) and not($fNDRGenerated) and not($fBadMail) and @S9 = 10" Error="Error" Sev="1" Title="Too many hops" Text="The test message exceeds {9} hops. The tool aborts scanning message tracking logs for safety reasons." S9="%varScanMsgTrackLoopCount%" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayE12MessageTrackingStep" Query="@S1='0' and ($fErrorAccessMessageTracking or $fScanMsgTrackLoopExceedsMax or (not($fMessageRelayed) and $fDeliveredLocally) or $fNeedQueueAnalysis or $fNDRGenerated or $fBadMail)" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="ScanE12MessageTracking" Name="fRepeatScanE12MessageTracking" Query="not($fErrorAccessMessageTracking) and not($fScanMsgTrackLoopExceedsMax) and $fMessageRelayed and not($fNeedQueueAnalysis) and not($fNDRGenerated) and not($fBadMail)" Priority="2" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckE12QueueStatus" Name="fGotoCheckQueue" Query="$fNeedQueueAnalysis and $szNewExName2=@S2" Priority="3" Text="- Check the status of various queues of server {1}." P1="$szNewExName2" S2="%varExName%" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RetrieveBasicServerData" Name="fFirstNeedBasicData" Query="$fNeedQueueAnalysis and $szNewExName2!=@S2" Priority="4" Text="- Retrieve basic information of server {1} and then check the status of queues" P1="$szNewExName2" S2="%varExName%"/>
					<Rule NextStep="RDCheckDNS" Name="fGotoRDCheckDNS" Query="$fRecipientStatus544Many" Priority="5" Text="- Check whether the server can connect to the DNS service and retrieve the necessary records of remote domains" Display="Hide" AlwaysEvaluate="True"/>

					<!-- Need to figure out the Foreign Connector checks
						<Rule NextStep="ConnectNonExGateway" Name="fGotoConnectNonExGateway" Query="not($fErrorAccessMessageTracking) and not($fTransferredOut) and $fDeliveredLocally and not($fNDRGenerated) and not($fNeedQueueAnalysis) and @S1='1'" Priority="5" Text="- It appears that the message routing within the Exchange organization is okay. The tool will check the non-Exchange gateway server next." S1="%varGWProvided%" Display="Hide" AlwaysEvaluate="True" />
					-->
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="ConnectNonExGateway" Title="Non-Exchange Gateway Connectivity Check" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varGWName%" Substitution="varGWName" Display="Hide"/>
			<Setting Key1="%varGWSMTPPort%" Substitution="varGWSMTPPort" Display="Hide"/>
			<Setting Key1="%varRCPTAddress%" Substitution="varRCPTAddress" Display="Hide"/>
			<Setting Key1="%varMAILFROMAddress%" Substitution="varMAILFROMAddress" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<!-- This step is optional and only conducted when the user inputs the non-Exchange server gateway info -->

			<Object Type="Progress" Title="Checking Connectivity to the Non-Exchange Gateway Server" Text="Please wait while the tool checks connectivity to non-Exchange gateway server {2}." S2="%varGWName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Non-Exchange Gateway" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varGWName%" Class="Server" GroupingClass="True" Display="Hide">
						<Object Type="Resolve" Name="ResolveGW" Key1="%varGWName%">
							<Setting Key1="Dns" Substitution="RESOLVEDGWNAME" Format="\..*----">
								<Rule Name="fResolveGWNameFailed" Query="$.!=@S2" Error="Error" Sev="1" Title="DNS name resolution failure" Text="DNS name resolution failed for server {2}. Check your DNS configuration or ensure that the name of the server is correct." S2="%varGWName%" GUID="c1e33f44-aa05-40be-9167-4f19f2ff0908"/>
							</Setting>
						</Object>
						<Object Type="Group" Name="Ping Test">
							<Object Type="Enumerator" Name="Ping" Key1="1" Key2="6" Key3="1">
								<Object Type="WMI" Key1="%varExName%" Key3="Win32_PingStatus" Key4="Address='%varGWName%' and BufferSize=4096" SecurityContext="EXLOGON">
									<Rule Name="fNoPing" Query="count(../Instance)=0"/>
									<Setting Key1="ResponseTime">
										<Rule Name="iPingGWRespTime" Query="$."/>
									</Setting>
									<Setting Key1="PrimaryAddressResolutionStatus"/>
									<Setting Key1="ProtocolAddress"/>
									<Setting Key1="TimeToLive"/>
									<Setting Key1="ResponseTimeToLive"/>
									<Setting Key1="NoFragmentation"/>
									<Setting Key1="BufferSize"/>
									<Setting Key1="ReplySize"/>
									<Setting Key1="RouteRecord"/>
									<Setting Key1="RouteRecordResolved"/>
									<Setting Key1="StatusCode">
										<Rule Name="fPingGWSuccess" Query="$.=0"/>
									</Setting>
								</Object>
							</Object>
							<Rule Name="fPingTestSuccess" Query="count($fPingGWSuccess) &gt;0" Error="None" Title="Ping successful" Text="Ping from server {1} to server {2} was successful." S1="%varExName%" S2="%varGWName%" AlwaysEvaluate="True"/>
							<Rule Name="fPingTestError" Query="not($fPingTestSuccess or $fPingTestNotPerformed)" Error="Error" Sev="1" Title="Ping unsuccessful" Text="Ping from server {1} to server {2} was not successful. Check whether the server is operational or not." S1="%varExName%" S2="%varGWName%" GUID="654eb91d-0d17-4fe3-b4cf-2c5be04279bf"/>
							<Rule Name="fPingTestNotPerformed" Query="count($fNoPing)=6" Error="Warning" Sev="3" Title="Ping test not performed" Text="Ping from server {1} to server {2} was not performed. Unless server {1} is running Windows 2000, this could be the result of a network or permissions problem." S1="%varExName%" S2="%varGWName%" GUID="91aac86e-60e8-4b90-9453-1c209cf75fd5" AlwaysEvaluate="True"/>
						</Object>
						<Object Type="Port" Name="SMTP Port Test" Key1="%varGWName%">
							<Setting Key1="%varGWSMTPPort%">
								<Rule Name="fSMTPPortGWSuccess" Query="contains($.[2], concat(@S9,' Available'))" Error="None" Title="Port {9} responded" Text="Port {9} successfully responded on server {2}." S2="%varGWName%" S9="%varGWSMTPPort%"/>
								<Rule Name="fSMTPPortGWError" Query="not($fSMTPPortGWSuccess)" Error="Error" Sev="1" ReportIssue="Summary" Title="Port {9} did not respond" Text="Port {9} did not respond on server {2}." S2="%varGWName%" S9="%varGWSMTPPort%" GUID="80503d53-ada9-4bc1-b6c3-1266b10de3af"/>
							</Setting>
						</Object>

						<Object Type="Protocol" Name="SMTP Mail Acceptance Test" Key1="%varGWName%" Key2="TCP" Key3="%varGWSMTPPort%" Key4="60000" Timeout="%300">
							<Setting Key1="Connect">
								<Rule Name="fSMTPSocketAliveGWTest" Query="not ($.[2]='Respond = Remote socket is not available' or $.[2]='Respond = ')"/>
								<Rule Name="fSMTPSocketGWPIXFireWall" Query="starts-with($.[2],'Respond = 220') and (contains($.[2], '***') or contains(upper-case($.[2]),'SMTP/CMAP'))" Template="tSMTPProxyRunning" S0="Cisco PIX firewall" S2="%varGWName%"/>
								<Rule Name="fSMTPSocketGWWatchGuard" Template="tSMTPProxyRunning" S0="WatchGuard Firebox firewall" S2="%varGWName%" S4="SMTP SERVICE READY"/>
								<Rule Name="fSMTPSocketGWCheckPoint" Template="tSMTPProxyRunning" S0="Checkpoint Firewall" S2="%varGWName%" S4="CHECKPOINT"/>
								<Rule Name="fSMTPSocketGWRaptor" Query="contains(upper-case($.[2]), 'GENERIC SMTP HANDLER')" Template="tSMTPProxyRunning" S0="Raptor Firewall" S2="%varGWName%"/>
								<Rule Name="fSMTPSocketGWCyberGuard" Template="tSMTPProxyRunning" S0="CyberGuard firewall" S2="%varGWName%" S4="FW1 SMTP PROXY SERVICE READY"/>
								<Rule Name="fSMTPSocketGWPraetor" Template="tSMTPProxyRunning" S0="CMS Praetor" S2="%varGWName%" S4="CMSPRAETOR"/>
								<Rule Name="fSMTPSocketGWMerak" Template="tSMTPProxyRunning" S0="Merak Mail Server" S2="%varGWName%" S4="ESMTP MERAK"/>
							</Setting>
							<Setting Key1="EHLO"/>
							<Setting Key1="MAIL FROM: %varMAILFROMAddress%" Key5="MAIL FROM">
								<Rule Name="fAcceptTestMailFromGWOkay" Query="starts-with($.[2], 'Respond = 250')"/>
							</Setting>
							<Setting Key1="RCPT TO: %varRCPTAddress%" Key5="RCPT TO">
								<Rule Name="fAcceptTestRcptToGWOkay" Query="starts-with($.[2], 'Respond = 250')"/>
							</Setting>
							<Setting Key1="Data"/>
							<Setting Key1="From: %varMAILFROMAddress%" Key2="SkipRead" Key5="RFC822-FROM"/>
							<Setting Key1="To: %varRCPTAddress%" Key2="SkipRead" Key5="RFC822-TO"/>
							<Setting Key1="" Key2="SkipRead"/>
							<Setting Key1="This message has been sent by the Microsoft Exchange Troubleshooting Assistant. The purpose of this message is to test the SMTP transport. It is safe to delete this message." Key2="SkipRead"/>
							<Setting Key1=".">
								<Rule Name="fMailAcceptGWSuccess" Query="$fSMTPSocketAliveGWTest and $fAcceptTestMailFromGWOkay and $fAcceptTestRcptToGWOkay and starts-with ($.[2], 'Respond = 250')" Error="None" Title="Mail acceptance success" Text="SMTP instance on server {2} successfully completed mail acceptance test." S2="%varGWName%"/>
								<Rule Name="fMailAcceptGWError" Query="not ($fMailAcceptGWSuccess)" Error="Error" Sev="1" ReportIssue="Issue" Title="Mail acceptance failure" Text="SMTP instance on server {2} failed mail acceptance test." S2="%varGWName%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
							</Setting>
							<Setting Key1="Disconnect"/>
						</Object>
						<Rule Name="fConnectGWSuccess" Query="$fPingTestSuccess and $fSMTPPortGWSuccess and $fMailAcceptGWSuccess" Error="None" ReportIssue="Summary" Title="Mail acceptance success" Text="It appears that the SMTP instance on server {2} is up and running. Unless messages are backing up on this server, the root cause of the problem is possibly at or outside the corporate firewall." S2="%varGWName%" AlwaysEvaluate="True"/>
					</Object>

					<Rule Name="szConnectNonExGateway" Query="'ConnectNonExGateway'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szGWErrorStateText" Query="if(not($fConnectGWSuccess),string(@Title),$szGWNoErrorStateText)" Title="One or more errors were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szGWNoErrorStateText" Query="string(@Title)" Title="Gateway connectivity test passed."/>
					<Rule Name="szConnectGWTestResult" Query="string(@Title)" Title="Gateway Connectivity Test Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayGWProcessStep" Query="@S1='0'" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="SearchMessage" Title="Locate a Submitted Message" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varMsgTrackExName%" Substitution="varMsgTrackExName" Display="Hide"/>
			<Setting Key1="%varOutboundSenderAddress%" Substitution="varOutboundSenderAddress" Display="Hide"/>
			<Setting Key1="%varOutboundRecipAddress%" Substitution="varOutboundRecipAddress" Display="Hide"/>
			<Setting Key1="%varRootDomainDN%" Substitution="varRootDomainDN" Display="Hide"/>
			<Setting Key1="%varConfigDN%" Substitution="varConfigDN" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Locating a Submitted Message" Text="Please wait while the tool tries to locate a message sent by {1} to {2}." S1="%varOutboundSenderAddress%" S2="%varOutboundRecipAddress%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Message Tracking Log" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="If" Name="%varExName%" Key1="true()" Class="Server" GroupingClass="True" Display="Hide">
						<Setting Key1="string()" Substitution="SENDERHOMESERVER"/>
						<!-- First, we need to check whether the sender actually exists in directory and has a mailbox on the specified server -->
						<Object Type="Directory" Key1="GC://%varDCName%/" Key2="%varRootDomainDN%" Key3="(&amp;(|(objectCategory=user)(objectCategory=group))(proxyAddresses=smtp:%varOutboundSenderAddress%))">
							<Rule Name="fDirectoryException" Query="../Exception/@Message" Error="Error" Sev="2" Title="Directory data cannot be accessed" Text="Cannot collect directory data from server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="../Exception/@Message" S2="%varDCName%" GUID="b15f87cc-938a-48f8-a14e-24ce1aef5b61"/>
							<Rule Name="fSenderNotFound" Query="not ($fDirectoryException) and count ($szOutboundSenderDN) &lt;1" Error="Error" Sev="2" Title="Cannot identify the sender" Text="Cannot identify an object with '{1}' as the mail address in Active Directory. Please check if this address is correct and rerun the tool." S1="%varOutboundSenderAddress%" GUID="2ec89a98-ae4a-4ea5-9d80-737c9b228c7f" AlwaysEvaluate="True"/>
							<Setting Key1="distinguishedName">
								<Rule Name="szOutboundSenderDN" Query="$."/>
							</Setting>
							<Setting Key1="cn">
								<Rule Name="szOutboundSenderCN" Query="$."/>
							</Setting>
							<Setting Key1="legacyExchangeDN" Substitution="SENDERLEGDN"/>
							<Setting Key1="mail" Substitution="SENDERADDRESS"/>
							<Setting Key1="msExchHomeServerName" Substitution="SENDERHOMESERVER" SubstitutionFormat="^.*/cn=Configuration/cn=Servers/cn=(.*?[^\\])$----$1">
								<Rule Name="szOutboundSenderHomeServer" Query="substring-after(lower-case($.), 'cn=servers/cn=')"/>
								<Rule Name="fDifferentHomeServer" Query="$szOutboundSenderHomeServer != lower-case('%varExName%')" Error="Warning" Sev="3" Title="Specified sender on different server" Text="The home server of the specified sender '{3}' (mail address: {4}) is {2} whereas the entered Exchange server was {1}. The tool will focus on server {2} instead. If you believe that server {1} should rather be investigated, rerun the tool and specify a sender whose mailbox is on server {1}." S1="%varExName%" P2="$szOutboundSenderHomeServer" P3="$szOutboundSenderCN" S4="%varOutboundSenderAddress%" GUID="0336b1b0-d06b-428c-b4e0-148a7d35dadd"/>
								<Rule Name="szModifedExName" Query="if($fDifferentHomeServer, $szOutboundSenderHomeServer, '%varExName%')">
									<Variable Name="varMsgTrackExName" Scope="Children"/>
								</Rule>
							</Setting>
							<Setting Key1="objectCategory" Substitution="SENDEROBJCAT"/>
							<!-- Next, we search for messages with the specified sender and recipient. We need to query with both SMTP and LegacyExchangeDN As we do not know what type of client was used to send the message. -->
							<Object Type="If" Key1="true()">
								<Setting Key1="if(starts-with(upper-case('%SENDEROBJCAT%'), 'CN=GROUP,'), '%varExName%', '%SENDERHOMESERVER%')" Substitution="SENDERHOMESERVER">
									<Rule Name="szOutboundOriginatingServer" Query="lower-case($.)"/>
								</Setting>
								<Object Type="WMI" Key1="%SENDERHOMESERVER%" Key2="root\MicrosoftExchangeV2" Key3="Exchange_MessageTrackingEntry" Key4="SenderAddress='%SENDERADDRESS%' and EntryType=1033" Key5="*" Sort="TimeLogged DESC" Range="100">
									<Rule Name="fNoMsgTrackInstanceSMTP" Query="count(../Instance)=0"/>
									<Setting Key1="OriginationTime">
										<Rule Name="dOriginationTimeSMTP" Query="if($fSentToSpecifiedRecipSMTP, date-parse(substring($.,1,14), 'yyyyMMddHHmmss'))"/>
									</Setting>
									<Setting Key1="SenderAddress"/>
									<Setting Key1="TimeLogged"/>
									<Setting Key1="RecipientAddress">
										<Rule Name="szRecipListSMTP" Query="join(';', $.)"/>
										<Rule Name="fSentToSpecifiedRecipSMTP" Query="contains(lower-case($szRecipListSMTP), lower-case('%varOutboundRecipAddress%'))"/>
									</Setting>
									<Setting Key1="MessageID">
										<Rule Name="szMessageIDSMTP" Query="if($fSentToSpecifiedRecipSMTP, $.)"/>
									</Setting>
								</Object>
								<Object Type="WMI" Key1="%SENDERHOMESERVER%" Key2="root\MicrosoftExchangeV2" Key3="Exchange_MessageTrackingEntry" Key4="SenderAddress='EX:%SENDERLEGDN%' and EntryType=1027" Key5="*" Sort="TimeLogged DESC" Range="100">
									<Rule Name="fNoMsgTrackInstanceLegDN" Query="count(../Instance)=0"/>
									<Setting Key1="OriginationTime">
										<Rule Name="dOriginationTimeLegDN" Query="if($fSentToSpecifiedRecipLegDN, date-parse(substring($.,1,14), 'yyyyMMddHHmmss'))"/>
									</Setting>
									<Setting Key1="SenderAddress"/>
									<Setting Key1="TimeLogged"/>
									<Setting Key1="RecipientAddress">
										<Rule Name="szRecipListLegDN" Query="join(';', $.)"/>
										<Rule Name="fSentToSpecifiedRecipLegDN" Query="contains(lower-case($szRecipListLegDN), lower-case('%varOutboundRecipAddress%'))"/>
									</Setting>
									<Setting Key1="MessageID">
										<Rule Name="szMessageIDLegDN" Query="if($fSentToSpecifiedRecipLegDN, $.)"/>
									</Setting>
								</Object>
							</Object>

							<!-- Need to input a dummy value just to avoid date-difference to fail due to a null value. The dummy value will never be used for real calculation -->
							<Rule Name="dOriginationTimeSMTPLast" Query="if(count($szMessageIDSMTP) &gt;0, slice(join(';', $dOriginationTimeSMTP), ';', 0), '01/01/2000 00:00:00')" AlwaysEvaluate="True"/>
							<Rule Name="dOriginationTimeLegDNLast" Query="if(count($szMessageIDLegDN) &gt;0, slice(join(';', $dOriginationTimeLegDN), ';', 0), '01/01/2000 00:00:00')" AlwaysEvaluate="True"/>

							<Rule Name="szMessageIDSMTPLast" Query="slice(join(';', $szMessageIDSMTP), ';', 0)"/>
							<Rule Name="szMessageIDLegDNLast" Query="slice(join(';', $szMessageIDLegDN), ';', 0)"/>

							<Rule Name="dOriginationTime" Query="if($szExMessageID='', '', if($szExMessageID = $szMessageIDSMTPLast, $dOriginationTimeSMTPLast, $dOriginationTimeLegDNLast))" AlwaysEvaluate="True"/>
							<Rule Name="szExMessageID" Query="if($szMessageIDSMTPLast='' and $szMessageIDLegDNLast='', '', if($szMessageIDSMTPLast='', $szMessageIDLegDNLast, if($szMessageIDLegDNLast='', $szMessageIDSMTPLast, if(date-difference($dOriginationTimeSMTPLast, $dOriginationTimeLegDNLast) &gt;=0, $szMessageIDSMTPLast, $szMessageIDLegDNLast))))" AlwaysEvaluate="True">
								<Variable Name="varExMessageID" Scope="Children"/>
							</Rule>

							<Rule Name="fMsgFromSenderNotFound" Query="$fNoMsgTrackInstanceSMTP and $fNoMsgTrackInstanceLegDN" Error="Error" Sev="2" Title="No message from the specified sender" Text="Cannot find a message submitted by the specified sender '{3}' (mail address: {4}) from server {2}. Please check that the sender address is correct and that the message tracking is enabled on server {2}." P2="$szOutboundOriginatingServer" P3="$szOutboundSenderCN" S4="%varOutboundSenderAddress%" GUID="44c34afe-faa0-4131-ab93-272a2a35c341"/>
							<Rule Name="fMsgToRecipientNotFound" Query="not($fSenderNotFound or $fMsgFromSenderNotFound) and $szExMessageID =''" Error="Error" Sev="2" Title="No message to the specified recipient" Text="Cannot find a message addressed to '{1}' among the last 100 messages submitted by the specified sender '{3}' (mail address: {4}) from server {2}. Please check that the recipient address is correct or try sending another message to the recipient and rerun the tool." S1="%varOutboundRecipAddress%" P2="$szOutboundOriginatingServer" P3="$szOutboundSenderCN" S4="%varOutboundSenderAddress%" GUID="48d7b208-b608-4fb4-93db-16911321910f"/>
							<Rule Name="fMessageFound" Query="$szExMessageID !=''" Error="None" Title="Message found" Text="At least one message sent by the specified sender '{3}' (mail address: {4}) to '{1}' was found on server {2}. The tool will start tracking this message. Origination time: {8} (UTC)" S1="%varOutboundRecipAddress%" P2="$szOutboundOriginatingServer" P3="$szOutboundSenderCN" S4="%varOutboundSenderAddress%" P8="$dOriginationTime"/>
						</Object>
						<!-- Let's check if global distribution groups are used in a multi-domain topology. -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Partitions,%varConfigDN%" Key3="systemFlags=3" Key4="OneLevel">
							<Setting Key1="nCName">
								<Rule Name="szDomainDN" Query="$."/>
							</Setting>
						</Object>
						<Object Type="Directory" Key1="GC://%varDCName%/" Key2="%varRootDomainDN%" Key3="(&amp;(groupType:1.2.840.113556.1.4.803:=2)(proxyAddresses=smtp:%varOutboundRecipAddress%))">
							<Setting Key1="cn">
								<Rule Name="fGlobalGroupUsedMultiDomains" Query="count($szDomainDN) &gt;1" Error="Warning" Sev="1" Title="Global distribution group used in multi-domain forest" Text="The specified recipient '{1}' was found to be global distribution group '{3}', while the topology appears to be a multi-domain forest. Messages may not be delivered correctly to its members. Follow Microsoft Knowledge Base article 271930 and consider using universal distribution groups instead." S1="%varOutboundRecipAddress%" P3="$." GUID="304abc5e-8470-46cd-98e8-6ed501e1c753"/>
							</Setting>
						</Object>

						<Rule Name="szSearchMessage" Query="'SearchMessage'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fSearchMessageIssueFound,string(@Title),$szExNoErrorStateText)" Title="Failed to find a message to track for continued troubleshooting." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="A message to troubleshoot was identified."/>
						<Rule Name="szSearchMessageResult" Query="string(@Title)" Title="Message Search Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fSearchMessageIssueFound" Query="$fSenderNotFound or $fMsgFromSenderNotFound or $fMsgToRecipientNotFound" AlwaysEvaluate="True"/>
						<Rule Name="iIniScanMsgTrackingLoopCount" Query="1">
							<Variable Name="varScanMsgTrackLoopCount" Scope="Children"/>
						</Rule>

						<Rule NextStep="DisplayResultsStep" Name="fDisplaySearchMessageStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
						<Rule NextStep="ScanMessageTracking" Name="fGotoScanMessageTrackingStep" Query="$fMessageFound" Priority="2" Text="- Check the message tracking log entries for the identified message and determine how far that message has been routed" Display="Hide" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckExGateway" Title="Check Status of Exchange Gateway" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExGWName%" Substitution="varExGWName" Display="Hide"/>
			<Setting Key1="%varGWName%" Substitution="varGWName" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varRootDomainDN%" Substitution="varRootDomainDN" Display="Hide"/>
			<Setting Key1="%varGWProvided%" Substitution="varGWProvided" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varSelSymptom%" Substitution="varSelSymptom" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Status of Exchange Gateway" Text="Please wait while the tool checks the status of Exchange gateway server {2}." S2="%varExGWName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Exchange Gateway" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="Group" Name="%varExGWName%" Class="Server" GroupingClass="True" Display="Hide">
						<!-- First, we need to check if the specified Exchange gateway server really exists -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%varExOrgDN%" Key3="(&amp;(objectCategory=msExchExchangeServer)(cn=%varExGWName%))">
							<Rule Name="fDirectoryExGWException" Query="../Exception/@Message" Error="Error" Sev="2" Title="Directory data cannot be accessed" Text="Cannot collect directory data from server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="../Exception/@Message" S2="%varDCName%" GUID="b15f87cc-938a-48f8-a14e-24ce1aef5b61"/>
							<Rule Name="fExGWNotFound" Query="not($fDirectoryExGWException) and count($szExGWDN) &lt;1" Error="Error" Sev="2" Title="Cannot identify the specified Exchange gateway" Text="Server {2} was specified as an Exchange gateway server but no corresponding object was identified in Active Directory. Please check if the name is correct." S2="%varExGWName%" GUID="87faf7dd-a932-4915-8713-b07956f6e175" AlwaysEvaluate="True"/>
							<Setting Key1="cn" Substitution="EXGWCN"/>
							<Setting Key1="distinguishedName" Substitution="DN">
								<Rule Name="szExGWDN" Query="$."/>
							</Setting>
							<!-- Then, we would like to know if the SMTP service is up and running on the server -->
							<Object Type="WMI" Key1="%EXGWCN%" Key3="Win32_Service" Key4="Name='SMTPSVC'">
								<Setting Key1="Started">
									<Rule Name="fExGWSMTPStarted" Query="$.='True'" Error="None" Title="{0} service started" Text="{0} service on server {2} is started." S0="SMTPSVC" S2="%varExGWName%"/>
									<Rule Name="fExGWSMTPNotStarted" Query="$.='False'" Error="Error" Sev="1" ReportIssue="Issue" Title="{0} service not started" Text="{0} service on server {2} is not started. It is important for this service to be started to route messages." S0="SMTPSVC" S2="%varExGWName%" GUID="64ba818b-8789-41bb-ac20-f3eb9c7d1594"/>
								</Setting>
								<Setting Key1="StartMode">
									<Rule Name="fExGWSMTPDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="Issue" Title="{0} service disabled" Text="{0} service on server {2} is disabled. It is important for this service to be running to route messages." S0="SMTPSVC" S2="%varExGWName%" GUID="7e8ef54b-1be2-4955-8123-f0ddd39e0d84"/>
									<Rule Name="fExGWSMTPManual" Query="$.='Manual'" Error="Warning" Sev="2" Title="{0} service manual startup" Text="{0} service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="SMTPSVC" S2="%varExGWName%" GUID="423d680b-5861-4bcb-a512-3189c7a6a33d"/>
								</Setting>
								<Setting Key1="State">
									<Rule Name="fExGWSMTPNotRunning" Query="not($.='Running') and $fExGWSMTPStarted" Error="Error" Sev="1" ReportIssue="Issue" Title="{0} service not running" Text="{0} service on server {2} is not running. It is important for this service to be running to route messages. Current state: {4}" S0="SMTPSVC" S2="%varExGWName%" P4="$."/>
								</Setting>
							</Object>
							<!-- Next, let's drill down to SMTP virtual servers running on the specified Exchange gateway -->
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=SMTP,CN=Protocols,%DN%" Key3="objectCategory=protocolCfgSMTPServer">
								<Rule Name="fDirectorySMTPVSException" Query="../Exception/@Message" Error="Error" Sev="2" Title="Directory data cannot be accessed" Text="Cannot collect directory data from server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="../Exception/@Message" S2="%varDCName%" GUID="b15f87cc-938a-48f8-a14e-24ce1aef5b61"/>
								<Rule Name="fExGWSMTPVSNotFound" Query="not($fDirectorySMTPVSException) and count($szExGWSMTPVSDN) &lt;1" Error="Error" Sev="2" ReportIssue="Issue" Title="No SMTP instance found" Text="Server {2} was specified as an Exchange gateway server but it does not appear to have any SMTP instance. No messages can be routed by this server." S2="%varExGWName%" GUID="22c13372-fca1-4e6c-8f4a-ce3aa7d85579" AlwaysEvaluate="True"/>
								<Setting Key1="adminDisplayName">
									<Rule Name="szSMTPInstanceName" Query="$."/>
								</Setting>
								<Setting Key1="cn" Substitution="SMTPVSCN"/>
								<Setting Key1="distinguishedName" Substitution="SMTPVSDN">
									<Rule Name="szExGWSMTPVSDN" Query="$."/>
								</Setting>
								<Setting Key1="msExchSmtpOutgoingPort">
									<Rule Name="fSMTPOutogoingPortNot25" Query="$.!=25" Error="Warning" Sev="3" Title="SMTP non-standard port" Text="SMTP instance '{3}' on Exchange gateway server {2} is not using the default port of 25 for outbound SMTP connections. Current port number: {9}." S2="%varExGWName%" P3="$szSMTPInstanceName" P9="$." GUID="6dbd672c-b718-4a6d-91db-ad3f4cccad12"/>
								</Setting>
								<Setting Key1="msExchSmtpSmartHost">
									<Rule Name="szSMTPVSSmartHost" Query="$."/>
									<Rule Name="fSMTPVSSmartHostSet" Query="$.!=''" Error="Warning" Sev="1" Title="Smart host is set on SMTP virtual server" Text="SMTP instance '{3}' on Exchange gateway server {2} is configured to route all messages via smart host '{1}'. This option can cause mail flow problems if set incorrectly." P1="$." S2="%varExGWName%" P3="$szSMTPInstanceName" GUID="8e853999-f072-466f-bd72-923c6d7447a6"/>
								</Setting>
								<!-- Next, check whether the SMTP virtual server is up and running -->
								<Object Type="Metabase" Key1="%EXGWCN%" Key2="LM/SmtpSvc/%SMTPVSCN%" Timeout="%300">
									<Setting Key1="1016" Key2="ServerState" Substitution="SMTPVSSTATUS">
										<Rule Name="fSMTPVSStarted" Query="$.=2" Error="None" Title="SMTP instance started" Text="SMTP instance '{3}' on server {2} is started." S2="%varExGWName%" P3="$szSMTPInstanceName"/>
										<Rule Name="fSMTPVSStopped" Query="$.=4" Error="Error" Sev="1" ReportIssue="RootCause" Title="SMTP instance stopped" Text="SMTP instance '{3}' on server {2} is stopped. This virtual server cannot route any messages." S2="%varExGWName%" P3="$szSMTPInstanceName" GUID="369d863f-7702-4ffc-80fd-a9f86eb26ce0"/>
										<Rule Name="fSMTPVSPaused" Query="$.=6" Error="Error" Sev="2" ReportIssue="RootCause" Title="SMTP instance paused" Text="SMTP instance '{3}' on server {2} is paused." S2="%varExName%" P3="$szSMTPInstanceName" GUID="ca7cb622-13da-40f7-b8d8-ce020a0380c7"/>
									</Setting>
									<Setting Key1="1023" Key2="ServerBindings" Substitution="SERVERBINDINGS" SubstitutionFormat=":$----;"/>
									<!-- Check for event 429 -->
									<Object Type="If" Key1="not('%SMTPVSSTATUS%'='2')">
										<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
										<Object Type="WMI" Key1="%EXGWCN%" Key3="Win32_NTLogEvent" Key4="Logfile='System' AND EventCode=429 AND SourceName='smtpsvc' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
											<Setting Key1="EventCode"/>
											<Setting Key1="EventType"/>
											<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
											<Setting Key1="Data"/>
											<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
												<Rule Name="fEvt429WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="An '{0}' error event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the system log of server {2} within the last 24 hours. Verify that the '{3}', '{4}' and '{5}' folders exist for this SMTP instance under the designated path and they are not corrupt. Last occurrence at {8}. Event description: {1}" S0="SMTPSVC" S1="%EVTMESSAGE%" S2="%EXGWCN%" S3="BadMail" S4="PickUp" S5="Queue" S8="%EVTTIME%" S9="429" GUID="a1144c62-475b-4a46-af3e-39ec35c3ed64"/>
											</Setting>
										</Object>
									</Object>
									<!-- Let's also check if the SMTP port of the SMTP virtual server responds -->
									<Object Type="Cache" Name="Exchange Gateway SMTP Port Cache" Key1="Add" Key2="SMTPPortList-%SMTPVSCN%" Key3="%SERVERBINDINGS%" Key4=";" Display="Hide">
										<Setting Key1="SMTPServer" Substitution="SMTPSERVER" SubstitutionFormat="^(.*?):.*$----$1"/>
										<Setting Key1="SMTPPort" Substitution="SMTPPORT" SubstitutionFormat="^.*:(\d{1,5})$----$1"/>
										<Object Type="If" Key1="true()" Display="Hide">
											<Setting Key1="if('%SMTPSERVER%'='', '%EXGWCN%', '%SMTPSERVER%')" Substitution="SERVER" Display="Hide"/>
											<Object Type="Port" Name="SMTP Port Test" Key1="%SERVER%">
												<Setting Key1="%SMTPPORT%">
													<Rule Name="fSMTPPortSuccess" Query="contains($.[2], concat(@S9,' Available'))" Error="None" Title="Port {9} responded" Text="Port {9}, which is used by SMTP instance '{3}', successfully responded on server {2}." S2="%varExGWName%" P3="$szSMTPInstanceName" S9="%SMTPPORT%"/>
													<Rule Name="fSMTPPortError" Query="not($fSMTPPortSuccess)" Error="Error" Sev="1" ReportIssue="Issue" Title="Port {9} did not respond" Text="Port {9}, which is used by SMTP instance '{3}', did not respond on server {2}." S2="%varExGWName%" P3="$szSMTPInstanceName" S9="%SMTPPORT%" GUID="80503d53-ada9-4bc1-b6c3-1266b10de3af"/>
												</Setting>
											</Object>
										</Object>
									</Object>
								</Object>
								<!-- We need to check whether the specified Exchange gateway functions as a bridgehead server of any outbound SMTP connectors -->
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectClass=msExchRoutingSMTPConnector)(msExchSourceBridgeheadServersDN=%SMTPVSDN%)(routingList=*))">
									<Rule Name="fDirectoryConnectorException" Query="../Exception/@Message" Error="Error" Sev="2" Title="Directory data cannot be accessed" Text="Cannot collect directory data from server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="../Exception/@Message" S2="%varDCName%" GUID="b15f87cc-938a-48f8-a14e-24ce1aef5b61"/>
									<Rule Name="fExGWSMTPConnectorNotFound" Query="not($fDirectoryConnectorException) and count($szSMTPConnectorDN) &lt;1" Error="Warning" Sev="3" Title="SMTP instance with no outbound SMTP connector set" Text="It appears that no SMTP connectors with an address space have SMTP instance '{3}' as its designated local bridgehead server. Outbound messages may need another hop before going out of the Exchange organization. Please check if this configuration is intentional." P3="$szSMTPInstanceName" GUID="66c35604-2375-4107-b6e8-bd06538653eb" AlwaysEvaluate="True"/>
									<Setting Key1="cn">
										<Rule Name="szSMTPConnectorCN" Query="$."/>
									</Setting>
									<Setting Key1="distinguishedName">
										<Rule Name="szSMTPConnectorDN" Query="$."/>
									</Setting>
									<Setting Key1="msExchSmtpSmartHost">
										<Rule Name="szSMTPConnectorSmartHost" Query="$." Error="None" Title="SMTP connector smart host" Text="SMTP connector '{4}' is configured to route all messages via smart host '{1}'." P1="$." P4="$szSMTPConnectorCN"/>
										<Rule Name="szSMTPConnectorSmartHostLowerCase" Query="lower-case($.)"/>
									</Setting>
									<Setting Key1="routingList"/>
								</Object>
							</Object>
							<!-- Let's check if the Exchange gateway is configured to route message to the non-Exchange gateway -->
							<Object Type="If" Name="Non-Exchange Gateway" Key1="'%varGWProvided%' = '1'">
								<Setting Key1="lower-case('%varGWName%')" Substitution="GWSHORTNAME" SubstitutionFormat="^(.*?)\..*[a-zA-Z].*$----$1">
									<Rule Name="fGWNotFound" Query="count($szSMTPConnectorSmartHostLowerCase[contains(., '%GWSHORTNAME%')]) &lt;1" Error="Warning" Sev="2" Title="Non-Exchange gateway server not set as smart host" Text="No SMTP connectors with Exchange gateway server {2} as the local bridgehead appear to have non-Exchange gateway server {1} as the designated smart host. Outbound messages may not be routed directly from server {2} to server {1}. Please check whether this configuration is intentional." S1="%varGWName%" S2="%varExGWName%" GUID="c85be53c-96ba-4570-ae1e-bc68e0b78bb0" AlwaysEvaluate="True"/>
								</Setting>
							</Object>
						</Object>
						<Rule Name="szCheckExGateway" Query="'CheckExGateway'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fExGWIssueFound,string(@Title),$szExNoErrorStateText)" Title="One or more Exchange gateway server issues were found." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No Exchange gateway issues were found."/>
						<Rule Name="szCheckExGatewayResult" Query="string(@Title)" Title="Exchange Gateway Server Analysis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fExGWIssueFound" Query="$fExGWNotFound or $fExGWSMTPNotRunning or $fExGWSMTPNotStarted or $fExGWSMTPDisabled or $fExGWSMTPManual or $fExGWSMTPVSNotFound or $fSMTPOutogoingPortNot25 or $fSMTPVSSmartHostSet or $fSMTPVSStopped or $fSMTPVSPaused or $fEvt429WithinLast24hours or $fSMTPPortError or $fExGWSMTPConnectorNotFound or $fGWNotFound" AlwaysEvaluate="True"/>

						<Rule Name="szSwitchSymptom" Query="'Queue'">
							<Variable Name="varSelSymptom" Scope="Children"/>
						</Rule>
						<Rule Name="szSwitchVarExName" Query="'%varExGWName%'">
							<Variable Name="varExName" Scope="Children"/>
						</Rule>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckExGatewayStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
						<Rule NextStep="RetrieveBasicServerData" Name="fNeedExGWBasicData" Query="not($fExGWNotFound or upper-case(@S2)=upper-case(@S0))" Priority="2" Text="- Retrieve basic information of server {0} and then check the status of its queues" S0="%varExGWName%" S2="%varExName%" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckQueueStatus" Name="fGoDirectlyCheckQueue" Query="not($fExGWNotFound) and @S1='Outbound' and upper-case(@S2)=upper-case(@S0)" Priority="3" Text="- Check the status of various queues on server {0}" S0="%varExGWName%" S1="%varSelSymptom%" S2="%varExName%" Display="Hide" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckQueueStatus" Title="Check Status of SMTP Queues" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExDN%" Substitution="varExDN" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of SMTP Queues" Text="Please wait while the tool checks the status of SMTP queues on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<!-- Let's check the status of each queue -->
				<Object Type="Group" Name="SMTP Queue Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON" TrackProgress="TrackProgress" MaxTime="ALL,5" MaxTimeouts="ALL,5" MaxFailures="WMI,5">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<Object Type="WMI" Key1="%varExName%" Key2="root\cimv2\applications\exchange" Key3="ExchangeLink" Key4="ProtocolName='SMTP' and TypePendingCategorization='True'" TrackProgress="TrackProgress">
							<Rule Name="fWMITimeout" Query="count(../Instance)=0" Error="Error" Sev="1" Title="No queue status available. Aborting SMTP queue analysis" Text="Unable to retrieve queue info on server {2}. This server may have lost connections to Active Directory servers." S2="%varExName%" GUID="bdb4559c-73c4-47f9-a7ad-458ad4e8d250" AlwaysEvaluate="True"/>
							<Setting Key1="LinkName">
								<Rule Name="szMADLLinkName" Query="$."/>
							</Setting>
							<Setting Key1="ExtendedStateInfo">
								<Rule Name="szMADLStateInfo" Query="$."/>
							</Setting>
							<Setting Key1="NumberOfMessages">
								<Rule Name="fMADLMany" Query="$. &gt;50" Error="Error" Sev="1" ReportIssue="Summary" Title="'Messages awaiting directory lookup' queue is backing up" Text="The 'Messages awaiting directory lookup' queue ({3}) on server {2} holds more than 50 messages. Source: '{4}'. Number of messages in the queue: {9}." S2="%varExName%" P3="$szMADLLinkName" P4="$szMADLSMTPInstanceName" P9="$iMADLMessage">
									<Variable Name="varMADLMany" Scope="Children"/>
								</Rule>
								<Rule Name="iMADLMessage" Query="$."/>
							</Setting>
							<Setting Key1="StateFrozen">
								<Rule Name="fMADLFrozen" Query="upper-case($.)='TRUE'" Error="Error" Sev="1" ReportIssue="Issue" Title="'Messages awaiting directory lookup' queue is frozen" Text="The 'Messages awaiting directory lookup' queue ({3}) on server {2} is frozen. Source: '{4}'. Number of message(s) in the queue: {9}. This queue needs to be unfrozen for messages to flow." S2="%varExName%" P3="$szMADLLinkName" P4="$szMADLSMTPInstanceName" P9="$iMADLMessage" GUID="56c08a8a-555a-45c9-be70-14f3dd02d72c"/>
							</Setting>
							<Setting Key1="StateRetry">
								<Rule Name="fMADLRetry" Query="upper-case($.)='TRUE'" Error="Error" Sev="1" ReportIssue="Summary" Title="'Messages awaiting directory lookup' queue is in retry" Text="The 'Messages awaiting directory lookup' queue ({3}) on server {2} is in retry status. Source: '{4}'. Number of message(s) in the queue: {9}." S2="%varExName%" P3="$szMADLLinkName" P4="$szMADLSMTPInstanceName" P9="$iMADLMessage" GUID="9c2d85bf-1452-4343-808b-23764311340b">
									<Variable Name="varMADLRetry" Scope="Children"/>
								</Rule>
							</Setting>
							<Setting Key1="VirtualServerName" Substitution="SMTPINSTANCE"/>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%">
								<Setting Key1="adminDisplayName">
									<Rule Name="szMADLSMTPInstanceName" Query="$."/>
								</Setting>
							</Object>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key2="root\cimv2\applications\exchange" Key3="ExchangeLink" Key4="ProtocolName='SMTP' and TypePendingRouting='True'" TrackProgress="TrackProgress">
							<Setting Key1="LinkName">
								<Rule Name="szRoutingLinkName" Query="$."/>
							</Setting>
							<Setting Key1="ExtendedStateInfo">
								<Rule Name="szRoutingStateInfo" Query="$."/>
							</Setting>
							<Setting Key1="NumberOfMessages">
								<Rule Name="fRoutingMany" Query="$. &gt;50" Error="Error" Sev="2" ReportIssue="Summary" Title="'Messages waiting to be routed' queue is backing up" Text="The 'Messages waiting to be routed' queue ({3}) on server {2} holds more than 50 messages. Source: '{4}'. Number of messages in the queue: {9}." S2="%varExName%" P3="$szRoutingLinkName" P4="$szRoutingSMTPInstanceName" P9="$iRoutingMessage"/>
								<Rule Name="iRoutingMessage" Query="$."/>
							</Setting>
							<Setting Key1="StateFrozen">
								<Rule Name="fRoutingFrozen" Query="upper-case($.)='TRUE'" Error="Error" Sev="1" ReportIssue="Issue" Title="'Messages waiting to be routed' queue is frozen" Text="The 'Messages waiting to be routed' queue ({3}) on server {2} is frozen. Source: '{4}'. Number of message(s) in the queue: {9}. This queue needs to be unfrozen for messages to flow." S2="%varExName%" P3="$szRoutingLinkName" P4="$szRoutingSMTPInstanceName" P9="$iRoutingMessage" GUID="6c71bcbc-5548-4e4e-81bb-b3453ea77fae"/>
							</Setting>
							<Setting Key1="StateRetry">
								<Rule Name="fRoutingRetry" Query="upper-case($.)='TRUE'" Error="Error" Sev="2" ReportIssue="Summary" Title="'Messages waiting to be routed' queue is in retry" Text="The 'Messages waiting to be routed' queue ({3}) on server {2} is in retry status. Source: '{4}'. Number of message(s) in the queue: {9}. Additional status information: {1}" P1="$szRoutingStateInfo" S2="%varExName%" P3="$szRoutingLinkName" P4="$szRoutingSMTPInstanceName" P9="$iRoutingMessage" GUID="841ba030-9991-45dc-bbd1-59ece21b28e9"/>
							</Setting>
							<Setting Key1="VirtualServerName" Substitution="SMTPINSTANCE"/>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%">
								<Setting Key1="adminDisplayName">
									<Rule Name="szRoutingSMTPInstanceName" Query="$."/>
								</Setting>
							</Object>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key2="root\cimv2\applications\exchange" Key3="ExchangeLink" Key4="ProtocolName='SMTP' AND TypeLocalDelivery='True'" TrackProgress="TrackProgress">
							<Setting Key1="LinkName">
								<Rule Name="szLocalDeliveryLinkName" Query="$.">
									<Variable Name="varLDLinkName" Scope="Children"/>
								</Rule>
							</Setting>
							<Setting Key1="ExtendedStateInfo">
								<Rule Name="szLocalDeliveryStateInfo" Query="$."/>
							</Setting>
							<Setting Key1="NumberOfMessages">
								<Rule Name="fLocalDeliveryMany" Query="$. &gt;100" Error="Error" Sev="2" ReportIssue="Summary" Title="Messages pending local delivery" Text="The 'Local delivery' queue ({3}) on server {2} holds more than 100 messages. Source: '{4}'. Number of messages in the queue: {9}." S2="%varExName%" P3="$szLocalDeliveryLinkName" P4="$szLocalDeliverySMTPInstanceName" P9="$iLocalDeliveryMessage"/>
								<Rule Name="iLocalDeliveryMessage" Query="$."/>
							</Setting>
							<Setting Key1="StateFrozen">
								<Rule Name="fLocalDeliveryFrozen" Query="upper-case($.)='TRUE'" Error="Error" Sev="1" ReportIssue="Issue" Title="Messages pending local delivery" Text="The 'Local delivery' queue ({3}) on server {2} is frozen. Source: '{4}'. Number of message(s) in the queue: {9}. This queue needs to be unfrozen for messages to be delivered." S2="%varExName%" P3="$szLocalDeliveryLinkName" P4="$szLocalDeliverySMTPInstanceName" P9="$iLocalDeliveryMessage" GUID="e8c7f990-1076-4f32-b906-76fdb3a4dc6c"/>
							</Setting>
							<Setting Key1="StateRetry">
								<Rule Name="fLocalDeliveryRetry" Query="upper-case($.)='TRUE'" Error="Error" Sev="2" ReportIssue="Summary" Title="Messages pending local delivery" Text="The 'Local delivery' queue ({3}) on server {2} is in retry status. Source: '{4}'. Number of message(s) in the queue: {9}. Additional status information: {1}" P1="$szLocalDeliveryStateInfo" S2="%varExName%" P3="$szLocalDeliveryLinkName" P4="$szLocalDeliverySMTPInstanceName" P9="$iLocalDeliveryMessage" GUID="74c90bcf-1e8b-4fa3-822a-911552a5303e"/>
							</Setting>
							<Setting Key1="VirtualServerName" Substitution="SMTPINSTANCE"/>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%">
								<Setting Key1="adminDisplayName">
									<Rule Name="szLocalDeliverySMTPInstanceName" Query="$."/>
								</Setting>
							</Object>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key2="root\cimv2\applications\exchange" Key3="ExchangeLink" Key4="ProtocolName='SMTP' and TypePendingSubmission='True'" TrackProgress="TrackProgress">
							<Setting Key1="LinkName">
								<Rule Name="szPendingSubmissionLinkName" Query="$."/>
							</Setting>
							<Setting Key1="ExtendedStateInfo">
								<Rule Name="szPendingSubmissionStateInfo" Query="$."/>
							</Setting>
							<Setting Key1="NumberOfMessages">
								<Rule Name="fPendingSubmissionMany" Query="$. &gt;50" Error="Error" Sev="2" ReportIssue="Summary" Title="'Messages pending submission' queue is backing up" Text="The 'Messages pending submission' queue ({3}) on server {2} holds more than 50 messages. Source: '{4}'. Number of messages in the queue: {9}." S2="%varExName%" P3="$szPendingSubmissionLinkName" P4="$szPendingSubmissionSMTPInstanceName" P9="$iPendingSubmissionMessage"/>
								<Rule Name="iPendingSubmissionMessage" Query="$."/>
							</Setting>
							<Setting Key1="StateFrozen">
								<Rule Name="fPendingSubmissionFrozen" Query="upper-case($.)='TRUE'" Error="Error" Sev="1" ReportIssue="Issue" Title="'Messages pending submission' queue is frozen" Text="The 'Messages pending submission' queue ({3}) on server {2} is frozen. Source: '{4}'. Number of message(s) in the queue: {9}. This queue needs to be unfrozen for messages to flow." S2="%varExName%" P3="$szPendingSubmissionLinkName" P4="$szPendingSubmissionSMTPInstanceName" P9="$iPendingSubmissionMessage" GUID="c3e4957e-fc47-4fcd-96bc-cccaffca638e"/>
							</Setting>
							<Setting Key1="StateRetry">
								<Rule Name="fPendingSubmissionRetry" Query="upper-case($.)='TRUE'" Error="Error" Sev="2" ReportIssue="Summary" Title="'Messages pending submission' queue is in retry" Text="The 'Messages pending submission' queue ({3}) on server {2} is in retry status. Source: '{4}'. Number of message(s) in the queue: {9}. Additional status information: {1}" P1="$szPendingSubmissionStateInfo" S2="%varExName%" P3="$szPendingSubmissionLinkName" P4="$szPendingSubmissionSMTPInstanceName" P9="$iPendingSubmissionMessage" GUID="eccf7aca-0691-49bd-b9fc-5077d73ee627"/>
							</Setting>
							<Setting Key1="VirtualServerName" Substitution="SMTPINSTANCE"/>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%">
								<Setting Key1="adminDisplayName">
									<Rule Name="szPendingSubmissionSMTPInstanceName" Query="$."/>
								</Setting>
							</Object>
						</Object>
						<!-- For remote delivery queues, we need extra rules to resolve link names and destination servers -->
						<Object Type="WMI" Key1="%varExName%" Key2="root\cimv2\applications\exchange" Key3="ExchangeLink" Key4="ProtocolName='SMTP' and TypeRemoteDelivery='True'" TrackProgress="TrackProgress">
							<Setting Key1="LinkName">
								<!-- Find out link names or server names -->
								<Rule Name="szRemoteDeliveryRawLinkName" Query="$."/>
								<Rule Name="szRemoteDeliveryLinkName" Query="if (count($szRemoteDeliveryResolvedLinkName) &gt;0, $szRemoteDeliveryModifiedLinkName, $.)" AlwaysEvaluate="True"/>
								<Rule Name="szRemoteDeliveryProbLinkServerOrDomain" Query="if ((count($szRemoteDeliveryStateInfo) &gt;0 or $fRemoteDeliveryMany or $fRemoteDeliveryRetry) and count($szRemoteDeliveryResolvedLinkName) = 0, $.)" AlwaysEvaluate="True"/>
								<Rule Name="szRemoteDeliveryProbLinkSourceBH" Query="if ((count($szRemoteDeliveryStateInfo) &gt;0 or $fRemoteDeliveryMany or $fRemoteDeliveryRetry) and $fStuckToSourceBH, join(';', $szSourceBH))" AlwaysEvaluate="True"/>
								<Rule Name="szRemoteDeliveryProbLinkRGC" Query="if ((count($szRemoteDeliveryStateInfo) &gt;0 or $fRemoteDeliveryMany or $fRemoteDeliveryRetry) and $szConnectorType = 'RG' and not($fStuckToSourceBH), $szRemoteDeliveryLinkGuid)" AlwaysEvaluate="True"/>
								<Rule Name="szRemoteDeliveryProbLinkSMTPDestServer" Query="if ((count($szRemoteDeliveryStateInfo) &gt;0 or $fRemoteDeliveryMany or $fRemoteDeliveryRetry) and string-length($szSMTPDestServer) &gt;0 and not($fStuckToSourceBH), $szSMTPDestServer)" AlwaysEvaluate="True"/>
								<Rule Name="szRemoteDeliveryProbLinkSMTPDestDomain" Query="if ((count($szRemoteDeliveryStateInfo) &gt;0 or $fRemoteDeliveryMany or $fRemoteDeliveryRetry) and $szConnectorType = 'SMTP' and string-length($szSMTPDestServer) &lt;1 and not($fStuckToSourceBH), $.)" AlwaysEvaluate="True"/>
							</Setting>
							<Setting Key1="ExtendedStateInfo">
								<Rule Name="szRemoteDeliveryStateInfo" Query="$."/>
							</Setting>
							<Setting Key1="NumberOfMessages">
								<Rule Name="fRemoteDeliveryMany" Query="$. &gt;100" Error="Error" Sev="1" ReportIssue="Summary" Title="'Remote delivery' queue ({3}) is backing up" Text="The 'Remote delivery' queue ({3}) on server {2} holds more than 100 messages. Source: '{4}'. Number of messages in the queue: {9}." S2="%varExName%" P3="$szRemoteDeliveryLinkName" P4="$szRemoteDeliverySMTPInstanceName" P9="$iRemoteDeliveryMessage"/>
								<Rule Name="iRemoteDeliveryMessage" Query="$."/>
							</Setting>
							<Setting Key1="StateFrozen">
								<Rule Name="fRemoteDeliveryFrozen" Query="upper-case($.)='TRUE'" Error="Error" Sev="1" ReportIssue="Issue" Title="'Remote delivery' queue ({3}) is frozen" Text="The 'Remote delivery' queue ({3}) on server {2} is frozen. Source: '{4}'. Number of message(s) in the queue: {9}. This queue needs to be unfrozen for messages to flow." S2="%varExName%" P3="$szRemoteDeliveryLinkName" P4="$szRemoteDeliverySMTPInstanceName" P9="$iRemoteDeliveryMessage" GUID="a98a5d91-0016-44d1-a2d1-ada798e5d393"/>
							</Setting>
							<Setting Key1="StateRetry">
								<Rule Name="fRemoteDeliveryRetry" Query="upper-case($.)='TRUE'" Error="Error" Sev="1" ReportIssue="Summary" Title="'Remote delivery' queue ({3}) is in retry" Text="The 'Remote delivery' queue ({3}) on server {2} is in retry status. Source: '{4}'. Number of message(s) in the queue: {9}. Additional status information: {1}" P1="$szRemoteDeliveryStateInfo" S2="%varExName%" P3="$szRemoteDeliveryLinkName" P4="$szRemoteDeliverySMTPInstanceName" P9="$iRemoteDeliveryMessage" GUID="f4fb5be2-4659-44f6-b956-70b8099e7a2e"/>
							</Setting>
							<Setting Key1="LinkDN" Substitution="LINKGUID">
								<Rule Name="szRemoteDeliveryLinkGuid" Query="$."/>
							</Setting>
							<Setting Key1="VirtualServerName" Substitution="SMTPINSTANCE"/>
							<!-- Need to resolve GUID with link names -->
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%LINKGUID%&gt;">
								<Setting Key1="cn">
									<Rule Name="szRemoteDeliveryResolvedLinkName" Query="$."/>
									<Rule Name="szRemoteDeliveryModifiedLinkName" Query="if ($szConnectorType = 'RG', concat (string(@Title), $.), if ($szConnectorType = 'SMTP', concat ($szSMTPConnectorType, $., ' - ', $szRemoteDeliveryRawLinkName)))" Title="Routing Group Connector: "/>
									<Rule Name="fStuckToSourceBH" Query="count($szSourceBH) &gt;0 and $fLocalSMTPInstanceNotIncluded" AlwaysEvaluate="True"/>
									<Rule Name="szSMTPConnectorType" Query="string(@Title)" Title="SMTP Connector: "/>
								</Setting>
								<Setting Key1="objectCategory">
									<Rule Name="szConnectorType" Query="if(starts-with($.,'CN=ms-Exch-Routing-Group-Connector'), 'RG', if(starts-with($., 'CN=ms-Exch-Routing-SMTP-Connector'), 'SMTP'))"/>
								</Setting>
								<Setting Key1="msExchSourceBridgeheadServersDN">
									<Rule Name="szSourceBH" Query="$."/>
									<Rule Name="fLocalSMTPInstanceNotIncluded" Query="count($.[upper-case(.)=upper-case('CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%')]) &lt;1"/>
								</Setting>
								<!-- For SMTP connectors, it is necessary to know now whether the queue is destined to specific smart hosts or domains. -->
								<Setting Key1="msExchSmtpSmartHost">
									<Rule Name="szSMTPDestServer" Query="lower-case($.)"/>
								</Setting>
							</Object>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%">
								<Setting Key1="adminDisplayName">
									<Rule Name="szRemoteDeliverySMTPInstanceName" Query="$."/>
								</Setting>
							</Object>
						</Object>
						<!-- We now look at the Messages with an unreachable destination queue -->
						<Object Type="WMI" Key1="%varExName%" Key2="root\cimv2\applications\exchange" Key3="ExchangeLink" Key4="ProtocolName='SMTP' and TypeCurrentlyUnreachable='True'" TrackProgress="TrackProgress">
							<Setting Key1="LinkName">
								<Rule Name="szCurrentlyUnreachableLinkName" Query="$."/>
							</Setting>
							<Setting Key1="ExtendedStateInfo">
								<Rule Name="szCurrentlyUnreachableStateInfo" Query="$."/>
							</Setting>
							<Setting Key1="NumberOfMessages">
								<Rule Name="fCurrentlyUnreachableNonZero" Query="$. &gt; 0" Error="Error" Sev="3" ReportIssue="Issue" Title="'Messages with an unreachable destination' queue holds messages" Text="The 'Messages with an unreachable destination' queue ({3}) on server {2} holds one or more messages. Source: '{4}'. Number of messages in the queue: {9}. This may indicate that no alternative available route exists to a connector or remote destination." S2="%varExName%" P3="$szCurrentlyUnreachableLinkName" P4="$szCurrentlyUnreachableSMTPInstanceName" P9="$iCurrentlyUnreachableMessage" GUID="8ac3b135-4fea-4324-8770-d9d23295376b"/>
								<Rule Name="iCurrentlyUnreachableMessage" Query="$."/>
							</Setting>
							<Setting Key1="StateFrozen">
								<Rule Name="fCurrentlyUnreachableFrozen" Query="upper-case($.)='TRUE'" Error="Error" Sev="1" ReportIssue="Issue" Title="'Messages with an unreachable destination' queue is frozen" Text="The 'Messages with an unreachable destination' queue ({3}) on server {2} is frozen. Source: '{4}'. Number of message(s) in the queue: {9}. This queue needs to be unfrozen for messages to flow." S2="%varExName%" P3="$szCurrentlyUnreachableLinkName" P4="$szCurrentlyUnreachableSMTPInstanceName" P9="$iCurrentlyUnreachableMessage" GUID="49860e75-1866-491f-bf28-c0f2e3708551"/>
							</Setting>
							<Setting Key1="StateRetry">
								<Rule Name="fCurrentlyUnreachableRetry" Query="upper-case($.)='TRUE'" Error="Error" Sev="2" ReportIssue="Issue" Title="'Messages with an unreachable destination' queue is in retry" Text="The 'Messages with an unreachable destination' queue ({3}) on server {2} is in retry status. Source: '{4}'. Number of message(s) in the queue: {9}. Additional status information: {1}" P1="$szCurrentlyUnreachableStateInfo" S2="%varExName%" P3="$szCurrentlyUnreachableLinkName" P4="$szCurrentlyUnreachableSMTPInstanceName" P9="$iCurrentlyUnreachableMessage" GUID="95a4967a-7627-4a4a-aa5f-bafce7b72f78"/>
							</Setting>
							<Setting Key1="VirtualServerName" Substitution="SMTPINSTANCE"/>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%">
								<Setting Key1="adminDisplayName">
									<Rule Name="szCurrentlyUnreachableSMTPInstanceName" Query="$."/>
								</Setting>
							</Object>
						</Object>
						<Rule Name="szExceptionText" Query="concat(../Exception/@Message,../Instance/Object/Exception/@Message)" AlwaysEvaluate="True"/>
						<Rule Name="fFatalWMIError" Query="../Exception/@Message or ../Instance/Object/Exception/@Message" Error="Error" Sev="1" Title="Error accessing WMI. Aborting SMTP queue analysis" Text="Unable to query the queue settings on server {2}. User credentials may be incorrect, or there may be a problem with the Windows Management Instrumentation (WMI) service on that computer. Error message: {1}" P1="$szExceptionText" S2="%varExName%" AlwaysEvaluate="True"/>

						<Rule Name="szCheckQueueStatus" Query="'CheckQueueStatus'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if(not ($fNoBackedUpQueue),string(@Title),$szExNoErrorStateText)" Title="One or more errors were found." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No major queues are backing up."/>
						<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Initial Queue Analysis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>
						<Rule Name="szAllRemoteDeliveryProbLinkServerOrDomain" Query="lower-case(join(',', $szRemoteDeliveryProbLinkServerOrDomain))">
							<Variable Name="varAllRDProbLinkServerOrDomain" Scope="Children"/>
						</Rule>
						<Rule Name="szAllRemoteDeliveryProbLinkSourceBH" Query="join(';', $szRemoteDeliveryProbLinkSourceBH)">
							<Variable Name="varAllRDProbLinkSourceBH" Scope="Children"/>
						</Rule>
						<Rule Name="szAllRemoteDeliveryProbLinkRGC" Query="join(',', $szRemoteDeliveryProbLinkRGC)">
							<Variable Name="varAllRDProbLinkRGC" Scope="Children"/>
						</Rule>
						<Rule Name="szAllRemoteDeliveryProbLinkSMTPDestServer" Query="lower-case(replace (join(',', $szRemoteDeliveryProbLinkSMTPDestServer),';',','))">
							<Variable Name="varAllRDProbLinkSMTPDestServer" Scope="Children"/>
						</Rule>
						<Rule Name="szAllRemoteDeliveryProbLinkSMTPDestDomain" Query="lower-case(join(',', $szRemoteDeliveryProbLinkSMTPDestDomain))">
							<Variable Name="varAllRDProbLinkSMTPDestDomain" Scope="Children"/>
						</Rule>

						<Rule Name="fMADLBackedUp" Query="($fMADLMany or $fMADLRetry) and not ($fMADLFrozen)" AlwaysEvaluate="True"/>
						<Rule Name="fRoutingBackedUp" Query="($fRoutingMany or $fRoutingRetry) and not ($fRoutingFrozen)" AlwaysEvaluate="True"/>
						<Rule Name="fLocalDeliveryBackedUp" Query="($fLocalDeliveryMany or $fLocalDeliveryRetry) and not ($fLocalDeliveryFrozen)" AlwaysEvaluate="True"/>
						<Rule Name="fPendingSubmissionBackedUp" Query="($fPendingSubmissionBackedUp or $fPendingSubmissionRetry) and not ($fPendingSubmissionFrozen)" AlwaysEvaluate="True"/>
						<Rule Name="fRemoteDeliveryBackedUp" Query="($fRemoteDeliveryMany or $fRemoteDeliveryRetry) and not ($fRemoteDeliveryFrozen)" AlwaysEvaluate="True">
							<Variable Name="varRemoteDeliveryBackedUp" Scope="Children"/>
						</Rule>
						<Rule Name="fCurrentlyUnreachableBackedUp" Query="($fCurrentlyUnreachableNonZero or $fCurrentlyUnreachableRetry) and not ($fCurrentlyUnreachableFrozen)" AlwaysEvaluate="True"/>

						<Rule Name="fFrozenQueue" Query="$fMADLFrozen or $fRoutingFrozen or $fLocalDeliveryFrozen or $fPendingSubmissionFrozen or $fRemoteDeliveryFrozen" Error="Error" ReportIssue="RootCause" Sev="1" Title="Frozen queues detected" Text="At least one SMTP queue on server {2} is frozen and this can be a cause of mail flow problems. Please unfreeze the queues and check whether messages can flow. If the problem persists, please run the tool again." S2="%varExName%" GUID="28916158-3b7c-4ff8-b924-429658f6c354" AlwaysEvaluate="True"/>
						<Rule Name="fNoBackedUpQueue" Query="not($fMADLBackedUp or $fMADLFrozen or $fRoutingBackedUp or $fRoutingFrozen or $fLocalDeliveryBackedUp or $fLocalDeliveryFrozen or $fPendingSubmissionBackedUp or $fPendingSubmissionFrozen or $fRemoteDeliveryBackedUp or $fRemoteDeliveryFrozen or $fFatalWMIError or $fWMITimeout)" Error="None" ReportIssue="Summary" Title="No queues are backing up" Text="No major SMTP queues on server {2} are backing up." S2="%varExName%" AlwaysEvaluate="True"/>
						<Rule Name="fTwoOutofThree" Query="($fMADLBackedUp and $fLocalDeliveryBackedUp) or ($fMADLBackedUp and $fRoutingBackedUp) or ($fLocalDeliveryBackedUp and $fRoutingBackedUp)"/>
						<Rule Name="fOnlyMADL" Query="$fMADLBackedUp and not($fTwoOutofThree) and not($fFatalWMIError) and not($fWMITimeout)" AlwaysEvaluate="True"/>
						<Rule Name="fOnlyLD" Query="$fLocalDeliveryBackedUp and not($fTwoOutofThree) and not($fFatalWMIError) and not($fWMITimeout)" AlwaysEvaluate="True"/>
						<Rule Name="fOnlyPR" Query="$fRoutingBackedUp and not($fTwoOutofThree) and not($fFatalWMIError) and not($fWMITimeout)" AlwaysEvaluate="True"/>
						<Rule Name="fOnlyUnreachable" Query="$fCurrentlyUnreachableBackedUp and not ($fRemoteDeliveryBackedUp or $fRoutingBackedUp or $fMADLBackedUp or $fTwoOutofThree or $fFatalWMIError or $fWMITimeout)" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckQueueStatusStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
						<Rule NextStep="RDInitialCheck" Name="fGotoRDInitialCheck" Query="$fRemoteDeliveryBackedUp" Priority="2" Text="- Start investigation on 'Remote delivery' queue(s)" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="MADLCatCheck" Name="fGotoMADLCatCheck" Query="$fOnlyMADL" Priority="10" Text="- Start investigation on the 'Messages awaiting directory lookup' queue" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="LDInitialCheck" Name="fGotoLDInitialCheck" Query="$fOnlyLD" Priority="20" Text="- Start investigation on the 'Local delivery' queue" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="PRInitialCheck" Name="fGotoPRInitialCheck" Query="$fRoutingBackedUp" Priority="20" Text="- Start investigation on the 'Messages waiting to be routed' queue" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckLinkState" Name="fGotoCheckLinkState" Query="$fOnlyUnreachable" Priority="20" Text="- Check link state information for possible routing issues" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckLinkStateChurn" Name="fGotoCheckLinkStateChurn" Query="$fOnlyUnreachable" Priority="20" Text="- Check link state version changes" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="GQServerLoadCheck" Name="fGotoGQServerLoadCheck" Query="$fTwoOutofThree or $fOnlyPR or $fPendingSubmissionBackedUp" Priority="30" Text="- Start general SMTP queue troubleshooting" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckDomainRouting" Name="fGotoCheckDomainRouting" Query="$fNoBackedUpQueue" Priority="40" Text="- Check the domain routing information stored in recipient policies, connectors and the metabase" Display="Hide" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckE12QueueStatus" Title="Check Status of SMTP Queues" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varMonadDCParameter%" Substitution="varMonadDCParameter" Display="Hide"/>
			<Setting Key1="%varRootDomainDN%" Substitution="varRootDomainDN" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of SMTP Queues" Text="Please wait while the tool checks the status of SMTP queues on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">

				<!-- Let's check the status of each queue -->
				<!--The possible enumeration values are "Undefined, DnsConnectorDelivery, MapiDelivery, NonSmtpGatewayDelivery, SmartHostConnectorDelivery, SmtpRelayToRemoteAdSite, SmtpRelayToTiRg, SmtpRelayWithinAdSite, SmtpRelayWithinAdSiteToEdge, Unreachable"." -->
				<Object Type="Group" Name="SMTP Queue Status" Class="Area" GroupingClass="True" TrackProgress="TrackProgress" MaxTime="ALL,1" MaxFailures="ALL,1" MaxTimeouts="ALL,1" SecurityContext="EXLOGON">
					<!--get-Queue does not support -DomainController property-->
					<Object Type="MonadCommand" Name="Identity" Key1="get-queue -Server '%varExName%' -Filter {DeliveryType -eq &quot;Unreachable&quot;}">
						<Setting Key1="Identity">
							<Rule Name="szUnreachableQueueName" Query="$.">
								<Variable Name="varUnreachableQueueName" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="MessageCount">
							<Rule Name="fUnreachableMany" Query="$. &gt;0" Error="Error" Sev="2" ReportIssue="Summary" Title="Unreachable Queue" Text="Unreachable queue ({3}) on server {2} has more than one entry. Number of messages in the queue: {9}." S2="%varExName%" P3="$szUnreachableQueueName" P9="$iUnreachableMessage"/>
							<Rule Name="iUnreachableMessage" Query="$."/>
						</Setting>
					</Object>

					<Object Type="MonadCommand" Name="Identity" Key1="get-queue -Server '%varExName%' -Filter {NextHopDomain -eq &quot;Poison Message&quot;}">
						<Setting Key1="Identity">
							<Rule Name="szPoisonQueueName" Query="$."/>
						</Setting>
						<Setting Key1="MessageCount">
							<Rule Name="fPoisonMany" Query="$. &gt;0" Error="Warning" Sev="2" ReportIssue="Summary" Title="Poison Message Queue" Text="Poison Message queue ({3}) on server {2} has one or more entries. This queue contains messages that are determined to be potentially harmful to the Exchange Server 2007. Number of messages in the queue: {9}." S2="%varExName%" P3="$szPoisonQueueName" P9="$iPoisonMessage"/>
							<Rule Name="iPoisonMessage" Query="$."/>
						</Setting>
					</Object>

					<!-- Local delivery queues will not be in retry when delivery to an MDB is failing. -->
					<!-- The current implementation checks for messages in retry for any local delivery queue -->
					<!-- A change of one LD Queue for each MDB rather than one per server will allow more granular diagnostics -->
					<!-- This code should change to provide per MDB root-cause analysis should that change be implemented -->
					<Object Type="MonadCommand" Name="Identity" Key1="get-queue -Server '%varExName%' -Filter {DeliveryType -eq &quot;MapiDelivery&quot;}">
						<Setting Key1="Identity" Substitution="QID">
							<Rule Name="szLocalDeliveryLinkName" Query="$."/>
						</Setting>
						<Setting Key1="MessageCount">
							<Rule Name="fLocalDeliveryMany" Query="$. &gt;50" Error="Error" Sev="2" ReportIssue="Summary" Title="Messages pending local delivery" Text="The 'Local delivery' queue ({3}) on server {2} holds more than 50 messages. Number of messages in the queue: {9}." S2="%varExName%" P3="$szLocalDeliveryLinkName" P9="$iLocalDeliveryMessage"/>
							<Rule Name="iLocalDeliveryMessage" Query="$."/>
						</Setting>
						<Setting Key1="Status" Format="Enum">
							<Rule Name="fLocalDeliveryStateInfo" Query="$fLocalDeliveryFrozen or $fLocalDeliveryRetry"/>
							<Rule Name="fLocalDeliveryFrozen" Query="$.='4'" Error="Error" Sev="1" ReportIssue="Issue" Title="Messages pending local delivery" Text="The 'Local delivery' queue ({3}) on server {2} is frozen. Number of message(s) in the queue: {9}. This queue needs to be unfrozen for messages to be delivered." S2="%varExName%" P3="$szLocalDeliveryLinkName" P9="$iLocalDeliveryMessage"/>
							<Rule Name="fLocalDeliveryRetry" Query="$.='3'" Error="Error" Sev="2" ReportIssue="Summary" Title="Messages pending local delivery" Text="The 'Local delivery' queue ({3}) on server {2} is in retry status. Number of message(s) in the queue: {9}. Additional status information: {1}" P1="$szLocalDeliveryLastError" S2="%varExName%" P3="$szLocalDeliveryLinkName" P9="$iLocalDeliveryMessage"/>
						</Setting>
						<Setting Key1="NextHopDomain" Substitution="MBFQDN"/>
						<Setting Key1="LastError">
							<Rule Name="szLocalDeliveryLastError" Query="$."/>
						</Setting>

						<!-- Find any messages in the local delivery queue that are in retry and delivery has been attemprted more than once -->
						<Object Type="MonadCommand" Name="Identity" Key1="get-Message -Server '%varExName%' -Filter {Queue -eq &quot;%QID%&quot; -and Status -eq 'Retry' -and RetryCount -gt 0}">
							<Rule Name="fLocalDeliveryMDBRetry" Query="count(../Instance) &gt;0" Error="Error" Sev="2" ReportIssue="Summary" Title="Messages in 'Local delivery' queue are in retry" Text="The 'Local delivery' queue ({3}) on server {4} has one or more messages in retry status." P3="$szLocalDeliveryLinkName" S4="%varExName%"/>
						</Object>

						<!-- Find the Mailbox Server the Hub Transport attempted message delivery -->
						<Object Type="MonadCommand" Name="Identity" Key1="get-ExchangeServer %varMonadDCParameter% | where {$_.Fqdn -eq &quot;%MBFQDN%&quot;}">
							<Setting Key1="Name">
								<Rule Name="szLocalDeliveryMailboxName" Query="$."/>
							</Setting>
							<Setting Key1="AdminDisplayVersion"/>
						</Object>
					</Object>

					<Object Type="MonadCommand" Name="Identity" Key1="get-queue -Server '%varExName%' -Filter {NextHopDomain -eq &quot;Submission&quot;}">
						<Setting Key1="Identity">
							<Rule Name="szPendingSubmissionLinkName" Query="$."/>
						</Setting>
						<Setting Key1="MessageCount">
							<Rule Name="fPendingSubmissionMany" Query="$. &gt;50" Error="Error" Sev="2" ReportIssue="Summary" Title="'Messages pending submission' queue is backing up" Text="The 'Messages pending submission' queue ({3}) on server {2} holds more than 50 messages. Number of messages in the queue: {9}." S2="%varExName%" P3="$szPendingSubmissionLinkName" P9="$iPendingSubmissionMessage"/>
							<Rule Name="iPendingSubmissionMessage" Query="$."/>
						</Setting>
						<Setting Key1="Status" Format="Enum">
							<Rule Name="fPendingSubmissionStateInfo" Query="$fPendingSubmissionFrozen or $fPendingSubmissionRetry"/>
							<Rule Name="fPendingSubmissionFrozen" Query="$.='4'" Error="Error" Sev="1" ReportIssue="Issue" Title="'Messages pending submission' queue is frozen" Text="The 'Messages pending submission' queue ({3}) on server {2} is frozen. Number of message(s) in the queue: {9}. This queue needs to be unfrozen for messages to flow." S2="%varExName%" P3="$szPendingSubmissionLinkName" P9="$iPendingSubmissionMessage" GUID="c3e4957e-fc47-4fcd-96bc-cccaffca638e"/>
							<Rule Name="fPendingSubmissionRetry" Query="$.='3'" Error="Error" Sev="2" ReportIssue="Summary" Title="'Messages pending submission' queue is in retry" Text="The 'Messages pending submission' queue ({3}) on server {2} is in retry status. Number of message(s) in the queue: {9}. Additional status information: {1}" P1="$szPendingSubmissionLastError" S2="%varExName%" P3="$szPendingSubmissionLinkName" P9="$iPendingSubmissionMessage" GUID="eccf7aca-0691-49bd-b9fc-5077d73ee627"/>
						</Setting>
						<Setting Key1="LastError">
							<Rule Name="szPendingSubmissionLastError" Query="$."/>
						</Setting>
					</Object>

					<!-- For remote delivery queues, we need extra rules to resolve link names and destination servers -->
					<Object Type="MonadCommand" Name="Identity" Key1="get-queue -Server '%varExName%' -Filter {DeliveryType -ne &quot;MapiDelivery&quot; -and DeliveryType -ne &quot;Undefined&quot; -and DeliveryType -ne &quot;Unreachable&quot;}">
						<Setting Key1="Identity">
							<Rule Name="szRemoteDeliveryLinkName" Query="$."/>
						</Setting>
						<Setting Key1="Status" Format="Enum">
							<Rule Name="fRemoteDeliveryStateInfo" Query="$fRemoteDeliveryFrozen or $fRemoteDeliveryRetry"/>
							<Rule Name="fRemoteDeliveryFrozen" Query="$.='4'" Error="Error" Sev="1" ReportIssue="Issue" Title="'Remote delivery' queue ({3}) is frozen" Text="The 'Remote delivery' queue ({3}) on server {2} is frozen. Number of message(s) in the queue: {9}. This queue needs to be unfrozen for messages to flow." S2="%varExName%" P3="$szRemoteDeliveryLinkName" P9="$iRemoteDeliveryMessage" GUID="a98a5d91-0016-44d1-a2d1-ada798e5d393"/>
							<Rule Name="fRemoteDeliveryRetry" Query="$.='3'" Error="Error" Sev="2" ReportIssue="Summary" Title="'Remote delivery' queue ({3}) is in retry" Text="The 'Remote delivery' queue ({3}) on server {2} is in retry status. Number of message(s) in the queue: {9}. Last error information: {1}" P1="$szRemoteDeliveryLastError" S2="%varExName%" P3="$szRemoteDeliveryLinkName" P9="$iRemoteDeliveryMessage" GUID="f4fb5be2-4659-44f6-b956-70b8099e7a2e"/>
						</Setting>
						<Setting Key1="MessageCount">
							<Rule Name="fRemoteDeliveryMany" Query="$. &gt;100" Error="Error" Sev="1" ReportIssue="Summary" Title="'Remote delivery' queue ({3}) is backing up" Text="The 'Remote delivery' queue ({3}) on server {2} holds more than 100 messages. Number of messages in the queue: {9}." S2="%varExName%" P3="$szRemoteDeliveryLinkName" P9="$iRemoteDeliveryMessage"/>
							<Rule Name="iRemoteDeliveryMessage" Query="$."/>
						</Setting>
						<Setting Key1="DeliveryType" Substitution="DELIVERYTYPE">
							<Rule Name="szConnectorType" Query="$."/>
						</Setting>
						<Setting Key1="NextHopDomain" Substitution="NEXTHOPDOMAIN">
							<Rule Name="szSMTPDestServer" Query="if ($fRemoteDeliveryStateInfo and $szConnectorType = 'SmartHostConnectorDelivery', $.)" AlwaysEvaluate="True"/>
							<Rule Name="szRemoteDeliveryRetryLinkRGC" Query="if (($fRemoteDeliveryStateInfo or $fRemoteDeliveryMany) and $szConnectorType = 'SmtpRelayToTiRg', $szRemoteDeliveryResolvedLinkName)" AlwaysEvaluate="True"/>
							<Rule Name="szRemoteDeliveryRetryAdSiteName" Query="if (($fRemoteDeliveryStateInfo or $fRemoteDeliveryMany) and $szConnectorType = 'SmtpRelayToRemoteAdSite', $.)" AlwaysEvaluate="True"/>
							<Rule Name="szRemoteDeliveryRetryLinkSMTPDestServer" Query="if (($fRemoteDeliveryStateInfo or $fRemoteDeliveryMany) and string-length($szSMTPDestServer) &gt;0, $.)" AlwaysEvaluate="True"/>
							<Rule Name="szRemoteDeliveryRetryLinkSMTPDestDomain" Query="if (($fRemoteDeliveryStateInfo or $fRemoteDeliveryMany) and $szConnectorType = 'DnsConnectorDelivery' and string-length($szSMTPDestServer) &lt;1, $.)" AlwaysEvaluate="True"/>
						</Setting>
						<Setting Key1="NextHopConnector" Substitution="LINKGUID">
							<Rule Name="szRemoteDeliveryResolvedLinkName" Query="$."/>
							<Rule Name="szRemoteDeliveryModifiedLinkName" Query="if ($szConnectorType = 'SmtpRelayToTiRg', concat (string(@Title), $.))" Title="Routing Group Connector: "/>
						</Setting>
						<Setting Key1="LastError">
							<Rule Name="szRemoteDeliveryLastError" Query="$."/>
						</Setting>

						<!-- Enumerate the servers that source an in-site connector -->
						<Object Type="If" Name="SmtpRelayWithinAdSite" Key1="'%DELIVERYTYPE%' = 'SmtpRelayWithinAdSite'">
							<Object Type="MonadCommand" Name="SourceTransportServers" Key1="get-SendConnector &quot;%NEXTHOPDOMAIN%&quot; %varMonadDCParameter%">
								<Setting Key1="SourceTransportServers" Substitution="ALLHUBCN" SubstitutionFormat="$----,"/>
								<Object Type="Cache" Name="SendConnectorCache" Key1="Show" Key2="%NEXTHOPDOMAIN%" Key3="%ALLHUBCN%" Key4=",">
									<Setting Key1="CN" Substitution="HUBCN"/>
									<Object Type="MonadCommand" Name="Identity" Key1="get-ExchangeServer %HUBCN% %varMonadDCParameter%">
										<Setting Key1="Fqdn" Substitution="HUBFQDN">
											<Rule Name="szRemoteDeliveryRetryWithinAdSiteServer" Query="$."/>
										</Setting>
										<Setting Key1="AdminDisplayVersion"/>
										<Object Type="Directory" Key1="GC://%varDCName%/" Key2="%varRootDomainDN%" Key3="(&amp;(objectCategory=computer)(ServicePrincipalName=SMTPSVC/%HUBFQDN%))" Key4="Subtree">
											<Rule Name="fSpnNotFoundInSite" Query="count(../Instance)=0" Error="Error" ReportIssue="RootCause" Sev="1" Title="Computer account for '{3}' not found in Active Directory" Text="No computer account in Active Directory has '{5}' set to '{3}'. This will result in Kerberos authentication failures when server {1} attempts to create an SMTP connection to remote server {2} for queue '{4}'." S1="%varExName%" S2="%HUBFQDN%" S3="SMTPSVC/%HUBFQDN%" P4="$szRemoteDeliveryLinkName" S5="ServicePrincipalName" AlwaysEvaluate="True"/>
											<Rule Name="fMultipleSpnFoundInSite" Query="count(../Instance)&gt;1" Error="Error" ReportIssue="RootCause" Sev="1" Title="More than one computer account for '{3}' found in Active Directory" Text="More than one computer account in Active Directory has '{5}' set to '{3}'. This will result in Kerberos authentication failures when server {1} attempts to create an SMTP connection to remote server {2} for queue '{4}'." S1="%varExName%" S2="%HUBFQDN%" P3="SMTPSVC/%HUBFQDN%" P4="$szRemoteDeliveryLinkName" S5="ServicePrincipalName" AlwaysEvaluate="True"/>
										</Object>
									</Object>
								</Object>
								<Rule Name="szAllRemoteDeliveryRetryWithinAdSiteServers" Query="lower-case(join(',', $szRemoteDeliveryRetryWithinAdSiteServer))"/>
							</Object>
							<Object Type="MonadCommand" Name="SourceTransportServers" Key1="get-RoutingGroupConnector -Identity %LINKGUID% %varMonadDCParameter%">
								<Setting Key1="SourceTransportServers" Substitution="ALLHUBCN" SubstitutionFormat="$----,"/>
								<Object Type="Cache" Name="RoutingGroupConnectorCache" Key1="Show" Key2="%LINKGUID%" Key3="%ALLHUBCN%" Key4=",">
									<Setting Key1="CN" Substitution="HUBCN"/>
									<Object Type="MonadCommand" Name="Identity" Key1="get-ExchangeServer %HUBCN% %varMonadDCParameter%">
										<Setting Key1="Fqdn">
											<Rule Name="szRemoteDeliveryRetryWithinAdSiteServerRGC" Query="$."/>
										</Setting>
										<Setting Key1="AdminDisplayVersion"/>
									</Object>
								</Object>
								<Rule Name="szAllRemoteDeliveryRetryWithinAdSiteServersRGC" Query="lower-case(join(',', $szRemoteDeliveryRetryWithinAdSiteServerRGC))"/>
							</Object>
						</Object>

						<!-- Enumerate the servers in a remote AD Site -->
						<Object Type="If" Name="SmtpRelayToRemoteAdSite" Key1="'%DELIVERYTYPE%' = 'SmtpRelayToRemoteAdSite'">
							<Object Type="MonadCommand" Name="Identity" Key1="get-AdSite %varMonadDCParameter% | where {$_.Name -eq &quot;%NEXTHOPDOMAIN%&quot;}">
								<Setting Key1="Identity.ObjectGuid" Substitution="SITEGUID"/>
								<Object Type="MonadCommand" Name="Identity" Key1="get-ExchangeServer %varMonadDCParameter% | where {$_.IsHubTransportServer -and $_.Site.ObjectGuid -eq '%SITEGUID%'}">
									<Setting Key1="Fqdn" Substitution="HUBFQDN">
										<Rule Name="szRemoteDeliveryRetryRemoteAdServer" Query="$."/>
									</Setting>
									<Setting Key1="AdminDisplayVersion"/>
									<Object Type="Directory" Key1="GC://%varDCName%/" Key2="%varRootDomainDN%" Key3="(&amp;(objectCategory=computer)(ServicePrincipalName=SMTPSVC/%HUBFQDN%))" Key4="Subtree">
										<Rule Name="fSpnNotFoundRemoteAd" Query="count(../Instance)=0" Error="Error" ReportIssue="RootCause" Sev="1" Title="Computer account for '{3}' not found in Active Directory" Text="No computer account in Active Directory has '{5}' set to '{3}'. This will result in Kerberos authentication failures when server {1} attempts to create an SMTP connection to remote server {2} for queue '{4}'." S1="%varExName%" S2="%HUBFQDN%" P3="concat('SMTPSVC/', '%HUBFQDN%')" P4="$szRemoteDeliveryLinkName" S5="ServicePrincipalName" AlwaysEvaluate="True"/>
										<Rule Name="fMultipleSpnFoundRemoteAd" Query="count(../Instance)&gt;1" Error="Error" ReportIssue="RootCause" Sev="1" Title="More than one computer account for '{3}' found in Active Directory" Text="More than one computer account in Active Directory has '{5}' set to '{3}'. This will result in Kerberos authentication failures when server {1} attempts to create an SMTP connection to remote server {2} for queue '{4}'." S1="%varExName%" S2="%HUBFQDN%" P3="concat('SMTPSVC/', '%HUBFQDN%')" P4="$szRemoteDeliveryLinkName" S5="ServicePrincipalName" AlwaysEvaluate="True"/>
									</Object>
								</Object>
								<Rule Name="szAllRemoteDeliveryRetryRemoteAdServers" Query="lower-case(join(',', $szRemoteDeliveryRetryRemoteAdServer))"/>
							</Object>
						</Object>

						<!-- Enumerate the Edge servers associated with NextHopDomain connector -->
						<Object Type="If" Name="SmtpRelayWithinAdSiteToEdge" Key1="'%DELIVERYTYPE%' = 'SmtpRelayWithinAdSiteToEdge'">
							<Object Type="MonadCommand" Name="SourceTransportServers" Key1="get-SendConnector &quot;%NEXTHOPDOMAIN%&quot; %varMonadDCParameter%">
								<Setting Key1="SourceTransportServers" Substitution="ALLHUBCN" SubstitutionFormat="$----,"/>
								<Object Type="Cache" Name="SendConnectorCache" Key1="Show" Key2="%NEXTHOPDOMAIN%" Key3="%ALLHUBCN%" Key4=",">
									<Setting Key1="CN" Substitution="HUBCN"/>
									<Object Type="MonadCommand" Name="Identity" Key1="get-ExchangeServer %HUBCN% %varMonadDCParameter%">
										<Setting Key1="Fqdn" Substitution="HUBFQDN">
											<Rule Name="szRemoteDeliveryRetryWithinAdSiteToEdge" Query="$."/>
										</Setting>
										<Setting Key1="AdminDisplayVersion"/>
										<Rule Name="szAllRemoteDeliveryRetryWithinAdSiteToEdge" Query="lower-case(join(',', $szRemoteDeliveryRetryWithinAdSiteToEdge))"/>
									</Object>
								</Object>
							</Object>
						</Object>

						<!-- Enumerate the servers in a remote RG -->
						<!-- Will implement when the RGC task is available -->
						<!-- I may not have to do this anymore, leaving as a placeholder -->

						<Rule Name="szRemoteDeliveryRetryLinkServerOrDomain" Query="concat(join(',',$szRemoteDeliveryRetryLinkSMTPDestServer),',',join(',',$szRemoteDeliveryRetryLinkSMTPDestDomain),',', join(',',$szAllRemoteDeliveryRetryWithinAdSiteServers),',', join(',',$szAllRemoteDeliveryRetryWithinAdSiteServersRGC),',', join(',',$szAllRemoteDeliveryRetryRemoteAdServers),',',join(',',$szAllRemoteDeliveryRetryWithinAdSiteToEdge))" AlwaysEvaluate="True"/>
					</Object>
					<Rule Name="szExceptionText" Query="concat(../Exception/@Message,../Instance/Object/Exception/@Message)" AlwaysEvaluate="True"/>
					<Rule Name="fFatalMonadError" Query="../Exception/@Message or ../Instance/Object/Exception/@Message" Error="Error" Sev="1" Title="Error executing Exchange Management Shell command. Aborting SMTP queue analysis" Text="Unable to query the queue settings on server {2}. User credentials may be incorrect, or there may be a problem with the PowerShell service on that computer. Error message: {1}" P1="$szExceptionText" S2="%varExName%" AlwaysEvaluate="True"/>

					<Rule Name="szCheckQueueStatus" Query="'CheckE12QueueStatus'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if(not ($fNoBackedUpQueue),string(@Title),$szExNoErrorStateText)" Title="One or more errors were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No major queues are backing up."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Initial Queue Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>
					<Rule Name="szAllLocalDeliveryMailboxNames" Query="lower-case(join(',', $szLocalDeliveryMailboxName))">
						<Variable Name="varAllLDMailboxNames" Scope="Children"/>
					</Rule>
					<Rule Name="szAllRemoteDeliveryRetryLinkServerOrDomain" Query="lower-case(join(',', $szRemoteDeliveryRetryLinkServerOrDomain))">
						<Variable Name="varAllRDProbLinkServerOrDomain" Scope="Children"/>
					</Rule>
					<Rule Name="szAllRemoteDeliveryRetryLinkRGC" Query="join(',', $szRemoteDeliveryRetryLinkRGC)">
						<Variable Name="varAllRDProbLinkRGC" Scope="Children"/>
					</Rule>
					<Rule Name="szAllRemoteDeliveryRetryLinkSMTPDestServer" Query="lower-case(replace (join(',', $szRemoteDeliveryRetryLinkSMTPDestServer),';',','))">
						<Variable Name="varAllRDProbLinkSMTPDestServer" Scope="Children"/>
					</Rule>
					<Rule Name="szAllRemoteDeliveryRetryLinkSMTPDestDomain" Query="lower-case(join(',', $szRemoteDeliveryRetryLinkSMTPDestDomain))">
						<Variable Name="varAllRDProbLinkSMTPDestDomain" Scope="Children"/>
					</Rule>

					<Rule Name="fLocalDeliveryBackedUp" Query="(($fLocalDeliveryMany or $fLocalDeliveryRetry) and not ($fLocalDeliveryFrozen)) or $fLocalDeliveryMDBRetry" AlwaysEvaluate="True"/>
					<Rule Name="fPendingSubmissionBackedUp" Query="($fPendingSubmissionMany or $fPendingSubmissionRetry) and not ($fPendingSubmissionFrozen)" AlwaysEvaluate="True"/>
					<Rule Name="fRemoteDeliveryBackedUp" Query="($fRemoteDeliveryMany or $fRemoteDeliveryRetry) and not ($fRemoteDeliveryFrozen)" AlwaysEvaluate="True"/>

					<Rule Name="fFrozenQueue" Query="$fLocalDeliveryFrozen or $fPendingSubmissionFrozen or $fRemoteDeliveryFrozen" Error="Error" ReportIssue="RootCause" Sev="1" Title="Frozen queues detected" Text="At least one SMTP queue on server {2} is frozen and this can be a cause of mail flow problems. Please unfreeze the queues and check whether messages can flow. If the problem persists, please run the tool again." S2="%varExName%" AlwaysEvaluate="True"/>
					<Rule Name="fNoBackedUpQueue" Query="not($fPoisonMany or $fUnreachableMany or $fLocalDeliveryBackedUp or $fLocalDeliveryFrozen or $fPendingSubmissionBackedUp or $fPendingSubmissionFrozen or $fRemoteDeliveryBackedUp or $fRemoteDeliveryFrozen)" Error="None" ReportIssue="Summary" Title="No queues are backing up" Text="No major SMTP queues on server {2} are backing up." S2="%varExName%" AlwaysEvaluate="True"/>
					<Rule Name="fMultipleIssuesFound" Query="($fPendingSubmissionBackedUp and $fLocalDeliveryBackedUp) or ($fPendingSubmissionBackedUp and $fRemoteDeliveryBackedUp) or ($fLocalDeliveryBackedUp and $fRemoteDeliveryBackedUp)" AlwaysEvaluate="True"/>
					<Rule Name="fOnlyLD" Query="$fLocalDeliveryBackedUp and not($fMultipleIssuesFound)" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckE12QueueStatusStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="RDInitialCheck" Name="fGotoRDInitialCheck" Query="$fRemoteDeliveryStateInfo" Priority="2" Text="- Start investigation on 'Remote delivery' queue(s)" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="LDInitialCheck" Name="fGotoLDInitialCheck" Query="$fLocalDeliveryStateInfo or $fLocalDeliveryMDBRetry" Priority="3" Text="- Start investigation on the '{1}' queue" S1="Local delivery" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="E12SubmissionQCheck" Name="fGotoE12SubmissionQCheck" Query="$fPendingSubmissionBackedUp" Priority="4" Text="- Start investigation on the '{1}' queue" S1="Submission" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="E12PoisonQCheck" Name="fGotoE12PoisonQCheck" Query="$fPoisonMany" Priority="5" Text="- Start investigation on the '{1}' queue" S1="Poison Message" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="E12UnreachableQCheck" Name="fGotoE12UnreachableQCheck" Query="$fUnreachableMany" Priority="5" Text="- Start investigation on the '{1}' queue" S1="Unreachable" Display="Hide" AlwaysEvaluate="True"/>

					<!-- Not yet implemented
					<Rule NextStep="GQServerLoadCheck" Name="fGotoGQServerLoadCheck" Query="$fMultipleIssuesFound or $fOnlyPR or $fPendingSubmissionBackedUp" Priority="30" Text="- Start general SMTP queue troubleshooting" Display="Hide" AlwaysEvaluate="True" />
					-->
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDInitialCheck" Title="Remote Delivery Initial Check" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varAllRDProbLinkServerOrDomain%" Substitution="varAllRDProbLinkServerOrDomain" Display="Hide"/>
			<Setting Key1="%varAllRDProbLinkSourceBH%" Substitution="varAllRDProbLinkSourceBH" Display="Hide"/>
			<Setting Key1="%varAllRDProbLinkRGC%" Substitution="varAllRDProbLinkRGC" Display="Hide"/>
			<Setting Key1="%varAllRDProbLinkSMTPDestServer%" Substitution="varAllRDProbLinkSMTPDestServer" Display="Hide"/>
			<Setting Key1="%varAllRDProbLinkSMTPDestDomain%" Substitution="varAllRDProbLinkSMTPDestDomain" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>
			<Setting Key1="%varIsExchange2000or2003%" Substitution="varIsExchange2000or2003" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of Remote Delivery Queues" Text="Please wait while the tool performs initial analysis of 'Remote delivery' queue(s) on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Remote SMTP Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<!-- Let's check what the destination servers are for those backed-up queues -->
					<!-- First, need to know the remote bridgehead for routing group connectors -->
					<Object Type="Cache" Name="ProbRGCList" Key1="Add" Key2="Link" Key3="%varAllRDProbLinkRGC%" Key4="," Display="Hide">
						<Setting Key1="RoutingGroupConnectorGuid" Substitution="LINKGUID"/>
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%LINKGUID%&gt;" Class="Name" GroupingClass="True">
							<Setting Key1="cn" Substitution="RGCNAME">
								<Rule Name="szRemoteDeliveryResolvedLinkName" Query="$."/>
							</Setting>
							<Setting Key1="msExchTargetBridgeheadServersDN" Substitution="RGCBHLIST" SubstitutionFormat="$----;"/>
							<Object Type="Cache" Name="RGCBHList" Key1="Add" Key2="RGCBH" Key3="%RGCBHLIST%" Key4=";" Display="Hide">
								<Setting Key1="SMTPVS" Substitution="RGCSMTPINSTANCE"/>
								<Setting Key1="ServerName" Substitution="RGCSERVERNAME" SubstitutionFormat="^CN=.*?,CN=.*?,CN=.*?,CN=(.*?[^\\]),.*$----$1"/>
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%RGCSMTPINSTANCE%">
									<Setting Key1="adminDisplayName">
										<Rule Name="szSMTPInstanceName" Query="$."/>
									</Setting>
									<Setting Key1="msExchSmtpFullyQualifiedDomainName">
										<Rule Name="szRGCRemoteBH" Query="lower-case($.)" Error="None" Title="Routing group connector remote bridgehead: {5}" Text="SMTP instance '{3}' on server {1} (fully-qualified domain name: {5}) is a remote bridgehead to which server {2} is possibly having trouble routing messages. Routing group connector: {4}." S1="%RGCSERVERNAME%" S2="%varExName%" P3="$szSMTPInstanceName" P4="$szRemoteDeliveryResolvedLinkName" P5="lower-case($.)"/>
									</Setting>
								</Object>
							</Object>
						</Object>
					</Object>
					<!-- Second, enumerate the destination servers for SMTP connectors -->
					<Object Type="Cache" Name="ProbSMTPServerList" Key1="Add" Key2="SMTPBH" Key3="%varAllRDProbLinkSMTPDestServer%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
						<Setting Key1="SMTPConnectorRemoteBH">
							<Rule Name="szSMTPDestServerFQDN" Query="if (not (contains($., '[')), $.)" Error="None" Title="SMTP Connector remote bridgehead: {1}" Text="Server {1} is a remote server to which server {2} is possibly having trouble routing messages through a SMTP Connector." P1="$." S2="%varExName%"/>
							<Rule Name="szSMTPDestServerIP" Query="if (contains($., '['), substring-before (substring-after ($.,'['), ']'))" Error="None" Title="SMTP Connector remote bridgehead: {1}" Text="{1} is the IP address of a remote server to which server {2} is possibly having trouble routing messages through a SMTP Connector." P1="$." S2="%varExName%"/>
						</Setting>
					</Object>
					<!-- Next, enumerate the target domain for SMTP connectors -->
					<Object Type="Cache" Name="ProbSMTPDomainList" Key1="Add" Key2="SMTPDomain" Key3="%varAllRDProbLinkSMTPDestDomain%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
						<Setting Key1="SMTPConnectorRemoteDomain">
							<Rule Name="szSMTPDestDomain" Query="$." Error="None" Title="SMTP Connector remote domain: {1}" Text="Domain {1} is a remote domain to which server {2} is possibly having trouble routing messages through a SMTP Connector." P1="$." S2="%varExName%"/>
						</Setting>
					</Object>
					<!-- Finally, enumerate the destination servers within the same routing group or in remote domains -->
					<Object Type="Cache" Name="ProbServerOrDomainList" Key1="Add" Key2="Dest" Key3="%varAllRDProbLinkServerOrDomain%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
						<Setting Key1="RemoteDestination" Substitution="SERVERNETBIOSNAME" SubstitutionFormat="^(.*?)\..*$----$1">
							<Rule Name="szDestServerFQDN" Query="if ($. = $szServerFQDN, $.)" Error="None" Title="Direct connection remote server: {1}" Text="Server {1} is a remote server to which server {2} is possibly having trouble routing messages." P1="$." S2="%varExName%" AlwaysEvaluate="True"/>
							<Rule Name="szDestDomain" Query="if (count($szServerFQDN) &lt;1 or $. != $szServerFQDN, $.)" Error="None" Title="Direct connection remote domain: {1}" Text="Domain {1} is a remote domain to which server {2} is possibly having trouble routing messages." P1="$." S2="%varExName%" AlwaysEvaluate="True"/>
						</Setting>
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectCategory=msExchExchangeServer)(cn=%SERVERNETBIOSNAME%))">
							<Setting Key1="networkAddress">
								<Rule Name="szServerFQDN" Query="lower-case (substring-after($.[contains(.,'ncacn_ip_tcp')],':'))"/>
							</Setting>
						</Object>
					</Object>
					<Object Type="If" Name="SMTP" Key1="'%varIsExchange2000or2003%'='1'">
						<Object Type="Cache" Name="ProbSourceBH" Key1="Add" Key2="Dest" Key3="%varAllRDProbLinkSourceBH%" Key4=";" Display="Hide">
							<Setting Key1="SourceBHSMTPVS" Substitution="SOURCEBHDN"/>
							<Setting Key1="SourceBHServer" Substitution="SOURCEBHSERVER" SubstitutionFormat="^CN=.*?,CN=.*?,CN=.*?,CN=(.*?[^\\]),.*$----$1"/>
							<Object Type="Group" Name="%SOURCEBHSERVER%" Class="Name" GroupingClass="True" Display="Hide">
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%SOURCEBHDN%">
									<Setting Key1="adminDisplayName">
										<Rule Name="szSourceBHInstanceName" Query="$."/>
									</Setting>
									<Setting Key1="msExchSmtpFullyQualifiedDomainName">
										<Rule Name="szSourceBHFQDN" Query="lower-case($.)" Error="None" Title="Direct connection remote server: {1}" Text="SMTP instance '{3}' on server {1} (fully-qualified domain name: {5}) is a remote SMTP instance to which server {2} is possibly having trouble routing messages. Those messages are destined to SMTP instance '{3}' on server {1} as it functions as a local bridgehead of a connector." S1="%SOURCEBHSERVER%" S2="%varExName%" P3="$szSourceBHInstanceName" P5="lower-case($.)"/>
									</Setting>
								</Object>
							</Object>
						</Object>
					</Object>

					<Rule Name="szRDInitialCheck" Query="'RDInitialCheck'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fRemoteServerNotFound,string(@Title),$szExNoErrorStateText)" Title="Target destination servers cannot be identified." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="Target destination server(s) were successfully identified."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Remote Delivery Queue(s) Initial Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="szAllRemoteServerFQDN" Query="concat(join(',',$szRGCRemoteBH),',',join(',',$szSMTPDestServerFQDN),',', join(',',$szDestServerFQDN),',',join(',',$szSourceBHFQDN))" AlwaysEvaluate="True">
						<Variable Name="varAllRemoteServerFQDN" Scope="Children"/>
					</Rule>
					<Rule Name="szAllRemoteServerSMTPInstance" Query="join(',',$szSMTPInstanceName)" AlwaysEvaluate="True">
						<Variable Name="varAllRemoteServerSMTPInstance" Scope="Children"/>
					</Rule>
					<Rule Name="szAllRemoteServerIP" Query="join(',', $szSMTPDestServerIP)" AlwaysEvaluate="True">
						<Variable Name="varAllRemoteServerIP" Scope="Children"/>
					</Rule>
					<Rule Name="szAllRemoteServerDomain" Query="concat(join(',',$szSMTPDestDomain),',',join(',',$szDestDomain))" AlwaysEvaluate="True">
						<Variable Name="varAllRemoteServerDomain" Scope="Children"/>
					</Rule>
					<Rule Name="szInitialize" Query="string()">
						<Variable Name="varAllHostRecordsFoundFQDN" Scope="Global"/>
						<Variable Name="varAllHostRecordsFoundMX" Scope="Global"/>
						<Variable Name="varAllDomainResolvedHostNoMX" Scope="Global"/>
					</Rule>

					<Rule Name="fRemoteServerNotFound" Query="not (string-length($szAllRemoteServerFQDN) &gt;3 or string-length($szAllRemoteServerIP) &gt;0 or string-length($szAllRemoteServerDomain) &gt;1)" Error="Error" Sev="1" Title="Target destination servers cannot be identified" Text="Messages appear to be backing up in one or more remote delivery queue(s) on server {2} but the tool was not able to identify the target destination servers. Aborting analysis." S2="%varExName%" GUID="8aa1fff6-9bce-45d3-9eac-67a4589a83bf"/>
					<Rule Name="fExchange2007orLater" Query="@S1='1'" S1="%varIsExchange2007orLater%" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayRDInitialCheckStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckDNSAvailability" Name="fGotoCheckDNSAvailability" Query="not($fRemoteServerNotFound)" Priority="2" Text="- Check DNS availability" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckDNSRecords" Name="fGotoCheckDNSRecords" Query="not($fRemoteServerNotFound)" Priority="2" Text="- Check whether the DNS servers return valid records for the local server" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RDCheckDNS" Name="fGotoRCheckDNS" Query="string-length($szAllRemoteServerFQDN) &gt;2 or string-length($szAllRemoteServerDomain) &gt;1" Priority="2" Text="- Check whether the server can connect to the DNS service and retrieve the necessary records of remote servers" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RDCheckConnectivity" Name="fGotoRDCheckConnectivity" Query="not($fRemoteServerNotFound)" Priority="2" Text="- Check connectivity to the destination over the SMTP port" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RDCheckSMTPInstanceConfig" Name="fGotoRDCheckSMTPInstanceConfig" Query="not($fRemoteServerNotFound)" Priority="2" Text="- Check configuration of remote SMTP instances" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RDCheckSMTPService" Name="fGotoRDCheckSMTPService" Query="not($fRemoteServerNotFound)" Priority="2" Text="- Check SMTP service of remote servers" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RDCheckEventLog" Name="fGotoRDCheckEventLog" Query="not($fRemoteServerNotFound or $fExchange2007orLater)" Priority="3" Text="- Check event logs for known remote delivery queue issues" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RDCheckE12MessageTrackingLog" Name="fGotoRDCheckE12MessageTrackingLog" Query="not($fRemoteServerNotFound) and $fExchange2007orLater" Priority="3" Text="- Check Message Tracking Logs for known remote delivery queue issues" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RDSMTPCommand" Name="fGotoRDSMTPCommand" Query="not($fRemoteServerNotFound)" Priority="3" Text="- Check whether the destination server can respond to SMTP commands" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckLinkState" Name="fGotoCheckLinkState" Query="not($fRemoteServerNotFound or $fExchange2007orLater)" Priority="5" Text="- Check link state information for possible routing issues" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckMetabase" Name="fGotoCheckMetabase" Query="not($fRemoteServerNotFound or $fExchange2007orLater)" Priority="5" Text="- Check metabase settings for known issues" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RDCheckThirdParty" Name="fGotoRDCheckThirdParty" Query="not ($fRemoteServerNotFound)" Priority="5" Text="- Check configuration of third party applications" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckDomainRouting" Name="fGotoCheckDomainRouting" Query="not ($fRemoteServerNotFound)" Priority="5" Text="- Check the domain routing information stored in recipient policies, connectors and the metabase" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckLinkStateChurn" Name="fGotoCheckLinkStateChurn" Query="not($fRemoteServerNotFound or $fExchange2007orLater)" Priority="7" Text="- Check link state version changes" Display="Hide" AlwaysEvaluate="True"/>
					<!-- Comment out those steps not yet implemented for the moment...re-enable them when ready
					<Rule NextStep="RDAntiSpam" Name="fGotoRDAntiSpam" Query="$fConnDroppedRemote or $fProtocolError" Priority="3" Text="- Check the anti-spam configurations of the destination server (this step is conducted only against internal servers)" Display="Hide" AlwaysEvaluate="True" />
					<Rule NextStep="RDNIC" Name="fGotoRDNIC" Query="$fConnDroppedRemote or $fProtocolError" Priority="3" Text="- Check the anti-spam configurations of the destination server (this step is conducted only against internal servers)" Display="Hide" AlwaysEvaluate="True" />
					-->
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDCheckSMTPService" Title="Check Remote SMTP Service" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varAllRemoteServerFQDN%" Substitution="varAllRemoteServerFQDN" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of Remote Servers SMTP Service" Text="Please wait while the tool analyzes the remote servers SMTP service that {2} is trying to connect to." S2="%varExName%">
				<Object Type="Group" Name="Remote SMTP Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="Cache" Name="RemoteServerFQDN" Key1="Add" Key2="Link" Key3="%varAllRemoteServerFQDN%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
						<Setting Key1="RemoteBHShortName" Substitution="RBHSHORTNAME" SubstitutionFormat="^(.*?)\..*$----$1"/>
						<Setting Key1="RemoteBH" Substitution="RBHNAME">
							<Rule Name="szServiceName" Query="if(count($szServiceNameRemoteVS) &gt;0, $szServiceNameRemoteVS, $szServiceNameRemoteServer)" AlwaysEvaluate="True"/>
							<Rule Name="fSMTPServiceStarted" Query="(count($fSMTPRunningRemoteVS) &gt;0 or count($fSMTPRunningRemoteServer) &gt;0) and (count($fSMTPNotRunningRemoteVS) &lt;1 and count($fSMTPNotRunningRemoteServer) &lt;1)" Error="None" Title="'{0}' service running" Text="The '{0}' service on server {2} is started." P0="$szServiceName" P2="$." AlwaysEvaluate="True"/>
							<Rule Name="fSMTPServiceNotStarted" Query="count($fSMTPNotRunningRemoteVS) &gt;0 or count($fSMTPNotRunningRemoteServer) &gt;0" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="The '{0}' service on server {2} is not running. It is important for this service to be running to route messages." P0="$szServiceName" P2="$." GUID="64ba818b-8789-41bb-ac20-f3eb9c7d1594" AlwaysEvaluate="True"/>
							<Rule Name="fSMTPServiceDisabled" Query="count($fSMTPDisabledRemoteVS) &gt;0 or count($fSMTPDisabledRemoteServer) &gt;0" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service disabled" Text="The '{0}' service on server {2} is disabled. It is important for this service to be running to route messages." P0="$szServiceName" P2="$." GUID="7e8ef54b-1be2-4955-8123-f0ddd39e0d84" AlwaysEvaluate="True"/>
							<Rule Name="fSMTPServiceManual" Query="count($fSMTPManualRemoteVS) &gt;0 or count($fSMTPManualRemoteServer) &gt;0" Error="Warning" Sev="2" Title="'{0}' service manual startup" Text="The '{0}' service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." P0="$szServiceName" P2="$." GUID="423d680b-5861-4bcb-a512-3189c7a6a33d" AlwaysEvaluate="True"/>
							<Rule Name="fSMTPServiceUnknown" Query="(count($szSMTPVSDNRemoteVS) &gt;0 or count($szSMTPVSDNRemoteServer) &gt;0) and (sum($iWMIInstanceRemoteVS) &lt;1 and sum($iWMIInstanceRemoteServer) &lt;1)" Error="Error" ReportIssue="Issue" Sev="2" Title="'{0}' service status unknown" Text="Cannot retrieve the status information of the '{0}' service on server {2}." P0="$szServiceName" P2="$." GUID="0b607deb-ebf1-44ac-b7e7-7bbb8c8a7731" AlwaysEvaluate="True"/>
							<Rule Name="fRootCauseFound" Query="$fSMTPServiceNotStarted or $fSMTPServiceDisabled or count($fSMTPVSStoppedRemoteVS) &gt;0 or count($fSMTPVSStoppedRemoteServer) &gt;0 or count($fSMTPVSPausedRemoteVS) &gt;0 or count($fSMTPVSPausedRemoteServer) &gt;0" Error="None" ReportIssue="Recommendation" Title="Start '{0}' service and virtual server on remote server" Text="Start the '{0}' service and virtual server(s) on server {2}. It is important for them to be running in order to route messages." P0="$szServiceName" P2="$." AlwaysEvaluate="True"/>
							<Rule Name="fRemoteBHMoreInv" Query="$fSMTPServiceStarted and ($fSMTPVSStartedRemoteVS or $fSMTPVSStartedRemoteServer) and not(count($fSMTPVSStoppedRemoteVS) &gt;0 or count($fSMTPVSStoppedRemoteServer) &gt;0 or count($fSMTPVSPausedRemoteVS) &gt;0 or count($fSMTPVSPausedRemoteServer) &gt;0)" Error="None" Title="Other root causes" Text="It appears that the '{0}' service and SMTP instance(s) on remote server {2} are started but messages are not flowing from server {1}. Check if there are any network errors or hung services." P0="$szServiceName" S1="%varExName%" P2="$." AlwaysEvaluate="True"/>
						</Setting>
						<!-- First, we need to start quering with SMTP VS values -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectCategory=protocolCfgSMTPServer)(msExchSmtpFullyQualifiedDomainName=%RBHNAME%))">
							<Setting Key1="adminDisplayName" Substitution="SMTPVSNAME"/>
							<Setting Key1="cn" Substitution="SMTPVSCN"/>
							<Setting Key1="distinguishedName" Substitution="SERVERNAME" SubstitutionFormat="^CN=.*?,CN=.*?,CN=.*?,CN=(.*?[^\\]),.*$----$1">
								<Rule Name="szSMTPVSDNRemoteVS" Query="$."/>
							</Setting>
							<Setting Key1="msExchSmtpRelayForAuth">
								<Rule Name="fRelayForAuthFalseRemoteVS" Query="$.='False'" Error="NonDefault" Title="Authenticated computers not allowed to relay" Text="The '{4}' property of SMTP instance '{3}' on server {2} is set to 'False'. Verify that this setting is not preventing internal Exchange servers from sending messages to external domains." S2="%RBHNAME%" S3="%SMTPVSNAME%" P4="../@Key1" GUID="90819727-0447-42ed-a486-3a8b55c0ad5f"/>
							</Setting>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectCategory=msExchExchangeServer)(cn=%SERVERNAME%))">
								<Setting Key1="cn" Substitution="SRVHOST"/>
								<Setting Key1="networkAddress" Substitution="SRVNAME" SubstitutionFormat="^(ncacn_ip_tcp:(?'tcpip'.*))?.*$----${tcpip}"/>
								<Setting Key1="serialNumber" Substitution="EXVERSION"/>
								<Object Type="If" Key1="true()">
									<Setting Key1="if (contains('%EXVERSION%', 'Version 8') or contains('%EXVERSION%', 'Version 14'), 'MSExchangeTransport', 'SMTPSVC')" Substitution="SMTPSERVICE">
										<Rule Name="szServiceNameRemoteVS" Query="$."/>
									</Setting>
									<!-- Stubbed out for now, It may be better to get the SMTP Instance cache here rather than passing it in the varaiable varAllRemoteServerSMTPInstance
									<Setting Key1="lower-case('%SRVNAME%')" Substitution="SRVFQDN" />
									<Setting Key1="lower-case('%SRVHOST%')" Substitution="SRVHOST" />
									<Setting Key1="lower-case('%REMOTEFQDN%')" Substitution="SMTPVSFQDN" />
									<Setting Key1="if (contains('%EXVERSION%', 'Version 6.5'), '1', '0')" Substitution="SRVVERSION" />
									<Object Type="Cache" Name="SMTPInstanceCache" Key1="Add" Key2="SMTPInstanceList" Key3="%SRVVERSION%,%SRVHOST%,%SRVFQDN%,%SMTPVSFQDN%,%SMTPVSNAME%" Display="Hide" />
									-->
									<!-- Check whether the SMTP service is up and running -->
									<Object Type="WMI" Key1="%SRVHOST%" Key3="Win32_Service" Key4="Name='%SMTPSERVICE%'">
										<Rule Name="fFatalWMIErrorRemoteVS" Query="../Exception/@Message" Error="Error" Sev="2" Title="Error accessing WMI" Text="Cannot connect to the Windows Management Instrumentation (WMI) repository on server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="../Exception/@Message" S2="%SRVNAME%" GUID="18814786-c925-4ea8-bcd5-2d57174f326f"/>
										<Rule Name="iWMIInstanceRemoteVS" Query="count($.)"/>
										<Setting Key1="Started" Substitution="STARTED">
											<Rule Name="fSMTPStartedRemoteVS" Query="$.='True'"/>
											<Rule Name="fSMTPNotStartedRemoteVS" Query="$.='False'"/>
										</Setting>
										<Setting Key1="StartMode">
											<Rule Name="fSMTPDisabledRemoteVS" Query="$.='Disabled'"/>
											<Rule Name="fSMTPManualRemoteVS" Query="$.='Manual'"/>
										</Setting>
										<Setting Key1="State">
											<Rule Name="fSMTPRunningRemoteVS" Query="$fSMTPStartedRemoteVS and $.='Running'" AlwaysEvaluate="True"/>
											<Rule Name="fSMTPNotRunningRemoteVS" Query="not($fSMTPRunningRemoteVS)" AlwaysEvaluate="True"/>
										</Setting>


										<!--If MSExchangeTransport service not running, check event log-->
										<Object Type="If" Key1="(contains('%EXVERSION%', 'Version 8') or contains('%EXVERSION%', 'Version 14')) and '%STARTED%' = 'False'">
											<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(48 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>

											<!--Check for 'MSExchange TransportService' event 1000 (logged when transport service attempts to start)-->
											<Object Type="WMI" Key1="%SRVHOST%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchange TransportService' AND EventCode='1000' AND TimeWritten &gt; '%STARTTIME%'" Range="1" Sort="TimeWritten DESC">
												<Rule Name="szTransportSvcStartupEventException" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%SRVHOST%"/>
												<Rule Name="fTransportSvcStartupEventFound" Query="count(../Instance) &gt; 0"/>
												<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
												<Setting Key1="Message">
													<Rule Name="szTransportSvcStartupEventMsg" Query="$." Error="None" Title="Remote server attempted to start the '{3}' service" Text="The '{3}' service on remote server {0} last attempted to start was at {5} and the following event description was logged: {4}" S0="'%SRVHOST%'" S3="MSExchangeTransport" P4="$." S5="%TIMEWRITTEN%"/>
												</Setting>
											</Object>

											<!--Check for significant 'MSExchange TransportService' and 'MSExchangeTransport' error events -->
											<Object Type="WMI" Key1="%SRVHOST%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND EventType='1' AND (SourceName='MSExchange TransportService' OR (SourceName='MSExchangeTransport' AND (EventCode=5022 OR EventCode=5024 OR EventCode=7002 OR EventCode=7003 OR EventCode=9207 OR EventCode=12008 OR EventCode=12009 OR EventCode=14001 OR EventCode=16001 OR EventCode=16023 OR EventCode=17003 OR EventCode=17004 OR EventCode=17005 OR EventCode=17006 OR EventCode=17007 OR EventCode=17011))) AND TimeWritten &gt; '%STARTTIME%'" Range="10" Sort="TimeWritten DESC">
												<Rule Name="szTransportSvcFailureEventException" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%SRVHOST%"/>
												<Rule Name="fTransportSvcFailureEventFound" Query="count(../Instance) &gt; 0" AlwaysEvaluate="True"/>
												<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
												<Setting Key1="EventCode" Substitution="EVENTCODE"/>
												<Setting Key1="Category"/>
												<Setting Key1="CategoryString" Substitution="CATEGORYSTRING"/>
												<Setting Key1="SourceName" Substitution="SOURCENAME"/>
												<Setting Key1="Message">
													<Rule Name="szTransportSvcFailureEventMsg" Query="$." Error="Error" Sev="1" ReportIssue="RootCause" Title="'{3}' service has encountered a '{6}' error" Text="The '{3}' service on remote server {0} has encountered a '{6}' error ('{3}' Event ID {7}) at {5}. This error may be preventing the service from starting. The following event description was logged: {4}" S0="'%SRVHOST%'" S2="%SOURCENAME%" S3="MSExchangeTransport" P4="$." S5="%TIMEWRITTEN%" S6="%CATEGORYSTRING%" S7="%EVENTCODE%"/>
												</Setting>
											</Object>

										</Object>
									</Object>

									<!-- Next, check whether the SMTP virtual server is up and running -->
									<Object Type="If" Key1="not(contains('%EXVERSION%', 'Version 8') or contains('%EXVERSION%', 'Version 14'))">
										<Object Type="Metabase" Key1="%SERVERNAME%" Key2="LM/SmtpSvc/%SMTPVSCN%" Timeout="%300">
											<Setting Key1="1016" Key2="ServerState" Substitution="SMTPVSSTATUS">
												<Rule Name="fSMTPVSStartedRemoteVS" Query="$.=2" Error="None" Title="SMTP instance started" Text="SMTP instance '{3}' on server {2} is started." S2="%SRVNAME%" S3="%SMTPVSNAME%"/>
												<Rule Name="fSMTPVSStoppedRemoteVS" Query="$.=4" Error="Error" Sev="1" ReportIssue="RootCause" Title="SMTP instance stopped" Text="SMTP instance '{3}' on server {2} is stopped. This virtual server cannot route any messages." S2="%SRVNAME%" S3="%SMTPVSNAME%" GUID="369d863f-7702-4ffc-80fd-a9f86eb26ce0"/>
												<Rule Name="fSMTPVSPausedRemoteVS" Query="$.=6" Error="Error" Sev="2" ReportIssue="RootCause" Title="SMTP instance paused" Text="SMTP instance '{3}' on server {2} is paused." S2="%SRVNAME%" S3="%SMTPVSNAME%" GUID="ca7cb622-13da-40f7-b8d8-ce020a0380c7"/>
											</Setting>
											<!-- Check for event 429 -->
											<Object Type="If" Key1="not('%SMTPVSSTATUS%'='2')">
												<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
												<Object Type="WMI" Key1="%SERVERNAME%" Key3="Win32_NTLogEvent" Key4="Logfile='System' AND EventCode=429 AND SourceName='smtpsvc' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
													<Setting Key1="EventCode"/>
													<Setting Key1="EventType"/>
													<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
													<Setting Key1="Data"/>
													<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
														<Rule Name="fEvt429WithinLast24hoursRemoteVS" Query="true()" Error="Warning" Sev="2" Title="An '{0}' error event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the system log of server {2} within the last 24 hours. Verify that the '{3}', '{4}' and '{5}' folders exist for this SMTP instance under the designated path and they are not corrupt. Last occurrence at {8}. Event description: {1}" S0="SMTPSVC" S1="%EVTMESSAGE%" S2="%SERVERNAME%" S3="BadMail" S4="PickUp" S5="Queue" S8="%EVTTIME%" S9="429" GUID="a1144c62-475b-4a46-af3e-39ec35c3ed64"/>
													</Setting>
												</Object>
											</Object>
										</Object>
									</Object>
								</Object>
							</Object>
						</Object>

						<!-- Opposite direction as the FQDN we have may have come from server, not SMTP VS -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectCategory=msExchExchangeServer)(cn=%RBHSHORTNAME%))">
							<Setting Key1="cn" Substitution="SRVHOST"/>
							<Setting Key1="distinguishedName" Substitution="DN"/>
							<Setting Key1="networkAddress" Substitution="SRVNAME" SubstitutionFormat="^(ncacn_ip_tcp:(?'tcpip'.*))?.*$----${tcpip}"/>
							<Setting Key1="serialNumber" Substitution="EXVERSION"/>
							<Object Type="If" Name="SameOrgServer" Key1="lower-case('%RBHNAME%') = lower-case('%SRVNAME%')">
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=SMTP,CN=Protocols,%DN%" Key3="objectCategory=protocolCfgSMTPServer">
									<Setting Key1="adminDisplayName" Substitution="SMTPVSNAME"/>
									<Setting Key1="cn" Substitution="SMTPVSCN"/>
									<Setting Key1="distinguishedName">
										<Rule Name="szSMTPVSDNRemoteServer" Query="$."/>
									</Setting>
									<Setting Key1="msExchSmtpFullyQualifiedDomainName" Substitution="SMTPVSFQDN"/>
									<Setting Key1="msExchSmtpRelayForAuth">
										<Rule Name="fRelayForAuthFalseRemoteServer" Query="$.='False' and lower-case('%RBHNAME%')!=lower-case('%SMTPVSFQDN%')" Error="NonDefault" Title="Authenticated computers not allowed to relay" Text="The '{4}' property of SMTP instance '{3}' on server {2} is set to 'False'. Verify that this setting is not preventing internal Exchange servers from sending messages to external domains." S2="%RBHNAME%" S3="%SMTPVSNAME%" P4="../@Key1" GUID="90819727-0447-42ed-a486-3a8b55c0ad5f"/>
									</Setting>
									<!-- Check whether the SMTP service is up and running -->
									<Object Type="If" Key1="not(lower-case('%RBHNAME%')=lower-case('%SMTPVSFQDN%'))">
										<Setting Key1="if (contains('%EXVERSION%', 'Version 8') or contains('%EXVERSION%', 'Version 14'), 'MSExchangeTransport', 'SMTPSVC')" Substitution="SMTPSERVICE">
											<Rule Name="szServiceNameRemoteServer" Query="$."/>
										</Setting>
										<Object Type="WMI" Key1="%SRVHOST%" Key3="Win32_Service" Key4="Name='%SMTPSERVICE%'">
											<Rule Name="fFatalWMIErrorRemoteServer" Query="../Exception/@Message" Error="Error" Sev="2" Title="Error accessing WMI" Text="Cannot connect to the Windows Management Instrumentation (WMI) repository on server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="../Exception/@Message" S2="%SRVNAME%" GUID="18814786-c925-4ea8-bcd5-2d57174f326f"/>
											<Rule Name="iWMIInstanceRemoteServer" Query="count($.)"/>
											<Setting Key1="Started">
												<Rule Name="fSMTPStartedRemoteServer" Query="$.='True'"/>
												<Rule Name="fSMTPNotStartedRemoteServer" Query="$.='False'"/>
											</Setting>
											<Setting Key1="StartMode">
												<Rule Name="fSMTPDisabledRemoteServer" Query="$.='Disabled'"/>
												<Rule Name="fSMTPManualRemoteServer" Query="$.='Manual'"/>
											</Setting>
											<Setting Key1="State">
												<Rule Name="fSMTPRunningRemoteServer" Query="$fSMTPStartedRemoteServer and $.='Running'" AlwaysEvaluate="True"/>
												<Rule Name="fSMTPNotRunningRemoteServer" Query="not($fSMTPRunningRemoteServer)" AlwaysEvaluate="True"/>
											</Setting>

										</Object>
									</Object>
									<!-- Next, check whether the SMTP virtual server is up and running -->
									<Object Type="If" Key1="not(contains('%EXVERSION%', 'Version 8') or contains('%EXVERSION%', 'Version 14')) and not(lower-case('%RBHNAME%')=lower-case('%SMTPVSFQDN%'))">
										<Object Type="Metabase" Key1="%SRVHOST%" Key2="LM/SmtpSvc/%SMTPVSCN%" Timeout="%300">
											<Setting Key1="1016" Key2="ServerState" Substitution="SMTPVSSTATUS">
												<Rule Name="fSMTPVSStartedRemoteServer" Query="$.=2" Error="None" Title="SMTP instance started" Text="SMTP instance '{3}' on server {2} is started." S2="%SRVNAME%" S3="%SMTPVSNAME%"/>
												<Rule Name="fSMTPVSStoppedRemoteServer" Query="$.=4" Error="Error" Sev="1" ReportIssue="RootCause" Title="SMTP instance stopped" Text="SMTP instance '{3}' on server {2} is stopped. This virtual server cannot route any messages." S2="%SRVNAME%" S3="%SMTPVSNAME%" GUID="369d863f-7702-4ffc-80fd-a9f86eb26ce0"/>
												<Rule Name="fSMTPVSPausedRemoteServer" Query="$.=6" Error="Error" Sev="2" ReportIssue="RootCause" Title="SMTP instance paused" Text="SMTP instance '{3}' on server {2} is paused." S2="%SRVNAME%" S3="%SMTPVSNAME%" GUID="ca7cb622-13da-40f7-b8d8-ce020a0380c7"/>
											</Setting>
											<!-- Check for event 429 -->
											<Object Type="If" Key1="not('%SMTPVSSTATUS%'='2')">
												<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
												<Object Type="WMI" Key1="%SRVHOST%" Key3="Win32_NTLogEvent" Key4="Logfile='System' AND EventCode=429 AND SourceName='smtpsvc' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
													<Setting Key1="EventCode"/>
													<Setting Key1="EventType"/>
													<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
													<Setting Key1="Data"/>
													<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
														<Rule Name="fEvt429WithinLast24hoursRemoteServer" Query="true()" Error="Warning" Sev="2" Title="An '{0}' error event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the system log of server {2} within the last 24 hours. Verify that the '{3}', '{4}' and '{5}' folders exist for this SMTP instance under the designated path and they are not corrupt. Last occurrence at {8}. Event description: {1}" S0="SMTPSVC" S1="%EVTMESSAGE%" S2="%SRVHOST%" S3="BadMail" S4="PickUp" S5="Queue" S8="%EVTTIME%" S9="429" GUID="a1144c62-475b-4a46-af3e-39ec35c3ed64"/>
													</Setting>
												</Object>
											</Object>
										</Object>
									</Object>
								</Object>
							</Object>
						</Object>

						<Rule Name="szRDCheckSMTPService" Query="'RDCheckSMTPService'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fPotentialCauseFound, string(@Title), $szExNoErrorStateText)" Title="A potential issue with mail acceptance on the server was identified." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="More investigation necessary."/>
						<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Remote SMTP Service Diagnosis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fPotentialCauseFound" Query="$fSMTPServiceNotStarted or $fSMTPServiceDisabled or $fSMTPServiceManual or $fSMTPServiceUnknown or $fSMTPVSStoppedRemoteVS or $fSMTPVSStoppedRemoteServer or $fSMTPVSPausedRemoteVS or $fSMTPVSPausedRemoteServer or $fEvt429WithinLast24hoursRemoteVS or $fEvt429WithinLast24hoursRemoteServer" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fRDCheckSMTPServiceStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDCheckDNS" Title="Check DNS Records of Remote Servers" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varAllRemoteServerFQDN%" Substitution="varAllRemoteServerFQDN" Display="Hide"/>
			<Setting Key1="%varAllRemoteServerDomain%" Substitution="varAllRemoteServerDomain" Display="Hide"/>
			<Setting Key1="%varAllDNSAddress%" Substitution="varAllDNSAddress" Display="Hide"/>
			<Setting Key1="%varLocalIPv6Capable%" Substitution="varLocalIPv6Capable" Display="Hide"/>
			<Setting Key1="%varExchangeIPv6Capable%" Substitution="varExchangeIPv6Capable" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking DNS Records" Text="Please wait while the tool checks whether the DNS servers used by server {2} can return valid records for the destination servers." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Remote SMTP Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<!-- Let's check whether each DNS contains the records of each destination server -->
					<Object Type="If" Name="DNSAvailableServer" Key1="'%varAllDNSAddress%'!=';'">
						<Object Type="Cache" Name="RemoteServerList" Key1="Add" Key2="RemoteServer" Key3="%varAllRemoteServerFQDN%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
							<Rule Name="fNoRemoteServerFQDN" Query="count(../Instance)=0"/>
							<Setting Key1="RemoteServer" Substitution="REMOTESRVNAME"/>
							<Object Type="DNS" Name="ServerARecord" Key1="%varAllDNSAddress%" Key2="%REMOTESRVNAME%" Async="100">
								<Setting Key1="A">
									<Rule Name="szServerResolvedHost" Query="if (string-length($.[contains(.,'DNS Query Result')]) &gt; 19, substring-after($.[4],'DNS Query Result = '))"/>
								</Setting>
								<Rule Name="fServerNoHostRecords" Query="count ($szServerResolvedHost) &lt;1" Error="Error" Sev="2" ReportIssue="RootCause" Title="No 'Host' record(s) found for server {1}" Text="Server {1} is a remote server to which server {2} is trying to send messages but no 'Host' records of server {1} can be obtained from any DNS servers server {2} uses. This may be causing message backups in the queue." S1="%REMOTESRVNAME%" S2="%varExName%" GUID="4fcf5a4f-0180-4af5-a60e-e1d9da1d50bf"/>
								<Rule Name="fServerHostRecordsFound" Query="count ($szServerResolvedHost) &gt;0" Error="None" Title="'Host' record(s) found for server {1}" Text="Server {1} is a remote server to which server {2} is trying to send messages. The resolved IP address of server {1}: {4}" S1="%REMOTESRVNAME%" S2="%varExName%" P4="join(',', $szServerResolvedHost)"/>
								<Rule Name="szHostRecordsFoundFQDN" Query="if ($fServerHostRecordsFound, @S2)" S2="%REMOTESRVNAME%"/>
							</Object>
							<Object Type="If" Name="DnsAvailableServerIPv6" Key1="'%varLocalIPv6Capable%'='1' and '%varExchangeIPv6Capable%'='1'">
								<Object Type="DNS" Name="ServerAAAARecord" Key1="%varAllDNSAddress%" Key2="%REMOTESRVNAME%" Async="100">
									<Setting Key1="AAAA">
										<Rule Name="szServerResolvedHostAAAA" Query="if (string-length($.[contains(.,'DNS Query Result')]) &gt; 19, substring-after($.[4],'DNS Query Result = '))"/>
									</Setting>
									<Rule Name="fServerNoHostRecordsAAAA" Query="count ($szServerResolvedHostAAAA) &lt;1" Error="Error" Sev="2" ReportIssue="RootCause" Title="No 'Host' record(s) found for server {1}" Text="Server {1} is a remote server to which server {2} is trying to send messages but no 'Host' records of server {1} can be obtained from any DNS servers server {2} uses. This may be causing message backups in the queue." S1="%REMOTESRVNAME%" S2="%varExName%"/>
									<Rule Name="fServerHostRecordsFoundAAAA" Query="count ($szServerResolvedHostAAAA) &gt;0" Error="None" Title="'Host' record(s) found for server {1}" Text="Server {1} is a remote server to which server {2} is trying to send messages. The resolved IP address of server {1}: {4}" S1="%REMOTESRVNAME%" S2="%varExName%" P4="join(',', $szServerResolvedHost)"/>
									<Rule Name="szHostRecordsFoundFQDNAAAA" Query="if ($fServerHostRecordsFoundAAAA, @S2)" S2="%REMOTESRVNAME%"/>
								</Object>
							</Object>
						</Object>
					</Object>
					<!-- Let's do the same for each destination domain now -->
					<Object Type="If" Name="DNSAvailableDomain" Key1="'%varAllDNSAddress%'!=';'">
						<Object Type="Cache" Name="RemoteDomainList" Key1="Add" Key2="RemoteDomain" Key3="%varAllRemoteServerDomain%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
							<Rule Name="fNoRemoteServerDomain" Query="count(../Instance)=0"/>
							<Setting Key1="RemoteDomain" Substitution="REMOTEDOMAINNAME"/>
							<!-- First, check for MX records of domains by adding fakeServer in front of the domain name -->
							<Object Type="DNS" Name="DomainMXRecord" Key1="%varAllDNSAddress%" Key2="fakeServer.%REMOTEDOMAINNAME%" Async="100">
								<Setting Key1="MX" Substitution="ALLRETURNEDRECORDS" SubstitutionFormat="^.* = (.*?)$----$1,">
									<Rule Name="szDomainResolvedMX" Query="if (string-length($.[contains(.,'DNS Query Result')]) &gt; 19, substring-after($.[4],'DNS Query Result = '))"/>
								</Setting>
								<!-- For MX records, we need to resolve the FQDN to IP addresses -->
								<Object Type="Cache" Name="ALLRECORDS" Key1="Add" Key2="ALLRECORDS" Key3="%ALLRETURNEDRECORDS%" Display="Hide">
									<Setting Key1="DNSAddr" Substitution="USEDDNS" SubstitutionFormat="^.*?,(.*?),.*$----$1"/>
									<Setting Key1="DomainMXList" Substitution="DOMAINMXLIST" SubstitutionFormat="^.*?,.*?,.*?,(.*?),$----$1"/>
									<Object Type="Cache" Name="DomainMXList" Key1="Add" Key2="RemoteDomainMX" Key3="%DOMAINMXLIST%" Key4=";" Display="Hide">
										<Setting Key1="DomainMX" Substitution="DOMAINMX"/>
										<Object Type="DNS" Name="DomainMXRecordToHost" Key1="%USEDDNS%" Key2="%DOMAINMX%">
											<Setting Key1="A">
												<Rule Name="szDomainMXResolvedHost" Query="if (string-length($.[contains(.,'DNS Query Result')]) &gt; 19, substring-after($.[4],'DNS Query Result = '))"/>
											</Setting>
											<Rule Name="fDomainMXResolvedHostNotFound" Query="count ($szDomainMXResolvedHost) &lt;1 and string-length(@S4) &gt;0" Error="Error" Sev="2" ReportIssue="RootCause" Title="No 'Host' record(s) found for the 'MX' record(s) of domain {1}" Text="The 'MX' record(s) of domain {1} are {4}, but the 'Host' records of the servers indicated by the 'MX' records cannot be obtained from any DNS server {2} uses." S1="%REMOTEDOMAINNAME%" S2="%varExName%" S4="%DOMAINMX%" GUID="5b80a914-573f-4e4d-9b44-e4d33f210513"/>
											<Rule Name="fDomainMXResolvedHostFound" Query="count ($szDomainMXResolvedHost) &gt;0" Error="None" Title="'Host' record(s) found for the 'MX' record(s) of domain {1}" Text="Server {4} is specified as an 'MX' record of domain {1}. The resolved IP address of {4}: {3}" S1="%REMOTEDOMAINNAME%" P3="$szDomainMXResolvedHost" S4="%DOMAINMX%"/>
										</Object>
									</Object>
								</Object>
								<Rule Name="fDomainNoMXRecords" Query="count ($szDomainResolvedMX) &lt;1" Error="Warning" Sev="2" Title="No 'MX' record(s) found for domain {1}" Text="Domain {1} is a remote domain to which server {2} is trying to send messages but no 'MX' records of domain {1} can be obtained from any DNS servers server {2} uses." S1="%REMOTEDOMAINNAME%" S2="%varExName%" GUID="34175915-8cec-4629-8569-30c66f319368"/>
								<Rule Name="fDomainMXRecordsFound" Query="count ($szDomainResolvedMX) &gt;0" Error="None" Title="'MX' record(s) found for domain {1}" Text="Domain {1} is a remote domain to which server {2} is trying to send messages. The 'MX' record(s) of domain {1}: {4}" S1="%REMOTEDOMAINNAME%" S2="%varExName%" P4="join(',', $szDomainResolvedMX)"/>
								<Rule Name="szHostRecordsFoundMX" Query="if ($fDomainMXResolvedHostFound, replace(join(';', $szDomainResolvedMX),';',','))"/>
							</Object>
							<!-- Second, check to see whether A records can be ontained for the domains -->
							<Object Type="DNS" Name="DomainARecord" Key1="%varAllDNSAddress%" Key2="%REMOTEDOMAINNAME%" Async="100">
								<Setting Key1="A">
									<Rule Name="szDomainResolvedHost" Query="if (string-length($.[contains(.,'DNS Query Result')]) &gt; 19, substring-after($.[4],'DNS Query Result = '))"/>
								</Setting>
								<Rule Name="fDomainNoHostRecords" Query="count ($szDomainResolvedHost) &lt;1" Error="None" Title="No 'Host' record(s) found for domain {1}" Text="Domain {1} is a remote domain to which server {2} is trying to send messages. The 'Host' record(s) of the domain {1} cannot be obtained from any DNS servers server {2} uses." S1="%REMOTEDOMAINNAME%" S2="%varExName%"/>
								<Rule Name="fDomainHostRecordsFound" Query="count ($szDomainResolvedHost) &gt;0" Error="None" Title="'Host' record(s) found for domain {1}" Text="Domain {1} is a remote domain to which server {2} is trying to send messages. The 'Host' record(s) of domain {1}: {4}" S1="%REMOTEDOMAINNAME%" S2="%varExName%" P4="join(',', $szDomainResolvedHost)"/>
								<Rule Name="fDomainHostRecordsFoundButNoMX" Query="$fDomainNoMXRecords and $fDomainHostRecordsFound" Error="Warning" Sev="2" Title="'Host' record(s) found but not 'MX' record(s) for domain {1}" Text="Domain {1} is a remote domain to which server {2} is trying to send messages. Though no 'MX' records of the domain {1} were found, the 'Host' record(s) were found ({4}). Please ensure that these 'Host' record(s) are pointing to valid mail server(s) as server {2} may be trying to send messages to server(s) of these 'Host' records." S1="%REMOTEDOMAINNAME%" S2="%varExName%" P4="join(',', $szDomainResolvedHost)" GUID="c94668ad-99ff-4655-88ba-e7165185c62f"/>
								<Rule Name="fDomainNoHostAndNoMX" Query="$fDomainNoMXRecords and $fDomainNoHostRecords" Error="Error" Sev="2" ReportIssue="RootCause" Title="Cannot find 'Host' or 'MX' record(s) for domain {1}" Text="Domain {1} is a remote domain to which server {2} is trying to send messages but neither the 'MX' records nor 'Host' records of domain {1} can be obtained from any DNS server {2} uses. This may be causing message backups in the queue or non-delivery reports if the DNS response is 'non-existent domain'." S1="%REMOTEDOMAINNAME%" S2="%varExName%" GUID="c0b991e8-e404-44d8-a121-a56d389f63f7"/>
								<Rule Name="szDomainResolvedHostNoMX" Query="if ($fDomainHostRecordsFoundButNoMX, join(',', $szDomainResolvedHost))"/>
							</Object>
						</Object>
					</Object>
					<Object Type="Group">
						<Setting Key1="Test execution">
							<Rule Name="fNoServerToTest" Query="$fNoRemoteServerFQDN and $fNoRemoteServerDomain" Error="Error" Sev="2" Title="No remote servers or domains were available for DNS record tests" Text="The tool cannot identify the remote servers or domains. DNS record analysis cannot be performed." GUID="ebc7e260-b45a-4bc0-ac72-86abc767eeb2"/>
							<Rule Name="fNoDNSToTestWith" Query="@S1=';'" Error="Error" Sev="2" Title="No DNS servers are available for tests" Text="No DNS servers were identified for server {2}. DNS record analysis cannot be performed." S1="%varAllDNSAddress%" S2="%varExName%" GUID="43e47d6b-df21-44c5-95aa-017840acd52d"/>
						</Setting>
					</Object>

					<Rule Name="szRDCheckDNS" Query="'RDCheckDNS'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fRDDNSIssueFound or $fNoDNSToTestWith, string(@Title), $szExNoErrorStateText)" Title="Potential DNS issues were identified." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No DNS issues were identified."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Remote Delivery Queue(s) DNS Records Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>
					<Rule Name="szAllHostRecordsFoundFQDN" Query="join(',', $szHostRecordsFoundFQDN)" AlwaysEvaluate="True">
						<Variable Name="varAllHostRecordsFoundFQDN" Scope="Global"/>
					</Rule>
					<Rule Name="szAllHostRecordsFoundMX" Query="join(',', $szHostRecordsFoundMX)" AlwaysEvaluate="True">
						<Variable Name="varAllHostRecordsFoundMX" Scope="Global"/>
					</Rule>
					<Rule Name="szAllDomainResolvedHostNoMX" Query="join(',', $szDomainResolvedHostNoMX)" AlwaysEvaluate="True">
						<Variable Name="varAllDomainResolvedHostNoMX" Scope="Global"/>
					</Rule>

					<Rule Name="fRDDNSIssueFound" Query="count($fServerNoHostRecords) &gt;0 or count ($fDomainNoMXRecords) &gt;0 or count ($fDomainMXResolvedHostNotFound) &gt;0 or count ($fDomainHostRecordsFoundButNoMX) &gt;0 or count ($fDomainNoHostAndNoMX) &gt;0" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayRDCheckDNSStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDCheckConnectivity" Title="Check Connectivity to Remote SMTP" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varAllHostRecordsFoundFQDN%" Substitution="varAllHostRecordsFoundFQDN" Display="Hide"/>
			<Setting Key1="%varAllHostRecordsFoundMX%" Substitution="varAllHostRecordsFoundMX" Display="Hide"/>
			<Setting Key1="%varAllDomainResolvedHostNoMX%" Substitution="varAllDomainResolvedHostNoMX" Display="Hide"/>
			<Setting Key1="%varAllRemoteServerIP%" Substitution="varAllRemoteServerIP" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Connectivity to Remote Servers" Text="Please wait while the tool checks the connectivity to the servers that {2} is trying to send messages to." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Remote SMTP Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="Cache" Name="RemoteServerList" Key1="Add" Key2="RemoteServer" Key3="%varAllHostRecordsFoundFQDN%,%varAllHostRecordsFoundMX%,%varAllDomainResolvedHostNoMX%,%varAllRemoteServerIP%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
						<Rule Name="fNoServerToTest" Query="count(../Instance)=0" Error="Error" Sev="3" Title="No servers were available for connectivity tests" Text="The tool was not able to identify the fully-qualified domain name or IP address of all the remote servers. Connectivity tests cannot be performed." GUID="935e3bd2-54a2-4305-95c8-120077476e8e"/>
						<!-- Let's ping the remote IP by changing the buffersize and nofragmentation flag -->
						<Setting Key1="RemoteServerShortName" Substitution="SERVERSHORTNAME" SubstitutionFormat="^(.*?)\..*[a-zA-Z].*$----$1"/>
						<Setting Key1="RemoteServerLongName" Substitution="SERVERLONGNAME"/>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_PingStatus" Key4="Address='%SERVERSHORTNAME%' and BufferSize=548 and NoFragmentation='True'">
							<Setting Key1="ResponseTime"/>
							<Setting Key1="PrimaryAddressResolutionStatus">
								<Rule Name="fPingNoFrag548AddressResolutionError" Template="tRemotePingOtherError" Query="$. != 0" S3="True" S9="548"/>
							</Setting>
							<Setting Key1="TimeToLive"/>
							<Setting Key1="ResponseTimeToLive"/>
							<Setting Key1="NoFragmentation"/>
							<Setting Key1="BufferSize"/>
							<Setting Key1="ReplySize"/>
							<Setting Key1="RouteRecord"/>
							<Setting Key1="RouteRecordResolved"/>
							<Setting Key1="StatusCode">
								<Rule Name="fPingNoFrag548Success" Template="tRemotePingSuccess" S3="True" S9="548"/>
								<Rule Name="fPingNoFrag548RequestTimedOut" Template="tRemotePingRequestTimedOut" S3="True" S9="548"/>
								<Rule Name="fPingNoFrag548PacketTooBig" Template="tRemotePingPacketTooBig" S3="True" S9="548"/>
								<Rule Name="fPingNoFrag548OtherError" Template="tRemotePingOtherError" Query="not ($fPingNoFrag548AddressResolutionError or $fPingNoFrag548Success or $fPingNoFrag548RequestTimedOut or $fPingNoFrag548PacketTooBig)" S3="True" S9="548" AlwaysEvaluate="True"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_PingStatus" Key4="Address='%SERVERSHORTNAME%' and BufferSize=1472 and NoFragmentation='True'">
							<Setting Key1="ResponseTime"/>
							<Setting Key1="PrimaryAddressResolutionStatus">
								<Rule Name="fPingNoFrag1472AddressResolutionError" Template="tRemotePingOtherError" Query="$. != 0" S3="True" S9="1472"/>
							</Setting>
							<Setting Key1="TimeToLive"/>
							<Setting Key1="ResponseTimeToLive"/>
							<Setting Key1="NoFragmentation"/>
							<Setting Key1="BufferSize"/>
							<Setting Key1="ReplySize"/>
							<Setting Key1="RouteRecord"/>
							<Setting Key1="RouteRecordResolved"/>
							<Setting Key1="StatusCode">
								<Rule Name="fPingNoFrag1472Success" Template="tRemotePingSuccess" S3="True" S9="1472"/>
								<Rule Name="fPingNoFrag1472RequestTimedOut" Template="tRemotePingRequestTimedOut" S3="True" S9="1472"/>
								<Rule Name="fPingNoFrag1472PacketTooBig" Template="tRemotePingPacketTooBig" Error="Warning" Sev="1" S3="True" S9="1472"/>
								<Rule Name="fPingNoFrag1472OtherError" Template="tRemotePingOtherError" Query="not ($fPingNoFrag1472AddressResolutionError or $fPingNoFrag1472Success or $fPingNoFrag1472RequestTimedOut or $fPingNoFrag1472PacketTooBig)" S3="True" S9="1472" AlwaysEvaluate="True"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_PingStatus" Key4="Address='%SERVERSHORTNAME%' and BufferSize=1472">
							<Setting Key1="ResponseTime"/>
							<Setting Key1="PrimaryAddressResolutionStatus">
								<Rule Name="fPingFrag1472AddressResolutionError" Template="tRemotePingOtherError" Query="$. != 0" S3="False" S9="1472"/>
							</Setting>
							<Setting Key1="TimeToLive"/>
							<Setting Key1="ResponseTimeToLive"/>
							<Setting Key1="NoFragmentation"/>
							<Setting Key1="BufferSize"/>
							<Setting Key1="ReplySize">
								<Rule Name="fPingFrag1472ReplySizeNotSame" Query="$.!=1472" Error="Warning" Sev="2" Title="Ping reply size is different" Text="The size of the returned buffer is not the same as the size of the sent buffer ({1}). Size of the returned buffer: {9}." S1="1472" P9="$." GUID="36aec765-9e61-458b-b522-6123e3ef7780"/>
							</Setting>
							<Setting Key1="RouteRecord"/>
							<Setting Key1="RouteRecordResolved"/>
							<Setting Key1="StatusCode">
								<Rule Name="fPingFrag1472Success" Template="tRemotePingSuccess" S3="False" S9="1472"/>
								<Rule Name="fPingFrag1472RequestTimedOut" Template="tRemotePingRequestTimedOut" S3="False" S9="1472"/>
								<Rule Name="fPingFrag1472OtherError" Template="tRemotePingOtherError" Query="not ($fPingFrag1472AddressResolutionError or $fPingFrag1472Success or $fPingFrag1472RequestTimedOut)" S3="False" S9="1472" AlwaysEvaluate="True"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_PingStatus" Key4="Address='%SERVERSHORTNAME%' and BufferSize=4096 and NoFragmentation='True'">
							<Setting Key1="ResponseTime"/>
							<Setting Key1="PrimaryAddressResolutionStatus">
								<Rule Name="fPingNoFrag4096AddressResolutionError" Template="tRemotePingOtherError" Query="$. != 0" S3="True" S9="4096"/>
							</Setting>
							<Setting Key1="TimeToLive"/>
							<Setting Key1="ResponseTimeToLive"/>
							<Setting Key1="NoFragmentation"/>
							<Setting Key1="BufferSize"/>
							<Setting Key1="ReplySize"/>
							<Setting Key1="RouteRecord"/>
							<Setting Key1="RouteRecordResolved"/>
							<Setting Key1="StatusCode">
								<Rule Name="fPingNoFrag4096Success" Template="tRemotePingSuccess" S3="True" S9="4096"/>
								<Rule Name="fPingNoFrag4096RequestTimedOut" Template="tRemotePingRequestTimedOut" S3="True" S9="4096"/>
								<Rule Name="fPingNoFrag4096PacketTooBig" Query="$.=11009" Error="Warning" Sev="3" Title="Packet needs to be fragmented" Text="Ping (Don't fragment = '{3}' and buffer size = {9}) from server {2} to remote server {1} was not successful as the packet needs to be fragmented." S1="%SERVERLONGNAME%" S2="%varExName%" S3="True" S9="4096" GUID="6c28d83b-45a7-4f66-bc9e-5a2427e8ae83"/>
								<Rule Name="fPingNoFrag4096OtherError" Template="tRemotePingOtherError" Query="not ($fPingNoFrag4096AddressResolutionError or $fPingNoFrag4096Success or $fPingNoFrag4096RequestTimedOut or $fPingNoFrag4096PacketTooBig)" S3="True" S9="4096" AlwaysEvaluate="True"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_PingStatus" Key4="Address='%SERVERSHORTNAME%' and BufferSize=4096">
							<Setting Key1="ResponseTime"/>
							<Setting Key1="PrimaryAddressResolutionStatus">
								<Rule Name="fPingFrag4096AddressResolutionError" Template="tRemotePingOtherError" Query="$. != 0" S3="False" S9="4096"/>
							</Setting>
							<Setting Key1="TimeToLive"/>
							<Setting Key1="ResponseTimeToLive"/>
							<Setting Key1="NoFragmentation"/>
							<Setting Key1="BufferSize"/>
							<Setting Key1="ReplySize">
								<Rule Name="fPingFrag4096ReplySizeNotSame" Query="$.!=4096" Error="Warning" Sev="2" Title="Ping reply size is different" Text="The size of the returned buffer is not the same as the size of the sent buffer ({1}). Size of the returned buffer: {9}." S1="4096" P9="$." GUID="36aec765-9e61-458b-b522-6123e3ef7780"/>
							</Setting>
							<Setting Key1="RouteRecord"/>
							<Setting Key1="RouteRecordResolved"/>
							<Setting Key1="StatusCode">
								<Rule Name="fPingFrag4096Success" Template="tRemotePingSuccess" S3="False" S9="4096"/>
								<Rule Name="fPingFrag4096RequestTimedOut" Template="tRemotePingRequestTimedOut" S3="False" S9="4096"/>
								<Rule Name="fPingFrag4096OtherError" Template="tRemotePingOtherError" Query="not($fPingNoFrag4096AddressResolutionError or $fPingFrag4096Success or $fPingFrag4096RequestTimedOut)" S3="False" S9="4096" AlwaysEvaluate="True"/>
							</Setting>
							<!-- Rules to check if the ping results suggest that black hole routers may be present -->
							<Rule Name="fBlackHoleSmallSize" Query="$fPingNoFrag548Success and (($fPingNoFrag1472RequestTimedOut and $fPingFrag1472Success and $fPingFrag1472ReplySizeNotSame) or ($fPingNoFrag4096RequestTimedOut and $fPingFrag4096Success and $fPingFrag4096ReplySizeNotSame))" AlwaysEvaluate="True"/>
							<Rule Name="fBlackHoleLargeSize" Query="$fPingNoFrag1472Success and $fPingNoFrag4096RequestTimedOut and $fPingFrag4096Success and $fPingFrag4096ReplySizeNotSame" AlwaysEvaluate="True"/>
							<Rule Name="fBlackholeRouter" Query="$fBlackHoleSmallSize or $fBlackHoleLargeSize" Error="Error" Sev="2" ReportIssue="RootCause" Title="Potential black hole routers" Text="From the ping results, it appears that a black hole router may be present between server {2} and remote server {1}. Follow Microsoft Knowledge Base article 314825 to fix or work around it." S1="%SERVERLONGNAME%" S2="%varExName%" GUID="7178b77c-dbba-4951-a38c-85905c17bcdc"/>
							<Rule Name="fNoBlackHoleRouter" Query="($fPingNoFrag548Success and $fPingNoFrag1472PacketTooBig and $fPingNoFrag4096PacketTooBig) or ($fPingNoFrag1472Success and $fPingNoFrag4096PacketTooBig) or ($fPingNoFrag548Success and $fPingNoFrag1472Success and $fPingFrag4096Success)" Error="None" Title="No black hole routers detected" Text="There was no indication that a black hole router may be present between server {2} and remote server {1}." S1="%SERVERLONGNAME%" S2="%varExName%" AlwaysEvaluate="True"/>
							<Rule Name="fPingRemoteServerError" Query="not($fPingNoFrag548Success and $fPingNoFrag1472Success and $fPingFrag1472Success and $fPingFrag4096Success)" AlwaysEvaluate="True"/>
						</Object>
						<!-- Next, check whether the SMTP port responds -->
						<Object Type="Port" Name="SMTP Port Test" Key1="%SERVERLONGNAME%">
							<Setting Key1="25">
								<Rule Name="fSMTPPortRemoteServerSuccess" Query="$.[2]='25 Available'" Error="None" Title="Port {9} responded" Text="Port {9} successfully responded on server {2}." S2="%SERVERLONGNAME%" S9="25"/>
								<Rule Name="fSMTPPortRemoteServerError" Query="not($fSMTPPortRemoteServerSuccess)" Error="Error" Sev="1" ReportIssue="Issue" Title="Port {9} did not respond" Text="Port {9} did not respond on server {2}. Unless the SMTP port has been changed on server {2}, mail flow problems will occur." S2="%SERVERLONGNAME%" S9="25" GUID="80503d53-ada9-4bc1-b6c3-1266b10de3af"/>
							</Setting>
						</Object>
					</Object>
					<Rule Name="szRDCheckConnectivity" Query="'RDCheckConnectivity'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fRDConnectivityIssueFound,string(@Title),$szExNoErrorStateText)" Title="Potential connectivity issues that may affect mail flows were identified." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No connectivity issues to remote servers were identified."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Remote Delivery Queue(s) Connectivity Test Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="fRDConnectivityIssueFound" Query="$fPingRemoteServerError or $fSMTPPortRemoteServerError or $fBlackholeRouter" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayRDConnectivityStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDCheckSMTPInstanceConfig" Title="Check Remote SMTP Configuration" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varRootDomainDN%" Substitution="varRootDomainDN" Display="Hide"/>
			<Setting Key1="%varAllHostRecordsFoundFQDN%" Substitution="varAllHostRecordsFoundFQDN" Display="Hide"/>
			<Setting Key1="%varAllHostRecordsFoundMX%" Substitution="varAllHostRecordsFoundMX" Display="Hide"/>
			<Setting Key1="%varAllDomainResolvedHostNoMX%" Substitution="varAllDomainResolvedHostNoMX" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Check SMTP Instance Configuration" Text="Please wait while the tool checks whether there are any potential configuration issues with the destination SMTP instances that {2} is trying to send messages to." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Remote SMTP Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<!-- Need to filter out the servers that do not belong to the same organization as well as excluding the duplicates -->
					<Object Type="Cache" Name="RemoteServerFQDNList" Key1="Add" Key2="RemoteServer" Key3="%varAllHostRecordsFoundFQDN%,%varAllHostRecordsFoundMX%,%varAllDomainResolvedHostNoMX%" Key4="," Display="Hide">
						<Rule Name="fNoServerToTest" Query="count(../Instance)=0" Error="Error" Sev="3" Title="No servers were available for SMTP instance name checks" Text="The tool was not able to identify the fully-qualified domain name of all the remote servers. SMTP instance name checks cannot be performed." GUID="e5e1fcf1-688c-41a7-90a7-318fab7e1e1c"/>
						<Setting Key1="RemoteServerShortName" Substitution="REMOTEHOST" SubstitutionFormat="^(.*?)\..*[a-zA-Z].*$----$1"/>
						<Setting Key1="RemoteServerLongName" Substitution="REMOTEFQDN"/>
						<!-- First, we need to find a server then get the FQDN of SMTP VS -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectCategory=msExchExchangeServer)(cn=%REMOTEHOST%))">
							<Setting Key1="cn" Substitution="SRVHOST"/>
							<Setting Key1="distinguishedName" Substitution="DN"/>
							<Setting Key1="networkAddress" Substitution="SRVNAME" SubstitutionFormat="^(ncacn_ip_tcp:(?'tcpip'.*))?.*$----${tcpip}"/>
							<Setting Key1="serialNumber" Substitution="EXVERSION"/>
							<Object Type="If" Name="SameOrgServer" Key1="lower-case('%REMOTEFQDN%') = lower-case('%SRVNAME%')">
								<Setting Key1="lower-case('%REMOTEFQDN%')" Substitution="SRVFQDN"/>
								<Setting Key1="lower-case('%SRVHOST%')" Substitution="SRVHOST"/>
								<Setting Key1="if (contains('%EXVERSION%', 'Version 6.5'), '1', '0')" Substitution="SRVVERSION"/>
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=SMTP,CN=Protocols,%DN%" Key3="objectCategory=protocolCfgSMTPServer">
									<Setting Key1="adminDisplayName" Substitution="SMTPVSNAME"/>
									<Setting Key1="msExchSmtpFullyQualifiedDomainName" Substitution="SMTPVSFQDN" SubstitutionFormat="LowerCase"/>
									<Object Type="Cache" Name="SMTPInstanceCache" Key1="Add" Key2="SMTPInstanceList" Key3="%SRVVERSION%,%SRVHOST%,%SRVFQDN%,%SMTPVSFQDN%,%SMTPVSNAME%" Display="Hide"/>
								</Object>
							</Object>
						</Object>
						<!-- We need to do another search from the oposite direction as the FQDN we have may have come from SMTP VS and the FQDN may be different between server and SMTP VS -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectCategory=protocolCfgSMTPServer)(msExchSmtpFullyQualifiedDomainName=%REMOTEFQDN%))">
							<Setting Key1="adminDisplayName" Substitution="SMTPVSNAME"/>
							<Setting Key1="distinguishedName" Substitution="SERVERNAME" SubstitutionFormat="^CN=.*?,CN=.*?,CN=.*?,CN=(.*?[^\\]),.*$----$1"/>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectCategory=msExchExchangeServer)(cn=%SERVERNAME%))">
								<Setting Key1="cn" Substitution="SRVHOST"/>
								<Setting Key1="networkAddress" Substitution="SRVNAME" SubstitutionFormat="^(ncacn_ip_tcp:(?'tcpip'.*))?.*$----${tcpip}"/>
								<Setting Key1="serialNumber" Substitution="EXVERSION"/>
								<Object Type="If" Key1="true()">
									<Setting Key1="lower-case('%SRVNAME%')" Substitution="SRVFQDN"/>
									<Setting Key1="lower-case('%SRVHOST%')" Substitution="SRVHOST"/>
									<Setting Key1="lower-case('%REMOTEFQDN%')" Substitution="SMTPVSFQDN"/>
									<Setting Key1="if (contains('%EXVERSION%', 'Version 6.5'), '1', '0')" Substitution="SRVVERSION"/>
									<Object Type="Cache" Name="SMTPInstanceCache" Key1="Add" Key2="SMTPInstanceList" Key3="%SRVVERSION%,%SRVHOST%,%SRVFQDN%,%SMTPVSFQDN%,%SMTPVSNAME%" Display="Hide"/>
								</Object>
							</Object>
						</Object>
					</Object>
					<!-- Now we check the SPN related stuff like ExBPA does and also check whether the FQDN matches between server and SMTP VS -->
					<Object Type="Cache" Name="SMTPInstanceCache" Key1="Dump" Key2="SMTPInstanceList" Display="Hide">
						<Setting Key1="ServerVersion" Substitution="SRVVERSION" Format="^(.*?),.*$----$1"/>
						<Setting Key1="ServerHost" Substitution="SRVHOST" Format="^.*?,(.*?),.*$----$1"/>
						<Setting Key1="ServerFQDN" Substitution="SRVFQDN" Format="^.*?,.*?,(.*?),.*$----$1"/>
						<Setting Key1="SMTPInstanceFQDN" Substitution="SMTPVSFQDN" Format="^.*?,.*?,.*?,(.*?),.*$----$1"/>
						<Setting Key1="SMTPInstanceName" Substitution="SMTPVSNAME" Format="^.*?,.*?,.*?,.*?,(.*?)$----$1"/>
						<Object Type="Group" Name="%SMTPVSFQDN%" Class="Name" GroupingClass="True" Display="Hide">
							<Object Type="LookupAccount" Key1="Name" Key2="%varDCName%" Key3="%SRVHOST%$">
								<Setting Key1="Sid" Substitution="COMPUTERSID"/>
								<Object Type="Directory" Key1="GC://%varDCName%" Key2="%varRootDomainDN%" Key3="objectSid=%COMPUTERSID%">
									<Setting Key1="servicePrincipalName">
										<Rule Name="szSPN" Query="concat(join(';', $.),';')"/>
										<Rule Name="fSPNSMTPVsiFQDNMissing" Query="'%SRVVERSION%' = '1' and not($fClusterServiceRunning) and count($szSPN)&gt;0 and (not(contains(lower-case($szSPN), concat('smtpsvc/', '%SMTPVSFQDN%', ';'))) and not(contains(lower-case($szBackConnectionHostNames), concat('%SMTPVSFQDN%', ';'))) and (count($iDisableLoopbackCheck)=0 or $iDisableLoopbackCheck=0))" Error="Error" Sev="3" ReportIssue="Issue" Title="Missing SMTP virtual server FQDN in SMTPSVC service principal name" Text="The computer account for Exchange server {2} does not appear to contain the fully-qualified domain name of Exchange SMTP virtual server '{3}'. This may cause Kerberos authentication to fail when sending messages between servers. The tool expected to find 'SMTPSVC/{1}' in the {5}." S1="%SMTPVSFQDN%" S2="%SRVFQDN%" P3="$szSMTPInstanceName" S5="ServicePrincipalName" GUID="6db21156-a9fc-44d3-8bf8-6a2e035fa7ce" AlwaysEvaluate="True"/>
									</Setting>
								</Object>
							</Object>
							<Object Type="Group">
								<Setting Key1="ServerStatus">
									<Rule Name="szSMTPInstanceName" Query="'%SMTPVSNAME%'"/>
									<Rule Name="fClusterServiceRunning" Query="$fClusterServiceRunningKey" AlwaysEvaluate="True"/>
									<Rule Name="fFQDNNoMatch" Query="'%SRVFQDN%' != '%SMTPVSFQDN%'" Error="Warning" Sev="2" Title="SMTP instance fully-qualified domain name does not match server name" Text="The fully-qualified domain name of SMTP virtual server '{3}' on server {2} does not match the fully-qualified domain name of the server. This may cause mail routing problems. SMTP virtual server: {1}. Server: {4}." S1="%SMTPVSFQDN%" S2="%SRVHOST%" P3="$szSMTPInstanceName" S4="%SRVFQDN%" GUID="391087ca-4544-4c26-a9b3-51bc46328bf4"/>
								</Setting>
							</Object>
							<Object Type="Registry" Key1="%SRVHOST%" Key3="SYSTEM\CurrentControlSet\Control\LSA">
								<Setting Key1="CrashOnAuditFail" Retrieve="FailHard"/>
								<Setting Key1="DisableLoopbackCheck">
									<Rule Name="iDisableLoopbackCheck" Query="$."/>
								</Setting>
								<Object Type="Registry" Key1="%SRVHOST%" Key3="SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0">
									<Setting Key1="BackConnectionHostNames">
										<Rule Name="szBackConnectionHostNames" Query="concat(join(';', $.),';')"/>
									</Setting>
								</Object>
								<Object Type="WMI" Key1="%SRVHOST%" Key3="Win32_Service" Key4="Name='ClusSvc'">
									<Setting Key1="Started">
										<Rule Name="fClusterServiceRunningKey" Query="$.='True'"/>
									</Setting>
								</Object>
							</Object>
						</Object>
					</Object>

					<Rule Name="szRDCheckSMTPInstanceConfig" Query="'RDCheckSMTPInstanceConfig'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fRDSMTPInstanceIssueFound,string(@Title),$szExNoErrorStateText)" Title="Potential SMTP instance configuration issues were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No SMTP instance configuration issues were found."/>
					<Rule Name="szRDCheckSMTPInstanceConfigResult" Query="string(@Title)" Title="Remote Delivery SMTP Instance Configuration Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="fRDSMTPInstanceIssueFound" Query="$fFQDNNoMatch or $fSPNSMTPVsiFQDNMissing" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayRDCheckSMTPInstanceConfigStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDCheckEventLog" Title="Check Event Log" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Object Type="Progress" Title="Checking Event Logs" Text="Please wait while the tool checks whether there are known events in the event logs on server {2} that are related to remote delivery queue issues." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Remote SMTP Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="If" Name="%varExName%" Key1="true()" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Get the the datetime of exactly 24 hours ago in the yyyyMMddHHmmss.000000+000 format as this format is faster for a WMI query -->
						<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
						<!-- Let's look if the app event log contains any events 4001 or 4006 as they are common for SMTP protocol errors and dropped connections -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=4001 AND SourceName='MSExchangeTransport' AND Category=3 AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="Category"/>
							<Setting Key1="CategoryString"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt4001WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A transport connection manager warning event was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="4001" GUID="030669e4-be72-475d-8892-b81a45b6cf9a"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=4006 AND SourceName='MSExchangeTransport' AND Category=3 AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="Category"/>
							<Setting Key1="CategoryString"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt4006WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A transport connection manager warning event was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="4006" GUID="3c196169-ca10-4099-877d-10147ee5bad4"/>
							</Setting>
						</Object>

						<Rule Name="szRDCheckEventLog" Query="'RDCheckEventLog'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fRDEventlogFound,string(@Title),$szExNoErrorStateText)" Title="Potentially related event log entries were found." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No relevant event log entries were found."/>
						<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Remote Delivery Queue(s) Event Log Analysis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fRDEventlogFound" Query="$fEvt4001WithinLast24hours or $fEvt4006WithinLast24hours" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayRDEventLogStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDCheckE12MessageTrackingLog" Title="Check Message Tracking Log" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Message Tracking Logs" Text="Please wait while the tool checks whether there are known events in the Message Tracking logs on server {2} that are related to remote delivery queue issues." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" SecurityContext="EXLOGON">
					<!-- Let's look if the Message Tracking log contains any 'FAIL' events as they are common for SMTP protocol errors and dropped connections -->
					<Object Type="MonadCommand" Key1="get-MessageTrackingLog -Server %varExName% -Start '%varCurrentDateTime%' -EventId 'FAIL'" TrackProgress="TrackProgress">
						<Setting Key1="EventId"/>
						<Setting Key1="ClientHostname" Substitution="ClientHostname"/>
						<Setting Key1="ServerIp"/>
						<Setting Key1="ServerHostname" Substitution="ServerHostname"/>
						<Setting Key1="Source" Substitution="Source"/>
						<Setting Key1="MessageId" Substitution="MessageId"/>
						<Setting Key1="RecipientStatus" Substitution="RecipientStatus"/>
						<Setting Key1="Timestamp">
							<Rule Name="dFailEvtAdjustGMTinSec" Template="tEvtAdjustGMTinSec"/>
							<Rule Name="dFailEvtRawTimeDiffinSec" Query="get-seconds(date-difference(@S8, $.), 'yyyyMMddHHmmss')" S8="%varCurrentDateTime%"/>
							<Rule Name="fFailEvtWithinLast24hours" Query="($dFailEvtRawTimeDiffinSec + $dFailEvtAdjustGMTinSec) &lt; 86400" Error="Warning" Sev="2" Title="A transport connection manager 'FAIL' event was logged within the last 24 hours" Text="There was a '{9}' event with Internal Message ID of '{1}' in the application log of server {2} from the source component '{5}' that resulted in a '{6}' problem." S1="%MessageId%" S2="%varExName%" S5="%Source%" S6="%RecipientStatus%" S9="FAIL"/>
						</Setting>
					</Object>
					<Rule Name="szRDCheckE12MessageTrackingLog" Query="'RDCheckE12MessageTrackingLog'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fRDMessageTrackinglogFound,string(@Title),$szExNoErrorStateText)" Title="Potentially related message tracking log entries were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No relevant Message Tracking log entries were found."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Remote Delivery Queue(s) Message Tracking Log Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="fRDMessageTrackinglogFound" Query="$fFailEvtWithinLast24hours" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayRDMessageTrackingLogStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDSMTPCommand" Title="Throw SMTP Commands" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varAllHostRecordsFoundFQDN%" Substitution="varAllHostRecordsFoundFQDN" Display="Hide"/>
			<Setting Key1="%varAllHostRecordsFoundMX%" Substitution="varAllHostRecordsFoundMX" Display="Hide"/>
			<Setting Key1="%varAllDomainResolvedHostNoMX%" Substitution="varAllDomainResolvedHostNoMX" Display="Hide"/>
			<Setting Key1="%varAllRemoteServerIP%" Substitution="varAllRemoteServerIP" Display="Hide"/>
			<Setting Key1="%varRCPTAddress%" Substitution="varRCPTAddress" Display="Hide"/>
			<Setting Key1="%varMAILFROMAddress%" Substitution="varMAILFROMAddress" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Object Type="Progress" Title="Testing SMTP Commands" Text="Please wait while the tool tests SMTP commands with the servers that {2} is trying to send messages to." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Remote SMTP Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<!-- Now let's start throwing SMTP commands to remote servers. We use a local address for RCPT TO so it will probably produce a 5.7.1 error when connecting to remote domains -->
					<Object Type="Cache" Name="RemoteServerList" Key1="Add" Key2="RemoteServer" Key3="%varAllHostRecordsFoundFQDN%,%varAllHostRecordsFoundMX%,%varAllDomainResolvedHostNoMX%,%varAllRemoteServerIP%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
						<Rule Name="fNoServerToTest" Query="count(../Instance)=0" Error="Error" Sev="3" Title="No servers are available for SMTP command tests" Text="There are no remote servers that have passed the connectivity tests over port {9}. SMTP command tests cannot be performed." S9="25" GUID="e23b5af5-ea81-44ad-a0c3-20e8e39a9c81"/>
						<Setting Key1="RemoteServer" Substitution="REMOTESERVER"/>
						<Object Type="Protocol" Name="SMTP Command Test" Key1="%REMOTESERVER%" Key2="TCP" Key3="25" Key4="60000" Timeout="%300">
							<Setting Key1="Connect">
								<Rule Name="fSMTPSocketAliveRemoteServerOkay" Query="not ($.[2]='Respond = Remote socket is not available' or $.[2]='Respond = ' or $fSMTPInsufficientSystemResourcesonConnect or $fSMTPServiceNotAvailableonConnect or $fSMTPOther400LevelErroronConnect or $fSMTPGeneral500LevelErrorOnConnect)"/>
								<Rule Name="fSMTPSocketAliveRemoteServerError" Query="not ($fSMTPSocketAliveRemoteServerOkay)" Error="Error" Sev="2" ReportIssue="Issue" Title="Mail acceptance failure" Text="Remote server {2} failed the mail acceptance test when trying to open the remote socket: {1}." P1="$.[2]" S2="%REMOTESERVER%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
								<Rule Name="fSMTPSocketAliveRemoteServerPIXFireWall" Query="starts-with($.[2],'Respond = 220') and (contains($.[2], '***') or contains(upper-case($.[2]),'SMTP/CMAP'))" Template="tSMTPProxyRunning" S0="Cisco PIX firewall" S2="%REMOTESERVER%"/>
								<Rule Name="fSMTPSocketAliveRemoteServerWatchGuard" Template="tSMTPProxyRunning" S0="WatchGuard Firebox firewall" S2="%REMOTESERVER%" S4="SMTP SERVICE READY"/>
								<Rule Name="fSMTPSocketAliveRemoteServerCheckPoint" Template="tSMTPProxyRunning" S0="Checkpoint Firewall" S2="%REMOTESERVER%" S4="CHECKPOINT"/>
								<Rule Name="fSMTPSocketAliveRemoteServerRaptor" Query="contains(upper-case($.[2]), 'GENERIC SMTP HANDLER')" Template="tSMTPProxyRunning" S0="Raptor Firewall" S2="%REMOTESERVER%"/>
								<Rule Name="fSMTPSocketAliveRemoteServerCyberGuard" Template="tSMTPProxyRunning" S0="CyberGuard firewall" S2="%REMOTESERVER%" S4="FW1 SMTP PROXY SERVICE READY"/>
								<Rule Name="fSMTPSocketAliveRemoteServerPraetor" Template="tSMTPProxyRunning" S0="CMS Praetor" S2="%REMOTESERVER%" S4="CMSPRAETOR"/>
								<Rule Name="fSMTPSocketAliveRemoteServerMerak" Template="tSMTPProxyRunning" S0="Merak Mail Server" S2="%REMOTESERVER%" S4="ESMTP MERAK"/>
								<Rule Name="fSMTPInsufficientSystemResourcesonConnect" Query="contains($.[2],'452 4.3.1')" Error="Error" Sev="2" ReportIssue="Issue" Title="Server Reports Insufficient System Resources" Text="Server {2} reports insufficient system resources. If the remote server is running Exchange Server 2007, this could be an indication that the transport service is in a backpressure state (High). {5}" S2="%REMOTESERVER%" P5="$.[2]"/>
								<Rule Name="szHostReporting452onConnect" Query="if($fSMTPInsufficientSystemResourcesonConnect,substring-before('%REMOTESERVER%','.'))" Display="Hide" AlwaysEvaluate="True"/>
								<Rule Name="fSMTPServiceNotAvailableonConnect" Query="contains($.[2],'421 4.3.2')" Error="Error" Sev="2" ReportIssue="RootCause" Title="Remote Server Reports Service Not Available" Text="Remote server {2} reports service not available. If the remote server is running Exchange Server 2007, this could be an indication that the '{4}' service is paused. {5}" S2="%REMOTESERVER%" S4="MSExchangeTransport" P5="$.[2]"/>
								<Rule Name="fSMTPOther400LevelErroronConnect" Query="matches($.[2],'^Respond = 4[0-9]{2}\b.*') and not($fSMTPInsufficientSystemResourcesonConnect) and not($fSMTPServiceNotAvailableonConnect)" Error="Error" Sev="2" ReportIssue="Issue" Title="Remote Server Responds With Transient Error" Text="Remote server {2} responds to initial SMTP connection with a 400-level transient error. {5}" S2="%REMOTESERVER%" P5="$.[2]"/>
								<Rule Name="fSMTPGeneral500LevelErrorOnConnect" Query="matches($.[2],'^Respond = 5[0-9]{2}\b.*')" Error="Error" Sev="2" ReportIssue="Issue" Title="Remote Server Responds With Permanent Error" Text="Remote server {2} responds to initial SMTP connection with a 500-level permanent error. {5}" S2="%REMOTESERVER%" P5="$.[2]"/>
							</Setting>
							<Setting Key1="EHLO">
								<!-- Check if 8BITMIME is supported -->
								<Rule Name="f8BITMIMENotRegistered" Query="$fSMTPSocketAliveRemoteServerOkay and not(contains (upper-case($.[2]), '250-8BITMIME'))" Error="Warning" Sev="2" Title="8BITMIME not registered" Text="Remote server {2} does not support the 8BITMIME verb. This will prevent routing of mails requiring the 8BITMIME extension. Please check whether the queue contains such messages." S2="%REMOTESERVER%" GUID="b897b085-1100-4145-8218-ecfa7980c3ce"/>
								<Rule Name="fE12ESMTPServerDetected" Query="$fSMTPSocketAliveRemoteServerOkay and contains(upper-case($.[2]),'250 XEXCH50') and contains(upper-case($.[2]),'250-STARTTLS')" Error="None" Title="Remote server ({2}) running Exchange Server 2007" Text="Based on EHLO response, it appears that remote server ({2}) is running Exchange Server 2007." S2="%REMOTESERVER%"/>
								<Rule Name="fXANONYMOUSTLSNotAdvertised" Query="$fE12ESMTPServerDetected and not(contains(upper-case($.[2]),'250-X-ANONYMOUSTLS'))" Error="Warning" Sev="2" Title="Remote server ({2}) not advertising X-ANONYMOUSTLS" Text="Based on EHLO response, it appears that remote server ({2}) is running Exchange Server 2007 but is not advertising '{0}'." S0="X-ANONYMOUSTLS" S2="%REMOTESERVER%"/>
								<Rule Name="szHostXANONYMOUSTLSNotAdvertised" Query="if($fXANONYMOUSTLSNotAdvertised,substring-before('%REMOTESERVER%','.'))" Display="Hide" AlwaysEvaluate="True"/>
							</Setting>
							<Setting Key1="MAIL FROM: %varMAILFROMAddress%" Key5="MAIL FROM">
								<Rule Name="fAcceptTestMailFromRemoteServerOkay" Query="starts-with($.[2], 'Respond = 250')"/>
								<Rule Name="fAcceptTestMailFromRemoteServerError" Query="$fSMTPSocketAliveRemoteServerOkay and not ($fAcceptTestMailFromRemoteServerOkay)" Error="Error" Sev="2" ReportIssue="Issue" Title="Mail acceptance failure" Text="Remote server {2} failed the mail acceptance test. MAIL FROM command: {1}." P1="$szMailFromRemoteServerResponse" S2="%REMOTESERVER%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
								<Rule Name="szMailFromRemoteServerResponse" Query="replace($.[2], ',$', '')"/>
								<Rule Name="fSMTPInsufficientSystemResourcesonMailFrom" Query="contains($.[2],'452 4.3.1')" Error="Error" Sev="2" ReportIssue="Issue" Title="Server Reports Insufficient System Resources" Text="Server {2} reports insufficient system resources in response to SMTP 'MAIL FROM' command. If the remote server is running Exchange Server 2007, this could be an indication that the transport service is in a backpressure state (MediumHigh). {5}" S2="%REMOTESERVER%" P5="$.[2]"/>
								<Rule Name="szHostReporting452onMailFrom" Query="if($fSMTPInsufficientSystemResourcesonMailFrom,substring-before('%REMOTESERVER%','.'))" Display="Hide" AlwaysEvaluate="True"/>
							</Setting>
							<Setting Key1="RCPT TO: %varRCPTAddress%" Key5="RCPT TO">
								<Rule Name="fAcceptTestRcptToRemoteServerOkay" Query="starts-with($.[2], 'Respond = 250')"/>
								<Rule Name="fAcceptTestRcptToRemoteServerError" Query="$fSMTPSocketAliveRemoteServerOkay and $fAcceptTestMailFromRemoteServerOkay and not ($fAcceptTestRcptToRemoteServerRefused) and not ($fAcceptTestRcptToRemoteServerOkay)" Error="Error" Sev="2" ReportIssue="Issue" Title="Mail acceptance failure" Text="Remote server {2} failed the mail acceptance test. RCPT TO command: {1}." P1="$szRcptToRemoteServerResponse" S2="%REMOTESERVER%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
								<Rule Name="fAcceptTestRcptToRemoteServerRefused" Query="$fSMTPSocketAliveRemoteServerOkay and $fAcceptTestMailFromRemoteServerOkay and contains($.[2],'550 5.7.1')" Error="Warning" Sev="2" Title="Mail acceptance failure" Text="Remote server {2} refused the test mail to recipient '{3}'. If this remote server belongs to a remote domain, this is not necessarily indicating a problem. RCPT TO command: {1}." P1="$szRcptToRemoteServerResponse" S2="%REMOTESERVER%" S3="%varRCPTAddress%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
								<Rule Name="szRcptToRemoteServerResponse" Query="replace($.[2], ',$', '')"/>
							</Setting>
							<!-- Note the tool is throwing a BDAT command instead of DATA to check if the remote server supports BDAT -->
							<Setting Key1="BDAT 180 LAST">
								<Rule Name="fBDATNotRegistered" Query="$fSMTPSocketAliveRemoteServerOkay and $fAcceptTestMailFromRemoteServerOkay and $fAcceptTestRcptToRemoteServerOkay and starts-with($.[2], 'Respond = 5')" Error="Error" Sev="2" ReportIssue="Issue" Title="BDAT not registered" Text="Remote server {2} does not seem to support the BDAT command. This will prevent routing of mails requiring the BDAT command. Please check whether the queue contains such messages. BDAT command: {1}." P1="$szBDAToRemoteServerResponse" S2="%REMOTESERVER%" GUID="438f1688-6821-4a80-ae4a-2bb3bd977c61"/>
								<Rule Name="szBDAToRemoteServerResponse" Query="replace($.[2], ',$', '')"/>
							</Setting>
							<Setting Key1="This message has been sent by the Microsoft Exchange Troubleshooting Assistant. The purpose of this message is to test the SMTP transport. It is safe to delete this message.">
								<Rule Name="fAcceptTestBDATRemoteServerOkay" Query="starts-with ($.[2], 'Respond = 250')"/>
								<Rule Name="fAcceptTestBDATRemoteServerError" Query="$fSMTPSocketAliveRemoteServerOkay and $fAcceptTestMailFromRemoteServerOkay and $fAcceptTestRcptToRemoteServerOkay and not ($fBDATNotRegistered or $fAcceptTestBDATRemoteServerOkay)" Error="Error" Sev="2" ReportIssue="Issue" Title="Mail acceptance failure" Text="Remote server {2} failed the mail acceptance test. BDAT command: {1}. Check for firewalls and applications that can possibly block the BDAT command." P1="$szBDATRemoteServerResponse" S2="%REMOTESERVER%" GUID="9e1cc734-5d81-4fa5-9bdc-0b1138cc4232"/>
								<Rule Name="szBDATRemoteServerResponse" Query="replace($.[2], ',$', '')"/>
							</Setting>
							<Setting Key1="Disconnect"/>
							<Rule Name="fMailAcceptRemoteServerSuccess" Query="$fSMTPSocketAliveRemoteServerOkay and $fAcceptTestMailFromRemoteServerOkay and $fAcceptTestRcptToRemoteServerOkay and $fAcceptTestBDATRemoteServerOkay" Error="None" Title="Mail acceptance success" Text="Remote server {2} successfully completed the mail acceptance test." S2="%REMOTESERVER%"/>
							<Rule Name="szAllHostReporting452" Query="join(',', $szHostReporting452onConnect, $szHostReporting452onMailFrom)" AlwaysEvaluate="True">
								<Variable Name="varAllHostReporting452" Scope="Children"/>
							</Rule>
							<Rule Name="szAllE12NotAdvertisingXAnonTLS" Query="join(',', $szHostXANONYMOUSTLSNotAdvertised)" AlwaysEvaluate="True">
								<Variable Name="varAllE12NotAdvertisingXAnonTLS" Scope="Children"/>
							</Rule>
						</Object>
					</Object>

					<Rule Name="szRDSMTPCommand" Query="'RDSMTPCommand'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if(not($fMailAcceptRemoteServerSuccess) and not($fNoServerToTest),string(@Title),$szExNoErrorStateText)" Title="Potential issues related to SMTP commands were found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No SMTP command related issues were found."/>
					<Rule Name="szRDSMTPCommandTestResult" Query="string(@Title)" Title="Remote Delivery Queue(s) SMTP Commands Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayRDSMTPCommandStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="E12BackPressureCheck" Name="fGotoE12BackPressureCheck" Query="$fSMTPInsufficientSystemResourcesonConnect" Priority="2" Text="- Determine why remote server is reporting insufficient system resources" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="RDE12ReceiveCheck" Name="fGotoRDE12ReceiveCheck" Query="$fXANONYMOUSTLSNotAdvertised" Priority="3" Text="- Determine why remote server is not advertising X-ANONYMOUSTLS" Display="Hide" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDCheckThirdParty" Title="Check Third-Party Applications" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Object Type="Progress" Title="Checking Third-Party Applications" Text="Please wait while the tool checks the configuration of third-party applications on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">

				<Object Type="Group" Name="Third Party Software" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<!-- First, let's check whether Symantec AntiVirus Corporate Edition 9.x Internet E-Mail Auto-Protect is enabled -->
						<Object Type="Registry" Key1="%varExName%" Key3="Software\Intel\LANDesk\VirusProtect6\CurrentVersion\Snap-In\InternetMail">
							<Setting Key1="__KEYPATH">
								<Rule Name="fSymantecEmailAutoProtectInstalled" Query="$." Error="Warning" Sev="2" Title="{0} {1} plug-in installed" Text="It appears that {0} is installed on server {2} with the {1} plug-in. Please follow the best practice when installing it on an Exchange server." S0="Symantec AntiVirus Corporate Edition" S1="Internet E-Mail Auto-Protect" S2="%varExName%" GUID="7695481f-3550-430a-96b4-586f63ff1e06"/>
							</Setting>
						</Object>
						<Object Type="Registry" Key1="%varExName%" Key3="Software\Intel\LANDesk\VirusProtect6\CurrentVersion\Storages\InternetMail\RealTimeScan">
							<Setting Key1="OnOff">
								<Rule Name="fSymantecEmailAutoProtectRunning" Query="$fSymantecEmailAutoProtectInstalled and $fSymantecAntiVirusRunning and $.= 1" Error="Error" Sev="2" ReportIssue="Issue" Title="{0} {1} plug-in enabled" Text="The {1} plug-in for {0} is running on server {2}. Messages to remote domains and servers may back up in queues or users may receive non-delivery reports." S0="Symantec AntiVirus Corporate Edition" S1="Internet E-Mail Auto-Protect" S2="%varExName%" GUID="fc510732-29c4-4696-b13a-f4570c6e9885" AlwaysEvaluate="True"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='Symantec AntiVirus'">
							<Setting Key1="Started">
								<Rule Name="fSymantecAntiVirusRunning" Query="$.='True'"/>
							</Setting>
						</Object>

						<!-- Second, let's check whether McAfee VirusScan port blocking is enabled for port 25. We need to enumerate the 'numbered' registry values as any one of them may have this rule. -->
						<Object Type="If" Name="McAfee VirusScan" Key1="true()">
							<Setting Key1="if ('%varIsExchange2007orLater%'='1', 'MSExchangeTransport.exe', 'Inetinfo.exe')" Substitution="SMTPPROCESS"/>
							<Object Type="Registry" Key1="%varExName%" Key3="Software\Network Associates\TVD\VirusScan Enterprise\CurrentVersion">
								<Setting Key1="__KEYPATH">
									<Rule Name="fMcAfeeVirusScanInstalled" Query="$." Error="None" Title="{0} installed" Text="{0} is installed on server {2}." S0="McAfee VirusScan" S2="%varExName%"/>
								</Setting>
							</Object>
							<Object Type="Enumerator" Name="McAfee keys" Key1="0" Key2="7" Key3="1">
								<Setting Key1="Num" Substitution="NUM">
									<Rule Name="fMcAfeePort25Blocked" Query="$fMcAfeeVirusScanRunning and $fMcAfeePort25BlockRuleEnabled" Error="Warning" Sev="1" Title="Port {9} is blocked" Text="{0} is running on server {2} with a rule to block port {9} and the '{5}' process is not excluded from this rule. Messages to remote domains and servers may back up in queues or users may receive non-delivery reports. Rule name: '{1}'." S0="McAfee VirusScan" P1="$szMcAfeePortBlockRuleName" S2="%varExName%" S5="%SMTPPROCESS%" S9="25" GUID="18db6542-129d-4878-ba7f-1f83d3d755cd"/>
								</Setting>
								<Object Type="Registry" Key1="%varExName%" Key3="Software\Network Associates\TVD\Shared Components\On Access Scanner\BehaviourBlocking">
									<Setting Key1="__KEYPATH">
										<Rule Name="fMcAfeePort25BlockRuleEnabled" Query="$fMcAfeePortBlockEnabled and $fMcAfeePortBlock25Included and $fMcAfeeProcessNotExcluded"/>
									</Setting>
									<Setting Key1="PortBlockName_%NUM%" Key2="Name">
										<Rule Name="szMcAfeePortBlockRuleName" Query="$."/>
									</Setting>
									<Setting Key1="PortBlockEnabled_%NUM%" Key2="Enabled">
										<Rule Name="fMcAfeePortBlockEnabled" Query="$.='1'"/>
									</Setting>
									<Setting Key1="PortBlockRange_%NUM%" Key2="Range">
										<Rule Name="fMcAfeePortBlock25Included" Query="$.='25' or (contains($., '-') and (substring-before($., '-') &lt;=25 and substring-after($., '-') &gt;=25))"/>
									</Setting>
									<Setting Key1="PortBlockWhiteList_%NUM%" Key2="Excluded">
										<Rule Name="fMcAfeeProcessNotExcluded" Query="not(contains(upper-case($.), upper-case(@S5)))" S5="%SMTPPROCESS%"/>
									</Setting>
								</Object>
							</Object>
							<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='McShield'">
								<Setting Key1="Started">
									<Rule Name="fMcAfeeVirusScanRunning" Query="$.='True'"/>
								</Setting>
							</Object>
						</Object>

						<Rule Name="szRDCheckThirdParty" Query="'RDCheckThirdParty'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fThirdPartyIssueFound, string(@Title), $szExNoErrorStateText)" Title="Potential third-party application configuration issues were found." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No third-party application configuration issues were found."/>
						<Rule Name="szRDCheckThirdPartyTestResult" Query="string(@Title)" Title="Third-Party Application Analysis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fThirdPartyIssueFound" Query="$fSymantecEmailAutoProtectInstalled or $fSymantecEmailAutoProtectRunning or $fMcAfeePort25Blocked" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayRDCheckThirdPartyStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MADLCatCheck" Title="Check Categorizer" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varNonEnglishOS%" Substitution="varNonEnglishOS" Display="Hide"/>
			<Setting Key1="%varMADLMany%" Substitution="varMADLMany" Display="Hide"/>
			<Setting Key1="%varMADLRetry%" Substitution="varMADLRetry" Display="Hide"/>
			<Setting Key1="%varIsExchange2003%" Substitution="varIsExchange2003" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of Categorizer" Text="Please wait while the tool checks the status of Categorizer on server {2}. This process may take a minute or so as it attempts to obtain several performance samples over the period." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<!-- Let's take a look at CAT performance in general-->
				<Object Type="Group" Name="Categorizer Status" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<Object Type="Pdh" Name="CatBasicData" Key1="%varExName%" Key2="20" Key3="6" Level="1" SecurityContext="EXLOGON">
							<Rule Name="fGeneralErrorAccessPerf" Query="../Exception" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. Error message: {1}." S0="SMTP Server" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fBDBErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bdb')" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. This may be due to insufficient permissions. Error message: {1}." S0="SMTP Server" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fContactErrorAccessPerf" Query="contains(../Exception/@Message, '0x800007d0')" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Error accessing performance counters on server {2}. The server may be unavailable, or the remote registry service may not be running on that server. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fNonEngErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bb8') and @S1='1'" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Cannot access performance monitor counters. This tool must run on a U.S. English operating system." S1="%varNonEnglishOS%"/>

							<Setting Key1="SMTP Server" Key2="Cat: Messages submitted/sec" Key3="_Total">
								<Rule Name="iAvgCatSubSec" Query="list-average($.)"/>
							</Setting>
							<Setting Key1="SMTP Server" Key2="Cat: Categorizations completed/sec" Key3="_Total">
								<Rule Name="iAvgCatCompSec" Query="list-average($.)"/>
								<Rule Name="fCatOverloaded" Query="($iAvgCatSubSec - $iAvgCatCompSec) &gt; 2 and $iAvgCatCompSec &gt; 0" Error="Warning" Sev="2" ReportIssue="Summary" Title="Possible categorizer overload" Text="It appears that messages are being submitted to the categorizer of server {2} faster than it can process. Please check if this is an expected load. Measured average value of the '{0}' counter: {9}" P0="localize-path('SMTP Server(_Total)\Cat: Messages submitted/sec')" S2="%varExName%" P9="round(list-average($iAvgCatSubSec)*10000) div 10000" GUID="29af0f89-0f75-4d21-aca0-a63a0aec8dd1"/>
							</Setting>
							<Setting Key1="SMTP Server" Key2="Categorizer Queue Length" Key3="_Total">
								<Rule Name="iAvgCatQueue" Query="list-average($.)" Error="None" Title="Categorizer Queue Length" Text="The average value of the '{0}' counter is {9}." P0="localize-path('SMTP Server(_Total)\Categorizer Queue Length')" P9="list-average($.)"/>
							</Setting>
							<Setting Key1="SMTP Server" Key2="Cat: Categorizations in progress" Key3="_Total">
								<Rule Name="fAvgCatInProgAround1000" Query="list-average($.) &gt;800" Error="Error" Sev="2" ReportIssue="Issue" Title="Large number of categorizations in progress" Text="The '{0}' counter on server {2} is averaging more than {8}. This may indicate that server {2} is experiencing a performance problem or messages are being submitted faster than the categorizer can process. Measured average value of the counter: {9}" P0="localize-path('SMTP Server(_Total)\Cat: Categorizations in progress')" S2="%varExName%" S8="800" P9="list-average($.)" GUID="e49d7429-db7a-4792-9fa6-d718620a7665"/>
								<Rule Name="fMinCatInProgNeverZero" Query="list-min($.) &gt;0" Error="Warning" Sev="1" Title="Possible Inetinfo problem" Text="It appears that the '{0}' counter never hits zero on server {2}. If this server is not busy, this may indicate that the inetinfo process has a problem." P0="localize-path('SMTP Server(_Total)\Cat: Categorizations in progress')" S2="%varExName%" GUID="a65a4dbe-aba3-4a94-82aa-1ca7af357d6c"/>
								<Rule Name="fCatInProgRetryableError" Query="list-average($.)=0 and $iAvgCatQueue &gt;0" Error="Error" Sev="2" ReportIssue="Issue" Title="Earlier categorizations potentially failed with a retryable error" Text="It appears that earlier categorization attempts on server {2} failed due to retryable error(s). Currently, the number of '{0}' is zero though the queue still contains messages." P0="localize-path('SMTP Server(_Total)\Cat: Categorizations in progress')" S2="%varExName%" GUID="b512b79f-2a0c-40ab-83f6-e2f01924d7e5"/>
							</Setting>
							<Setting Key1="SMTP Server" Key2="Cat: Messages Categorized" Key3="_Total">
								<Rule Name="fMessCatIncrease" Query="not (list-average($.)=list-max($.))"/>
							</Setting>
							<Setting Key1="SMTP Server" Key2="Cat: Categorizations Completed" Key3="_Total">
								<Rule Name="fCatCompleteIncrease" Query="not (list-average($.)=list-max($.))"/>
								<Rule Name="fCatProgressMade" Query="@S1='1' and $fMessCatIncrease and $fCatCompleteIncrease" Error="Error" Sev="2" ReportIssue="Summary" Title="Potential performance issue" Text="There are messages that completed categorizations on server {2} but the queue length appears to be high. This may indicate that a performance problem is occurring." S1="%varMADLMany%" S2="%varExName%" GUID="bd10f12f-b828-4f70-943f-8c1dd1d7ef6d"/>
								<Rule Name="fCatBlocked" Query="(@S1='1' or $iAvgCatSubSec &gt; 0) and not ($fMessCatIncrease or $fCatCompleteIncrease)" S1="%varMADLMany%"/>
							</Setting>
							<Rule Name="fMADLSlowPerfProb" Query="$fCatOverloaded or $fAvgCatInProgAround1000 or $fCatProgressMade"/>
							<Rule Name="fMADLRetryProb" Query="@S1='1' or $fMinCatInProgNeverZero or $fCatInProgRetryableError or $fCatBlocked" S1="%varMADLRetry%"/>
						</Object>
					</Object>

					<Rule Name="szMADLCatCheck" Query="'MADLCatCheck'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if(not($fCatOverloaded), if($fMADLSlowPerfProb and $fMADLRetryProb, string(@Title),if($fMADLRetryProb, $szExErrorStateRetry, $szExErrorStatePerf)), $szExErrorStateOverload)" Title="Potential combination of slow performance and retry queue problem." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExErrorStateRetry" Query="string(@Title)" Title="Potential retry queue problem."/>
					<Rule Name="szExErrorStatePerf" Query="string(@Title)" Title="Potential slow performance."/>
					<Rule Name="szExErrorStateOverload" Query="string(@Title)" Title="Potential server overload."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Categorizer Analysis Results.">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>
					<Rule Name="szProbLinkName" Query="'PreCatQueue'">
						<Variable Name="varProbLinkName" Scope="Children"/>
					</Rule>
					<Rule Name="szProbLinkLongName" Query="string(@Title)" Title="Messages awaiting directory lookup">
						<Variable Name="varProbLinkLongName" Scope="Children"/>
					</Rule>
					<Rule Name="szGroupingClass" Query="'Categorizer Status'">
						<Variable Name="varGroupingClass" Scope="Children"/>
					</Rule>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckQueueStatusStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="RecipientCheck" Name="fGotoRecipientCheck" Query="@S1='1'" Priority="2" Text="- Check whether there are common destinations shared by messages in the queue (this step is conducted only when the server is running Exchange Server 2003)" S1="%varIsExchange2003%" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="MADLFileVersion" Name="fGotoMADLFileVersion" Query="$fMADLRetryProb" Priority="3" Text="- Check the version of files for possible issues" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="MADLHighCPUCheck" Name="fGotoMADLHighCPUCheck" Query="$fMADLSlowPerfProb" Priority="4" Text="- Check whether any high CPU usage is detected" Display="Hide" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RecipientCheck" Title="Check Destinations of Messages" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varProbLinkName%" Substitution="varProbLinkName" Display="Hide"/>
			<Setting Key1="%varProbLinkLongName%" Substitution="varProbLinkLongName" Display="Hide"/>
			<Setting Key1="%varRootDomainDN%" Substitution="varRootDomainDN" Display="Hide"/>
			<Setting Key1="%varConfigDN%" Substitution="varConfigDN" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varGroupingClass%" Substitution="varGroupingClass" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Destinations of Messages in the Queue" Text="Please wait while the tool checks the destinations of some messages in the queue." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<!-- This process uses WMI classes available with only E2K3 so can't be used against E2K. -->
				<!-- As LinkId and QueueId change quickly over time, we need to get those values and immediately use them in the subsequent WMI query-->
				<Object Type="Group" Name="%varGroupingClass%" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
						<Object Type="WMI" Key1="%varExName%" Key2="root\MicrosoftExchangeV2" Key3="Exchange_Queue" Key4="LinkName='%varProbLinkName%'" Key5="*">
							<Setting Key1="LinkId" Substitution="LINKID"/>
							<Setting Key1="QueueId" Substitution="QUEUEID"/>
							<Setting Key1="QueueName" Substitution="QUEUENAME"/>
							<Setting Key1="VirtualMachine" Substitution="VM"/>
							<Setting Key1="VirtualServerName" Substitution="VSINSTANCE"/>
							<Setting Key1="MessageCount"/>
							<Object Type="WMI" Key1="%varExName%" Key2="root\MicrosoftExchangeV2" Key3="Exchange_QueuedSMTPMessage" Key4="LinkId='%LINKID%' AND LinkName='%varProbLinkName%' AND ProtocolName='SMTP' AND QueueId='%QUEUEID%' AND QueueName='%QUEUENAME%' AND VirtualMachine='%VM%' AND VirtualServerName='%VSINSTANCE%'" Key5="*" Sort="Received DESC" Range="100">
								<Rule Name="iNumberofMessagesFound" Query="count(../Instance)"/>
								<Setting Key1="Recipients" Substitution="RECIPIENTS" Format="Envelope Recipients:\r\n----" SubstitutionFormat="^(.*?); $----$1"/>
								<Setting Key1="Received"/>
								<Setting Key1="MessageId" Substitution="MESSAGEID"/>
								<Setting Key1="StateRetry"/>
								<Object Type="Cache" Name="RecipientCache" Key1="Add" Key2="Recipients-%MESSAGEID%" Key3="%RECIPIENTS%" Key4=";" Display="Hide">
									<Setting Key1="Recipient" Substitution="RCPTADDRESS" Format="^.*:(.*?)$----$1"/>
									<!-- Now we look up the AD to see if these are users and get the homeMDB and homeServer values -->
									<Object Type="Directory" Key1="GC://%varDCName%" Key2="%varRootDomainDN%" Key3="(&amp;(objectCategory=user)(|(legacyExchangeDN=%RCPTADDRESS%)(proxyAddresses=smtp:%RCPTADDRESS%)))">
										<Setting Key1="distinguishedName" Substitution="RCPTDN"/>
										<Setting Key1="msExchHomeServerName" Substitution="RCPTHOMESERVER"/>
										<Setting Key1="homeMDB" Substitution="RCPTHOMEMDB"/>
										<Object Type="Cache" Name="RecipientDNCache" Key1="Add" Key2="RecipientDNList" Key3="%RCPTDN%" Display="Hide"/>
										<Object Type="Cache" Name="RecipientDNCache" Key1="Add" Key2="RecipientDNList-%MESSAGEID%" Key3="%RCPTDN%" Display="Hide">
											<Setting Key1="RecipientDN" Substitution="RECIPIENTCN" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
												<Rule Name="szRecipientCN" Query="'%RECIPIENTCN%'"/>
											</Setting>
										</Object>
										<Object Type="Cache" Name="HomeServerCache" Key1="Add" Key2="HomeServerList" Key3="%RCPTHOMESERVER%" Display="Hide"/>
										<Object Type="Cache" Name="HomeServerCache" Key1="Add" Key2="HomeServerList-%MESSAGEID%" Key3="%RCPTHOMESERVER%" Display="Hide">
											<Setting Key1="HomeServer" Substitution="HOMESERVER" SubstitutionFormat="^.*/cn=Configuration/cn=Servers/cn=(.*?[^\\])$----$1">
												<Rule Name="szHomeServer" Query="'%HOMESERVER%'"/>
											</Setting>
										</Object>
										<Object Type="Cache" Name="HomeMDBCache" Key1="Add" Key2="HomeMDBList" Key3="%RCPTHOMEMDB%" Display="Hide"/>
										<Object Type="Cache" Name="HomeMDBCache" Key1="Add" Key2="HomeMDBList-%MESSAGEID%" Key3="%RCPTHOMEMDB%" Display="Hide">
											<Setting Key1="HomeMDB" Substitution="HOMEMDB" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
												<Rule Name="szHomeMDB" Query="'%HOMEMDB%'"/>
											</Setting>
										</Object>
									</Object>
									<!-- Next, we check if these are DLs but not try to expand them to get recipients as these DLs may be nested -->
									<Object Type="Directory" Key1="GC://%varDCName%" Key2="%varRootDomainDN%" Key3="(&amp;(objectCategory=group)(|(legacyExchangeDN=%RCPTADDRESS%)(proxyAddresses=smtp:%RCPTADDRESS%)))">
										<Setting Key1="distinguishedName" Substitution="DLDN"/>
										<Object Type="Cache" Name="DLDNCache" Key1="Add" Key2="DLDNList" Key3="%DLDN%" Display="Hide"/>
										<Object Type="Cache" Name="DLDNCache" Key1="Add" Key2="DLDNList-%MESSAGEID%" Key3="%DLDN%" Display="Hide">
											<Setting Key1="RCPTDLList" Substitution="RCPTDL" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
												<Rule Name="szRCPTDL" Query="'%RCPTDL%'"/>
											</Setting>
										</Object>
									</Object>
									<!-- Let's check also public folders -->
									<Object Type="Directory" Key1="GC://%varDCName%" Key2="%varRootDomainDN%" Key3="(&amp;(objectCategory=publicFolder)(|(legacyExchangeDN=%RCPTADDRESS%)(proxyAddresses=smtp:%RCPTADDRESS%)))">
										<Setting Key1="distinguishedName" Substitution="PFDN"/>
										<Object Type="Cache" Name="PFDNCache" Key1="Add" Key2="PFDNList" Key3="%PFDN%" Display="Hide"/>
										<Object Type="Cache" Name="PFDNCache" Key1="Add" Key2="PFDNList-%MESSAGEID%" Key3="%PFDN%" Display="Hide">
											<Setting Key1="RCPTPFList" Substitution="RCPTPF" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
												<Rule Name="szRCPTPF" Query="'%RCPTPF%'"/>
											</Setting>
										</Object>
									</Object>
									<!-- Let's check also public folders stores -->
									<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%varExOrgDN%" Key3="(&amp;(objectCategory=msExchPublicMDB)(|(legacyExchangeDN=%RCPTADDRESS%)(proxyAddresses=smtp:%RCPTADDRESS%)))">
										<Setting Key1="distinguishedName" Substitution="PFSTOREDN"/>
										<Object Type="Cache" Name="PFStoreDNCache" Key1="Add" Key2="PFStoreDNList" Key3="%PFSTOREDN%" Display="Hide"/>
										<Object Type="Cache" Name="PFStoreDNCache" Key1="Add" Key2="PFStoreDNList-%MESSAGEID%" Key3="%PFSTOREDN%" Display="Hide">
											<Setting Key1="RCPTPFStoreList" Substitution="RCPTPFSTORE" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
												<Rule Name="szRCPTPFStore" Query="'%RCPTPFSTORE%'"/>
											</Setting>
										</Object>
									</Object>
								</Object>
							</Object>
							<!-- Finally, let's check if there are common recipients, servers, mailbox stores, DLs and PF from cache -->
							<Object Type="Cache" Name="RecipientDNCache" Key1="Dump" Key2="RecipientDNList" Display="Hide">
								<Setting Key1="RecipientDNList" Substitution="RCPTNAME" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
									<Rule Name="szCommonRecipientShortName" Query="'%RCPTNAME%'"/>
									<Rule Name="iRecipientAppears" Query="count($szRecipientCN[.='%RCPTNAME%'])"/>
									<Rule Name="fCommonRecipientError" Query="$iRecipientAppears &gt; ($iNumberofMessagesFound * 0.5)" Error="Error" Sev="3" ReportIssue="Issue" Title="User '{1}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to user '{1}'. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonRecipientShortName" S2="%varExName%" S4="%varProbLinkLongName%" S6="50" P8="$iNumberofMessagesFound" P9="$iRecipientAppears" GUID="3e333afd-7dc6-4f83-b696-66571a6ad5d1"/>
									<Rule Name="fCommonRecipientWarning" Query="not ($fCommonRecipientError) and $iRecipientAppears &gt; ($iNumberofMessagesFound * 0.25)" Error="Warning" Sev="2" Title="User '{1}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to user '{1}'. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonRecipientShortName" S2="%varExName%" S4="%varProbLinkLongName%" S6="25" P8="$iNumberofMessagesFound" P9="$iRecipientAppears" GUID="3e333afd-7dc6-4f83-b696-66571a6ad5d1"/>
								</Setting>
								<Rule Name="fCommonRecipientsDetected" Query="count($fCommonRecipientError) &gt;0 or count($fCommonRecipientWarning) &gt;0" AlwaysEvaluate="True"/>
							</Object>
							<Object Type="Cache" Name="HomeServerCache" Key1="Dump" Key2="HomeServerList" Display="Hide">
								<Setting Key1="HomeServerList" Substitution="SERVERSHORTNAME" SubstitutionFormat="^.*/cn=Configuration/cn=Servers/cn=(.*?[^\\])$----$1">
									<Rule Name="szCommonHomeServer" Query="$."/>
									<Rule Name="szCommonHomeServerShortName" Query="'%SERVERSHORTNAME%'"/>
									<Rule Name="iServerAppears" Query="count($szHomeServer[.='%SERVERSHORTNAME%'])"/>
									<Rule Name="fCommonServerError" Query="$iServerAppears &gt; ($iNumberofMessagesFound * 0.5)" Error="Error" Sev="3" ReportIssue="Issue" Title="Server {1} was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to server {1}. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonHomeServerShortName" S2="%varExName%" S4="%varProbLinkLongName%" S6="50" P8="$iNumberofMessagesFound" P9="$iServerAppears" GUID="d5a02814-ee16-4f0b-9f1c-f8d2a850c56f"/>
									<Rule Name="fCommonServerWarning" Query="not ($fCommonServerError) and $iServerAppears &gt; ($iNumberofMessagesFound * 0.25)" Error="Warning" Sev="2" Title="Server {1} was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to server {1}. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonHomeServerShortName" S2="%varExName%" S4="%varProbLinkLongName%" S6="25" P8="$iNumberofMessagesFound" P9="$iServerAppears" GUID="d5a02814-ee16-4f0b-9f1c-f8d2a850c56f"/>
								</Setting>
								<Rule Name="fCommonHomeServersDetected" Query="count($fCommonServerError) &gt;0 or count($fCommonServerWarning) &gt;0" AlwaysEvaluate="True"/>
							</Object>
							<Object Type="Cache" Name="HomeMDBCache" Key1="Dump" Key2="HomeMDBList" Display="Hide">
								<Setting Key1="HomeMDBList" Substitution="MDBSHORTNAME" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
									<Rule Name="szCommonHomeMDB" Query="$."/>
									<Rule Name="szCommonHomeMDBShortName" Query="'%MDBSHORTNAME%'"/>
									<Rule Name="iMDBAppears" Query="count($szHomeMDB[.='%MDBSHORTNAME%'])"/>
									<Rule Name="fCommonHomeMDBError" Query="$iMDBAppears &gt; ($iNumberofMessagesFound * 0.5)" Error="Error" Sev="3" ReportIssue="Issue" Title="Mailbox store '{1}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to the mailbox store '{3}'. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonHomeMDBShortName" S2="%varExName%" P3="$." S4="%varProbLinkLongName%" S6="50" P8="$iNumberofMessagesFound" P9="$iMDBAppears" GUID="cf94d85f-e93f-44b3-b942-52abd214a729"/>
									<Rule Name="fCommonHomeMDBWarning" Query="not ($fCommonHomeMDBError) and $iMDBAppears &gt; ($iNumberofMessagesFound * 0.25)" Error="Warning" Sev="2" Title="Mailbox store '{1}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to the mailbox store '{3}'. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonHomeMDBShortName" S2="%varExName%" P3="$." S4="%varProbLinkLongName%" S6="25" P8="$iNumberofMessagesFound" P9="$iMDBAppears" GUID="cf94d85f-e93f-44b3-b942-52abd214a729"/>
								</Setting>
								<Rule Name="fCommonHomeMDBsDetected" Query="count($fCommonHomeMDBError) &gt;0 or count($fCommonHomeMDBWarning) &gt;0" AlwaysEvaluate="True"/>
							</Object>
							<Object Type="Cache" Name="DLDNCache" Key1="Dump" Key2="DLDNList" Display="Hide">
								<Setting Key1="DLDNList" Substitution="DLSHORTNAME" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
									<Rule Name="szCommonDL" Query="$."/>
									<Rule Name="szCommonDLShortName" Query="'%DLSHORTNAME%'"/>
									<Rule Name="iDLAppears" Query="count($szRCPTDL[.='%DLSHORTNAME%'])"/>
									<Rule Name="fCommonDLError" Query="$iDLAppears &gt; ($iNumberofMessagesFound * 0.5)" Error="Error" Sev="3" ReportIssue="Issue" Title="Distribution group '{3}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to distribution group '{3}'. The number of such messages is {9} among the {8} samples investigated." S2="%varExName%" P3="$szCommonDLShortName" S4="%varProbLinkLongName%" S6="50" P8="$iNumberofMessagesFound" P9="$iDLAppears" GUID="8ade3401-2f64-4520-a59c-bb0272886c1c"/>
									<Rule Name="fCommonDLWarning" Query="not ($fCommonDLError) and $iDLAppears &gt; ($iNumberofMessagesFound * 0.25)" Error="Warning" Sev="2" Title="Distribution group '{3}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to distribution group '{3}'. The number of such messages is {9} among the {8} samples investigated." S2="%varExName%" P3="$szCommonDLShortName" S4="%varProbLinkLongName%" S6="25" P8="$iNumberofMessagesFound" P9="$iDLAppears" GUID="8ade3401-2f64-4520-a59c-bb0272886c1c"/>
								</Setting>
								<!-- For distribution group, we check whether global distribution groups are used in a multi-domain forest -->
								<Setting Key1="DLDistinguishedName" Substitution="RCPTGROUPDN"/>
								<Object Type="Directory" Key1="GC://%varDCName%" Key2="%RCPTGROUPDN%">
									<Setting Key1="groupType">
										<Rule Name="fGlobalGroupUsedMultiDomains" Query="bitwise-and($.,2)!=0 and count($szDomainDN) &gt;1" Error="Warning" Sev="1" Title="Global distribution group used in multi-domain forest" Text="The '{4}' queue on server {2} has messages addressed to global distribution group '{3}', while the topology appears to be a multi-domain forest. Messages may not be delivered correctly to its members. Follow Microsoft Knowledge Base article 271930 and consider using universal distribution groups instead." S2="%varExName%" S3="%DLSHORTNAME%" S4="%varProbLinkLongName%" GUID="304abc5e-8470-46cd-98e8-6ed501e1c753"/>
									</Setting>
								</Object>
								<Rule Name="fCommonDLsDetected" Query="count($fCommonDLError) &gt;0 or count($fCommonDLWarning) &gt;0" AlwaysEvaluate="True"/>
							</Object>
							<Object Type="Cache" Name="PFDNCache" Key1="Dump" Key2="PFDNList" Display="Hide">
								<Setting Key1="PFDNList" Substitution="PFSHORTNAME" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
									<Rule Name="szCommonPF" Query="$."/>
									<Rule Name="szCommonPFShortName" Query="'%PFSHORTNAME%'"/>
									<Rule Name="iPFAppears" Query="count($szRCPTPF[.='%PFSHORTNAME%'])"/>
									<Rule Name="fCommonPFError" Query="$iPFAppears &gt; ($iNumberofMessagesFound * 0.5)" Error="Error" Sev="3" ReportIssue="Issue" Title="Public folder '{1}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to the public folder '{3}'. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonPFShortName" S2="%varExName%" P3="$." S4="%varProbLinkLongName%" S6="50" P8="$iNumberofMessagesFound" P9="$iPFAppears" GUID="f8f4af4f-608c-431c-aa04-2f508972c111"/>
									<Rule Name="fCommonPFWarning" Query="not ($fCommonPFError) and $iPFAppears &gt; ($iNumberofMessagesFound * 0.25)" Error="Warning" Sev="2" Title="Public folder '{1}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to the public folder '{3}'. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonPFShortName" S2="%varExName%" P3="$." S4="%varProbLinkLongName%" S6="25" P8="$iNumberofMessagesFound" P9="$iPFAppears" GUID="f8f4af4f-608c-431c-aa04-2f508972c111"/>
								</Setting>
								<Rule Name="fCommonPFsDetected" Query="count($fCommonPFError) &gt;0 or count($fCommonPFWarning) &gt;0" AlwaysEvaluate="True"/>
							</Object>
							<Object Type="Cache" Name="PFStoreDNCache" Key1="Dump" Key2="PFStoreDNList" Display="Hide">
								<Setting Key1="PFStoreDNList" Substitution="PFSTORESHORTNAME" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1">
									<Rule Name="szCommonPFStore" Query="$."/>
									<Rule Name="szCommonPFStoreShortName" Query="'%PFSTORESHORTNAME%'"/>
									<Rule Name="iPFStoreAppears" Query="count($szRCPTPFStore[.='%PFSTORESHORTNAME%'])"/>
									<Rule Name="fCommonPFStoreError" Query="$iPFStoreAppears &gt; ($iNumberofMessagesFound * 0.5)" Error="Error" Sev="3" ReportIssue="Issue" Title="Public folder store '{1}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to the public folder store '{3}'. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonPFStoreShortName" S2="%varExName%" P3="$." S4="%varProbLinkLongName%" S6="50" P8="$iNumberofMessagesFound" P9="$iPFStoreAppears" GUID="ef5fd507-6800-4ecb-8ceb-ef3ce09ce25f"/>
									<Rule Name="fCommonPFStoreWarning" Query="not ($fCommonPFStoreError) and $iPFStoreAppears &gt; ($iNumberofMessagesFound * 0.25)" Error="Warning" Sev="2" Title="Public folder store '{1}' was identified as a common destination" Text="More than {6}% of the messages in the '{4}' queue on server {2} appear to be addressed to the public folder store '{3}'. The number of such messages is {9} among the {8} samples investigated." P1="$szCommonPFStoreShortName" S2="%varExName%" P3="$." S4="%varProbLinkLongName%" S6="25" P8="$iNumberofMessagesFound" P9="$iPFStoreAppears" GUID="ef5fd507-6800-4ecb-8ceb-ef3ce09ce25f"/>
								</Setting>
								<Rule Name="fCommonPFStoresDetected" Query="count($fCommonPFStoreError) &gt;0 or count($fCommonPFStoreWarning) &gt;0" AlwaysEvaluate="True"/>
							</Object>
							<!-- Let's check if this topology is a multi-domain forest. -->
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Partitions,%varConfigDN%" Key3="systemFlags=3" Key4="OneLevel">
								<Setting Key1="nCName">
									<Rule Name="szDomainDN" Query="$."/>
								</Setting>
							</Object>
						</Object>
					</Object>

					<Rule Name="szRecipientCheck" Query="'RecipientCheck'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fRecipientPossibleIssueFound, string(@Title), $szExNoErrorStateText)" Title="As many of the queued messages share the same destinations, the tool will focus on the destinations that occurred frequently in the queue." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="As there are many destinations in the queued messages, the tool will not focus on a particular destination."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Recipient Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="szAllCommonHomeServer" Query="join(';', $szCommonHomeServer)">
						<Variable Name="varAllCommonHomeServer" Scope="Global"/>
					</Rule>
					<Rule Name="szAllCommonHomeMDB" Query="join(';', $szCommonHomeMDB)">
						<Variable Name="varAllCommonHomeMDB" Scope="Global"/>
					</Rule>
					<Rule Name="szAllCommonDL" Query="join(',', $szCommonDL)">
						<Variable Name="varAllCommonDL" Scope="Global"/>
					</Rule>

					<Rule Name="fRecipientPossibleIssueFound" Query="$fCommonRecipientsDetected or $fCommonHomeServersDetected or $fCommonHomeMDBsDetected or $fCommonDLsDetected or $fCommonPFsDetected or $fCommonPFStoresDetected" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayRecipientAnalysisStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MADLHighCPUCheck" Title="Check CPU Usage of Exchange" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varRemoteDeliveryBackedUp%" Substitution="varRemoteDeliveryBackedUp" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking CPU Usage" Text="Please wait while the tool checks for high CPU usage on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<!-- Let's check if CPU usage spikes for Store or Inetinfo -->
				<Object Type="Group" Name="CPU Usage" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<!-- First, need number of CPU -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_ComputerSystem" SecurityContext="EXLOGON">
							<Setting Key1="NumberOfProcessors">
								<Rule Name="iActualProcs" Query="$." Error="None" Title="Number of processors" Text="This server has {9} processor(s) installed." P9="$."/>
								<Rule Name="fActualProcsOver8" Query="$. &gt; 8" Error="Warning" Sev="3" Title="Processor configuration" Text="More than 8 processors were detected for the Exchange server {2}. If this server has more than 8 physical processors installed, additional configuration tuning may be required. If this server is using hyper-threading technology, no action is required. There were {9} CPUs detected." S2="%varExName%" P9="$." GUID="a59de247-8f05-419d-a4ea-fc4973788863"/>
							</Setting>
						</Object>

						<!-- Now take perfmon of CPU related counters -->
						<Object Type="Pdh" Name="StoreInetinfoCPUUsage" Key1="%varExName%" Key2="15" Key3="1" Level="1" SecurityContext="EXLOGON">
							<Setting Key1="Processor" Key2="% Processor Time" Key3="_Total">
								<Rule Name="iProcessorProcessorTimeTotalMax" Query="round(10* list-max($.))div 10" Error="None" Title="Maximum '{0}'" Text="Maximum '{0}' = {9}." P0="localize-path('Processor(_Total)\% Processor Time')" P9="round(10* list-max($.)) div 10"/>
								<Rule Name="iProcessorPercentProcessorTimeTotalAvg" Query="round(100*list-average($.)) div 100" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9}." P0="localize-path('Processor(_Total)\% Processor Time')" P9="round(10*list-average($.)) div 10"/>
							</Setting>
							<Setting Key1="System" Key2="Processor Queue Length" Key3="">
								<Rule Name="iSystemProcessorQueueLength" Query="if(starts-with($.,',,'),0,round(10*list-average($.) div $iActualProcs) div 10)" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9}." P0="localize-path('System\Processor Queue Length')" P9="if(starts-with($.,',,'),0,round(10*list-average($.) div $iActualProcs) div 10)"/>
								<Rule Name="fQueueLength2" Query="$iSystemProcessorQueueLength &gt;2" Error="Warning" Sev="2" Title="Processor queue performance issue" Text="The '{0}' should be less than {8}. The measured value is {9}. This indicates the server has a processor bottleneck." P0="localize-path('System\Processor Queue Length')" S8="2" P9="$iSystemProcessorQueueLength" GUID="27cf9861-3bb1-42db-9dbc-ba07748c1af7"/>
							</Setting>
							<Setting Key1="Process" Key2="% Processor Time" Key3="store">
								<Rule Name="iProcessStoreProcessorTime" Query="if(starts-with($.,',,'),0,round(10*list-average($.) div $iActualProcs) div 10)" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9}." P0="localize-path('Process(store)\% Processor Time')" P9="if(starts-with($.,',,'),0,round(10*list-average($.) div $iActualProcs) div 10)"/>
								<Rule Name="fStoreHighCPU" Query="$iProcessStoreProcessorTime &gt;90" Error="Error" Sev="1" ReportIssue="Issue" Title="Store process CPU performance issue" Text="'{0}' is more than {8}%. This may result in mail delays. Actual measured processor usage: {9}%." P0="localize-path('Process(store)\% Processor Time')" S8="90" P9="$iProcessStoreProcessorTime" GUID="27cf9861-3bb1-42db-9dbc-ba07748c1af7"/>
							</Setting>
							<Setting Key1="Process" Key2="% Processor Time" Key3="inetinfo">
								<Rule Name="iProcessInetinfoProcessorTime" Query="if(starts-with($.,',,'),0,round(10*list-average($.) div $iActualProcs) div 10)" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9}." P0="localize-path('Process(inetinfo)\% Processor Time')" P9="if(starts-with($.,',,'),0,round(10*list-average($.) div $iActualProcs) div 10)"/>
								<Rule Name="fInetinfoHighCPU" Query="$iProcessInetinfoProcessorTime &gt;50" Error="Error" Sev="1" ReportIssue="Issue" Title="Inetinfo process processor performance issue" Text="'{0}' is more than {8}%. This may result in mail delays. Actual measured processor usage: {9}%." P0="localize-path('Process(inetinfo)\% Processor Time')" S8="50" P9="$iProcessInetinfoProcessorTime" GUID="27cf9861-3bb1-42db-9dbc-ba07748c1af7"/>
								<Rule Name="fStoreInetinfoHighCPU" Query="($iProcessStoreProcessorTime + $iProcessInetinfoProcessorTime) &gt;90" Error="Error" Sev="1" ReportIssue="Issue" Title="Store and Inetinfo processes CPU performance issue" Text="The combined processor time spent in the store.exe and inetinfo.exe is more than {8}%. This may result in mail delays. Actual combined processor usage: {9}%." S8="90" P9="$iProcessStoreProcessorTime + $iProcessInetinfoProcessorTime" GUID="27cf9861-3bb1-42db-9dbc-ba07748c1af7"/>
							</Setting>
						</Object>
					</Object>

					<Rule Name="szMADLHighCPUCheck" Query="'MADLHighCPUCheck'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fMADLCPUIssueFound, string(@Title), $szExNoErrorStateText)" Title="A CPU performance issue that may be related to mail flow was found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No critical CPU issues were found."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="CPU Usage Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="fMADLCPUIssueFound" Query="$fStoreHighCPU or $fInetinfoHighCPU or $fStoreInetinfoHighCPU" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckQueueStatusStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckCPUKnownIssue" Name="fGotoCheckCPUKnownIssue" Query="$fMADLCPUIssueFound" Priority="2" Text="- Check whether known issues are causing high CPU usage" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="MADLDLCheck" Name="fGotoMADLDLCheck" Query="true()" Priority="3" Text="- Check if distribution group expansions are related to the mail flow issue" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckRegtrace" Name="fGotoCheckRegtrace" Query="true()" Priority="4" Text="- Check whether regtrace is left enabled" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckAV" Name="fGotoCheckAV" Query="true()" Priority="5" Text="- Check antivirus settings that may have impacts on mail flows" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckLinkState" Name="fGotoCheckLinkState" Query="@S1!='1'" Priority="6" Text="- Check link state information for possible routing issues" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckMetabase" Name="fGotoCheckMetabase" Query="@S1!='1'" Priority="6" Text="- Check the SMTP event sink settings in metabase" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckSMTPDisk" Name="fGotoCheckSMTPDisk" Query="true()" Priority="7" Text="- Check the performance of disks used by the SMTP instance" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckDCGCAvailability" Name="fGotoCheckDCGCAvailability" Query="true()" Priority="8" Text="- Check Active Directory availability" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckDNSAvailability" Name="fGotoCheckDNSAvailability" Query="@S1!='1'" Priority="9" Text="- Check DNS availability" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckDomainRouting" Name="fGotoCheckDomainRouting" Query="@S1!='1'" Priority="10" Text="- Check the domain routing information stored in recipient policies, connectors and the metabase" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckLinkStateChurn" Name="fGotoCheckLinkStateChurn" Query="@S1!='1'" Priority="11" Text="- Check link state version changes" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckCPUKnownIssue" Title="Check Known CPU Issues" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varConfigDN%" Substitution="varConfigDN" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Possible Causes of High CPU" Text="Please wait while the tool checks for possible clues of the high CPU usage on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="CPU Usage" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" SecurityContext="EXLOGON">
						<!-- First, check KB899019 -->
						<Object Type="Registry" Key1="%varExNAME%" Key3="Software\Microsoft\Windows NT\CurrentVersion">
							<Setting Key1="SystemRoot" Substitution="WINSYSPATH" SubstitutionFormat="\\----\\"/>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%WINSYSPATH%\\system32\\wldap32.dll'">
								<Setting Key1="Version">
									<Rule Name="fWLDAP32Lower" Query="starts-with($.,'5.0.2195') and substring($., 10, 4) &lt; 7044" Error="Warning" Sev="2" Title="Newer {5} available" Text="The version of {5} installed on server {2} may cause the Inetinfo process to use 100% of CPU when Active Directory queries return large data sets. Installed version of {5}: {6}." S2="%varExName%" S5="WLDAP32.DLL" P6="$." GUID="cb0e6487-c4d4-480b-9589-1ecf20a390f8"/>
								</Setting>
							</Object>
						</Object>
						<!-- Second, check KB811409 -->
						<Object Type="Registry" Key1="%varExName%" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\Setup">
							<Setting Key1="Services" Substitution="EXCHBINPATHD" SubstitutionFormat="\\----\\"/>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\msgtrack.dll'">
								<Setting Key1="Version">
									<Rule Name="fMsgtrackLower" Query="substring($., 5, 4) &lt; 6373" Error="Warning" Sev="2" Title="Newer {5} available" Text="The version of {5} installed on server {2} may cause high CPU utilization for the Inetinfo process when message tracking is enabled. Update to the latest roll-up is highly recommended. Installed version of {5}: {6}" S2="%varExName%" S5="MSGTRACK.DLL" P6="$." GUID="acbdfd3a-8496-40e7-aac6-f815e42916e6"/>
								</Setting>
							</Object>
						</Object>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MADLDLCheck" Title="Check Distribution Group Expansions" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varConfigDN%" Substitution="varConfigDN" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varRootDomainDN%" Substitution="varRootDomainDN" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varIsExchange2003SP2%" Substitution="varIsExchange2003SP2" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Distribution Group Expansions" Text="Please wait while the tool checks whether there are distribution group expansion problems at server {2}. This may take a while depending on the size of event logs." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Distribution Group Expansion" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="If" Name="%varExName%" Key1="true()" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Get the the datetime of exactly 24 hours ago in the yyyyMMddHHmmss.000000+000 format as this format is faster for a WMI query -->
						<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
						<!-- Let's look if the app event log contains any events 6004, 6006 or 6008 as they are the signs of distribution group expansion problems -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=6004 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt6004WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A categorizer warning event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="6004" GUID="e58485d9-20d6-4798-8f53-ebc55fcfd474"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=6006 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt6006WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A categorizer warning event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="6006" GUID="bcecd9f8-0146-417c-bc45-9b2323e02aa6"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=6008 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt6008WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A categorizer warning event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="6008" GUID="9fc380f3-3361-4a9a-b45a-9d38ce229e66"/>
							</Setting>
						</Object>
						<!-- Check if there are mailboxes with delivery restrictions set -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Partitions,%varConfigDN%" Key3="systemFlags=3" Key4="OneLevel" Async="100" MaxTime="ALL,5">
							<Setting Key1="nCName" Substitution="DOMAINDN"/>
							<Setting Key1="dnsRoot">
								<Rule Name="szDomainFQDN" Query="$."/>
							</Setting>
							<Object Type="Directory" Key1="GC://%varDCName%" Key2="%DOMAINDN%" Key3="(&amp;(objectCategory=user)(|(dLMemDefault=*)(dLMemRejectPerms=*)(dLMemSubmitPerms=*)))" Key4="Subtree" Count="*">
								<Rule Name="iRestrictedMbx" Query="number(../Instance/Setting/Value)"/>
								<Rule Name="fRestrictedMbxFound" Query="$iRestrictedMbx &gt;0" Error="Warning" Sev="2" Title="Mailboxes with distribution group delivery restrictions set" Text="Active Directory domain {3} contains {9} mailbox(es) with delivery restrictions based on distribution group membership." P3="$szDomainFQDN" P9="$iRestrictedMbx" GUID="77eb0e46-3e36-4a3b-a707-69f55823a574"/>
							</Object>
							<Rule Name="fTotalRestrictedMbxOver500" Query="sum($iRestrictedMbx) &gt;500" Error="Error" Sev="2" ReportIssue="Issue" Title="Large number of mailboxes with distribution group delivery restrictions set" Text="More than 500 mailboxes in the entire forest have delivery restrictions set where at least one distribution group is used either to permit or prohibit senders. Please ensure that there are no nested distribution groups including these mailboxes. Number of those mailboxes: {9}." P9="sum($iRestrictedMbx)" GUID="93e1d806-d034-49c6-b37f-808bde794122"/>
						</Object>
						<!-- Check if the CheckConnectorRestrictions reg key is set -->
						<Object Type="Registry" Key1="%varExName%" Key3="System\CurrentControlSet\Services\RESvc\Parameters">
							<Setting Key1="CheckConnectorRestrictions">
								<Rule Name="fCheckConnectorRestrictions" Query="$.=1"/>
							</Setting>
						</Object>
						<!-- Check if there are routing group connectors with delivery restrictions set -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectClass=msExchRoutingGroupConnector)(|(dLMemRejectPerms=*)(dLMemSubmitPerms=*)))">
							<Setting Key1="cn">
								<Rule Name="iRestrictedRGC" Query="count($.)"/>
								<Rule Name="szRGCName" Query="$."/>
								<Rule Name="fRestrictedRGCFound" Query="string-length($.) &gt;0 and not ($fRestrictedRGCOnEx)" Error="Warning" Sev="3" Title="Routing group connector with distribution group delivery restrictions set" Text="Routing group connector {3} for routing group {1} has delivery restrictions based on distribution group membership." P1="$szRoutingGroupName" P3="$szRGCName" GUID="ed96b53e-ee62-4261-8348-ed5ed379b37b"/>
								<Rule Name="fRestrictedRGCOnEx" Query="$fCheckConnectorRestrictions and ($fRGCBHIncluded or (count($szRGCBH) = 0 and $fRGIncluded))" Error="Warning" Sev="1" Title="Bridgehead server to check distribution group delivery restrictions" Text="Routing group connector {3} for routing group {1} has delivery restrictions based on distribution group membership and server {2} is a bridgehead server with connector restriction checking enabled. This may cause messages to queue unless restrictions are properly configured." P1="$szRoutingGroupName" S2="%varExName%" P3="$szRGCName" GUID="8a2a7ed1-a8b3-440a-901f-2480e17d2019" AlwaysEvaluate="True"/>
							</Setting>
							<Setting Key1="distinguishedName" Substitution="ROUTINGGROUP" SubstitutionFormat="^CN=.*?,CN=.*?,CN=(.*?[^\\]),.*$----$1">
								<Rule Name="szRoutingGroupName" Query="substring-before(substring-after(upper-case($.),'CN=CONNECTIONS,CN='),',')"/>
							</Setting>
							<Setting Key1="msExchSourceBridgeheadServersDN" Substitution="RGCBH" SubstitutionFormat="^CN=.*?,CN=.*?,CN=.*?,CN=(.*?[^\\]),.*$----$1;">
								<Rule Name="fRGCBHIncluded" Query="contains (upper-case('%RGCBH%'), upper-case(@S2))" S2="%varExName%"/>
								<Rule Name="szRGCBH" Query="upper-case('%RGCBH%')"/>
							</Setting>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectClass=msExchRoutingGroup)(cn=%ROUTINGGROUP%))">
								<Setting Key1="msExchRoutingGroupMembersBL" Substitution="RGMEMBER" SubstitutionFormat="^CN=(.*?[^\\]),.*$----$1;">
									<Rule Name="fRGIncluded" Query="contains (upper-case('%RGMEMBER%'), upper-case(@S2))" S2="%varExName%"/>
								</Setting>
							</Object>
						</Object>
						<!-- Check if there are SMTP connectors with delivery restrictions set -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectClass=msExchRoutingSMTPConnector)(|(dLMemRejectPerms=*)(dLMemSubmitPerms=*)))">
							<Setting Key1="cn">
								<Rule Name="iRestrictedSMTPConnector" Query="count($.)"/>
								<Rule Name="szSMTPConnectorName" Query="$."/>
								<Rule Name="fRestrictedSMTPConnectorFound" Query="string-length($.) &gt;0 and not ($fSMTPConnectorBHIncluded)" Error="Warning" Sev="3" Title="SMTP connector with distribution group delivery restrictions set" Text="SMTP connector {3} has delivery restrictions based on distribution group membership." P3="$szSMTPConnectorName" GUID="46959b8e-5443-4588-9c7a-47b49eb85d72"/>
							</Setting>
							<Setting Key1="msExchSourceBridgeheadServersDN" Substitution="SMTPCONNECTORBH" SubstitutionFormat="^CN=.*?,CN=.*?,CN=.*?,CN=(.*?[^\\]),.*$----$1;">
								<Rule Name="fSMTPConnectorBHIncluded" Query="$fCheckConnectorRestrictions and contains (upper-case('%SMTPCONNECTORBH%'), upper-case(@S2))" Error="Warning" Sev="1" Title="Bridgehead server to check distribution group delivery restrictions" Text="SMTP connector {3} has delivery restrictions based on distribution group membership and server {2} is a bridgehead server with connector restriction checking enabled. This may cause messages to queue unless restrictions are properly configured." S2="%varExName%" P3="$szSMTPConnectorName" GUID="8ec33d06-9ca5-46b3-b89f-d7b7869fccc3"/>
							</Setting>
						</Object>
						<!-- Check if there are nested distribution groups used for delivery restrictions -->
						<Object Type="Directory" Key1="GC://%varDCName%" Key2="%varRootDomainDN%" Key3="(&amp;(objectClass=group)(|(dLMemRejectPermsBL=*)(dLMemSubmitPermsBL=*)))" Key4="Subtree">
							<Setting Key1="cn">
								<Rule Name="szDLCN" Query="$."/>
							</Setting>
							<Setting Key1="distinguishedName" Substitution="RESTDLDN"/>
							<Object Type="Directory" Key1="GC://%varDCName%" Key2="%varRootDomainDN%" Key3="(&amp;(objectClass=group)(memberOf=%RESTDLDN%))" Key4="Subtree" Count="*">
								<Rule Name="iNestingDL" Query="number(../Instance/Setting/Value)"/>
								<Rule Name="fNestedDLWithoutFlatChecking" Query="not($fRestrictionMethodFlat) and $iNestingDL &gt;0" Error="Error" Sev="2" ReportIssue="Issue" Title="Nested distribution group found in delivery restrictions" Text="There are mailboxes or connectors with delivery restrictions set based on the membership of distribution group '{3}' and it appears to contain other distribution groups as its members. This configuration may cause performance issues when expanding membership to check restrictions." P3="$szDLCN" GUID="ea55e130-f0ac-49f4-b50d-506292d43196" AlwaysEvaluate="True"/>
								<Rule Name="fNestedDLWithFlatChecking" Query="$fRestrictionMethodFlat and $iNestingDL &gt;0" Error="Warning" Sev="2" Title="Nested distribution group found but flat restriction checking enabled" Text="There are mailboxes or connectors with delivery restrictions set based on the membership of distribution group '{3}' and it appears to contain other distribution groups as its members. However, the Exchange transport on server {2} will not expand membership of distribution groups when checking restrictions. The restriction check may not work correctly." S2="%varExName%" P3="$szDLCN" GUID="2cd87e46-4264-4778-b13b-7b449e8833e8" AlwaysEvaluate="True"/>
							</Object>
						</Object>
						<!-- Check if this is a TiSP2 server with RestrictionMethod set -->
						<Object Type="Registry" Key1="%varExName%" Key3="SYSTEM\CurrentControlSet\Services\MSExchangeTransport\Parameters">
							<Setting Key1="RestrictionMethod">
								<Rule Name="fRestrictionMethodFlat" Query="$.=2 and @S1='1'" Error="None" Title="Flat restriction checking" Text="The Exchange transport on server {2} will not expand membership of distribution groups when checking restrictions. This configuration provides the best performance for restriction checks." S1="%varIsExchange2003SP2%" S2="%varExName%"/>
							</Setting>
						</Object>

						<Rule Name="szMADLDLCheck" Query="'MADLDLCheck'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fMADLDLIssueFound, string(@Title), $szExNoErrorStateText)" Title="Distribution group expansion issues that may be related to mail flows were found." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No critical distribution group issues were found."/>
						<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Distribution Group Expansion Analysis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fMADLDLIssueFound" Query="not ($fRestrictionMethodFlat) and ($fEvt6004WithinLast24hours and $fEvt6006WithinLast24hours and $fEvt6008WithinLast24hours) and ($fTotalRestrictedMbxOver500 or $fRestrictedRGCOnEx or $fSMTPConnectorBHIncluded or $fNestedDLWithoutFlatChecking)" Error="Error" Sev="2" ReportIssue="RootCause" Title="Potential distribution group expansions issues" Text="The tool has determined that distribution group expansion problems may be causing the 'Messages awaiting directory lookup' queue issue at server {2}." S2="%varExName%" GUID="e874dfc7-93e7-4814-b7e4-b38e080283e1" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckQueueStatusStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckRegtrace" Title="Check Regtrace" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Regtrace" Text="Please wait while the tool checks if Regtrace is running on {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Regtrace" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<Object Type="Registry" Key1="%varExName%" Key3="Software\Microsoft\MosTrace\CurrentVersion\DebugAsyncTrace" SecurityContext="EXLOGON">
							<Setting Key1="EnabledTraces">
								<Rule Name="fRegtraceLeftEnabled" Query="$.!=0" Error="Error" Sev="2" ReportIssue="Issue" Title="Regtrace is enabled" Text="Regtrace is currently enabled on server {2}. This should be enabled only when troubleshooting problems. Leaving tracing enabled can cause performance problems." S2="%varExName%" GUID="90b3eb47-ad77-4ae4-87b0-8d8ac5b575fb"/>
							</Setting>
						</Object>

						<Rule Name="szCheckRegtrace" Query="'CheckRegtrace'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fRegtraceLeftEnabled, string(@Title), $szExNoErrorStateText)" Title="A potential issue with Regtrace was identified." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No issue with Regtrace was identified."/>
						<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Regtrace Check Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckQueueStatusStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckAV" Title="Check Antivirus Versions" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Version of Antivirus Programs" Text="Please wait while the tool checks the version of antivirus programs running on server {2} for any known issues." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Third Party Software" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<!-- First let's check if Trend ScanMail 6.2 is running and it needs update -->
						<Object Type="Registry" Key1="%varExName%" Key3="System\CurrentControlSet\Services\MSExchangeIS\VirusScan" SecurityContext="EXLOGON">
							<Setting Key1="Library" Substitution="VSAPIDLL" SubstitutionFormat="\\----\\">
								<Rule Name="szVSAPILibrary" Query="upper-case($.)"/>
							</Setting>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%VSAPIDLL%'">
								<Setting Key1="Version">
									<Rule Name="fTrendScanMail62NeedsUpdate" Query="contains($szVSAPILibrary, 'SMXS3DLL.DLL') and substring($.,7,4) &lt;1174" Error="Warning" Sev="1" Title="Trend Micro ScanMail update available" Text="Trend Micro ScanMail is installed on server {2} and a software update is available. This update is highly recommended and can improve overall performance and reliability of the server. Current {5} version: {6}." S2="%varExName%" S5="SMXS3DLL.DLL" P6="$." GUID="dbf6950a-896b-4a92-a2be-815994af04a1"/>
								</Setting>
							</Object>
						</Object>

						<Rule Name="szCheckAV" Query="'CheckAV'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fAVIssueFound, string(@Title), $szExNoErrorStateText)" Title="An older version of antivirus software was detected." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No older version of antivirus software was detected."/>
						<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Antivirus Program Version Check Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fAVIssueFound" Query="$fTrendScanMail62NeedsUpdate" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayAVCheckStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckMetabase" Title="Check Metabase" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstance%" Substitution="varAllSMTPInstance" Display="Hide"/>
			<Setting Key1="%varIsExchange2000or2003%" Substitution="varIsExchange2000or2003" Display="Hide"/>
			<Setting Key1="%varIsExchange2000%" Substitution="varIsExchange2000" Display="Hide"/>
			<Setting Key1="%varIsExchange2003%" Substitution="varIsExchange2003" Display="Hide"/>
			<Setting Key1="%varIsExchange2003SP2%" Substitution="varIsExchange2003SP2" Display="Hide"/>
			<Setting Key1="%varClusterServiceRunning%" Substitution="varClusterServiceRunning" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Metabase Settings" Text="Please wait while the tool checks the SMTP-related metabase settings of server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Metabase" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<Object Type="If" Name="Metabase Check" Key1="true()">
							<!-- Prepare substitutions and rules for ExBPA.Transport.xml -->
							<Setting Key1="'%varExName%'" Substitution="SRVNAME">
								<Rule Name="fExchange200x" Query="'%varIsExchange2000or2003%'='1'"/>
								<Rule Name="fExchange2000" Query="'%varIsExchange2000%'='1'"/>
								<Rule Name="fExchange2003" Query="'%varIsExchange2003%'='1'"/>
								<Rule Name="fExchange2003SP2" Query="'%varIsExchange2003SP2%'='1'"/>
								<Rule Name="fClusterServiceRunning" Query="'%varClusterServiceRunning%'='1'"/>
								<Rule Name="szExchangeServerName" Query="'%varExName%'"/>
							</Setting>
							<Object Type="Variable" Name="SMTP Instances" Key1="Unpack" Key2="%varAllSMTPInstance%">
								<Setting Key1="__VALUE" Substitution="SMTPINSTANCE"/>

								<!-- // Call Metabase-Domain type to enumerate SMTP domain information -->
								<Reference Type="Metabase-Domain" Name="MetabaseDomain" File="ExBPA.Transport.xml"/>
								<!-- // Call Metabase-Sinks type to perform transport event sink checks -->
								<Reference Type="Metabase-Sinks" Name="MetabaseSinks" File="ExBPA.Transport.xml"/>
								<!-- // Call Metabase-RoutingSources type to perform categegorize checks -->
								<Reference Type="Metabase-RoutingSources" Name="MetabaseRoutingSources" File="ExBPA.Transport.xml"/>

							</Object>

							<Rule Name="szCheckMetabase" Query="'CheckMetabase'">
								<Variable Name="varPreviousName" Scope="Children"/>
							</Rule>
							<Rule Name="szExErrorStateText" Query="if($fMetabaseIssueFound, string(@Title), $szExNoErrorStateText)" Title="A potential issue with the metabase was identified." AlwaysEvaluate="True">
								<Variable Name="varErrorStateText" Scope="Global"/>
							</Rule>
							<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No issue with the metabase was identified."/>
							<Rule Name="szCheckMetabaseResult" Query="string(@Title)" Title="Metabase Check Results">
								<Variable Name="varDisplayTitle" Scope="Global"/>
							</Rule>
							<Rule Name="fExchangeSinkFound1" Query="not($MetabaseSinks_fSinkMissingCustomExchangeDSNSink or $MetabaseSinks_fSinkMissingEHLOinboundcommandhandlersinkforXLSA or $MetabaseSinks_fSinkMissingEHLOresponsehandlersinkforXLSA or $MetabaseSinks_fSinkMissingEODinboundcommandhandlersink or $MetabaseSinks_fSinkMissingExchangeCategorizer or $MetabaseSinks_fSinkMissingExchangeLoadBalancer or $MetabaseSinks_fSinkMissingExchangeNtfsStoreDriver or $MetabaseSinks_fSinkMissingExchangeRouter or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolLoggingSink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolSecurityEhloSink)" AlwaysEvaluate="True"/>
							<Rule Name="fExchangeSinkFound2" Query="not($MetabaseSinks_fSinkMissingExchangeSMTPProtocolSecurityEXPSSink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolSecurityEXPSAuxSink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolSecurityEXPSEODSink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolSecurityMailSink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50BeforeDataSink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50EhloResponseSink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50EODSink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50InboundEhloSink)" AlwaysEvaluate="True"/>
							<Rule Name="fExchangeSinkFound3" Query="not($MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50InboundMAILsink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50InboundRCPTsink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50InboundXEXCH50Sink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50perrecipienteventsink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50RCPTResponsesink or $MetabaseSinks_fSinkMissingExchangeSMTPProtocolXEXCH50ResponseSink or $MetabaseSinks_fSinkMissingExchangeStoreDriver or $MetabaseSinks_fSinkMissingExchangeTransportAntiVirusAPI)" AlwaysEvaluate="True"/>
							<Rule Name="fExchangeSinkFound4" Query="not($MetabaseSinks_fSinkMissingExchangeTransportXEXCH50Submissionsink or $MetabaseSinks_fSinkMissingMAILinboundcommandhandlersinkforTURF or $MetabaseSinks_fSinkMissingMobileCategorizer or $MetabaseSinks_fSinkMissingMsgTrackLogSink or $MetabaseSinks_fSinkMissingRCPTinboundcommandhandlersink or $MetabaseSinks_fSinkMissingSMTPEventlogSink or $MetabaseSinks_fSinkMissingUmConvSink or $MetabaseSinks_fSinkMissingXLSAinboundcommandhandlersink or $MetabaseSinks_fSinkMissingXLSAresponsehandlersink or $MetabaseSinks_fSinkMissingXLSASink or $MetabaseSinks_fCatDbgSinkInstalled)" AlwaysEvaluate="True"/>

							<Rule Name="fAllExchangeSinkFound" Query="count($MetabaseSinks_szSinkPath)&gt;0 and $fExchangeSinkFound1 and $fExchangeSinkFound2 and $fExchangeSinkFound3 and $fExchangeSinkFound4" Error="None" Title="Transport event sink default configuration found" Text="All the default Exchange transport event sinks were found in the metabase of server {2}." S2="%varExName%"/>
							<Rule Name="fAllSinkRegistered" Query="count($MetabaseSinks_szSinkPath)&gt;0 and count($MetabaseSinks_fSinkRegMissing)=0 and count($MetabaseSinks_fSinkRegInvalid)=0" Error="None" Title="Transport event sink registrations found" Text="All the transport event sinks found in the metabase of server {2} appear to be registered correctly under the HKEY_CLASSES_ROOT hive." S2="%varExName%" AlwaysEvaluate="True"/>
							<Rule Name="fAllSinkFileFound" Query="count($MetabaseSinks_szSinkPath)&gt;0 and count($MetabaseSinks_fSinkFileMissing)=0" Error="None" Title="Transport event sink executables found" Text="The executable files for all the transport event sinks found in the metabase of server {2} are identified and found on disk." S2="%varExName%" AlwaysEvaluate="True"/>
							<Rule Name="fSinkNonExchange" Query="count($MetabaseSinks_szSinkPath)&gt;0 and count($MetabaseSinks_fSinkNotRecognized) &gt;0" Error="Warning" Title="Non-default transport event sinks found" Text="At least one non-default transport event sink was found in the metabase of server {2}. Please check that this sink will not cause any harm to mail flows." S2="%varExName%" AlwaysEvaluate="True"/>
							<Rule Name="fMetabaseIssueFound" Query="not($fAllExchangeSinkFound and $fAllSinkRegistered and $fAllSinkFileFound) or $fSinkNonExchange"/>
							<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckMetabaseStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
						</Object>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckSMTPDisk" Title="Disk Performance" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstanceName%" Substitution="varAllSMTPInstanceName" Display="Hide"/>
			<Setting Key1="%varNonEnglishOS%" Substitution="varNonEnglishOS" Display="Hide"/>
			<Setting Key1="%varAllSMTPLogicalDisks%" Substitution="varAllSMTPLogicalDisks" Display="Hide"/>
			<Setting Key1="%varAllSMTPQueueDirectory%" Substitution="varAllSMTPQueueDirectory" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Disk Performance" Text="Please wait while the tool checks the performance of the disk used by the SMTP service on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Disk Performance" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
						<Object Type="Variable" Name="SMTP Logical Disks" Key1="Unpack" Key2="%varAllSMTPLogicalDisks%">
							<Setting Key1="__KEY" Substitution="SORTKEY"/>
							<Setting Key1="__VALUE" Substitution="SMTPLOGICALDISKS"/>
							<Object Type="Cache" Name="SMTPDriveList" Key1="Add" Key2="SMTPDrive" Key3="%SMTPLOGICALDISKS%" Key4="," Display="Hide">
								<Setting Key1="SMTPDrive" Substitution="SMTPDRIVE"/>
								<!-- Let's check performance counters -->
								<Object Type="Pdh" Name="SMTPDrivePerfCheck" Key1="%varExName%" Key2="15" Key3="1" Level="1">
									<Rule Name="fGeneralErrorAccessPerf" Query="../Exception" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. Error message: {1}." S0="LogicalDisk" P1="../Exception/@Message" S2="%varExName%"/>
									<Rule Name="fBDBErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bdb')" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. This may be due to insufficient permissions. Error message: {1}." S0="LogicalDisk" P1="../Exception/@Message" S2="%varExName%"/>
									<Rule Name="fContactErrorAccessPerf" Query="contains(../Exception/@Message, '0x800007d0')" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Error accessing performance counters on server {2}. The server may be unavailable, or the remote registry service may not be running on that server. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
									<Rule Name="fNonEngErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bb8') and @S1='1'" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Cannot access performance monitor counters. This tool must run on a U.S. English operating system." S1="%varNonEnglishOS%"/>

									<Setting Key1="LogicalDisk" Key2="Avg. Disk Queue Length" Key3="%SMTPDRIVE%">
										<Rule Name="iSMTPLogicalDiskAverageDiskQueueLength" Query="round(list-average($.)*10) div 10" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9}." P0="localize-path('LogicalDisk(%SMTPDRIVE%)\Average Disk Queue Length')" P9="round(list-average($.)*10) div 10"/>
									</Setting>
									<Setting Key1="LogicalDisk" Key2="Avg. Disk sec/Read" Key3="%SMTPDRIVE%">
										<Rule Name="iSMTPLogicalDiskAverageDiskMsecRead" Query="round(list-average($.)*10000) div 10000" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9} ms." P0="localize-path('LogicalDisk(%SMTPDRIVE%)\Avg. Disk sec/Read')" P9="round(list-average($.)*1000)"/>
										<Rule Name="iSMTPLogicalDiskAverageDiskMsecReadSpikes" Query="round(list-max($.)*1000)" Error="None" Title="Maximum '{0}'" Text="Maximum '{0}' = {9} ms." P0="localize-path('LogicalDisk(%SMTPDRIVE%)\Avg. Disk sec/Read')" P9="round(list-max($.)*1000)"/>
										<Rule Name="fSMTPLogicalDiskAverageDiskMsecRead10" Query="not($iSMTPLogicalDiskAverageDiskMsecRead &lt; 10)" Error="Error" Sev="1" ReportIssue="Issue" Title="Logical disk performance issue on drive hosting SMTP virtual server" Text="Disk {3} is used by SMTP instance '{1}' but its '{0}' is more than {8} ms on average. The measured value was {9} ms." P0="localize-path('LogicalDisk(%SMTPDRIVE%)\Average Disk Seconds per Read')" P1="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" S3="%SMTPDRIVE%" S8="10" P9="$iSMTPLogicalDiskAverageDiskMsecRead" GUID="29f01985-7b44-47cb-96f7-d7c92fd8e867"/>
										<Rule Name="fSMTPLogicalDiskAverageDiskMsecReadSpikes50" Query="not($iSMTPLogicalDiskAverageDiskMsecReadSpikes &lt; 50)" Error="Error" Sev="1" ReportIssue="Issue" Title="Logical disk performance issue on drive hosting SMTP virtual server" Text="Disk {3} is used by SMTP instance '{1}' but its {0} exceeds {8} ms at least once. The measured maximum value was {9} ms." P0="localize-path('LogicalDisk(%SMTPDRIVE%)\Average Disk Seconds per Read')" P1="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" S3="%SMTPDRIVE%" S8="50" P9="$iSMTPLogicalDiskAverageDiskMsecReadSpikes" GUID="29f01985-7b44-47cb-96f7-d7c92fd8e867"/>
									</Setting>
									<Setting Key1="LogicalDisk" Key2="Avg. Disk sec/Write" Key3="%SMTPDRIVE%">
										<Rule Name="iSMTPLogicalDiskAverageDiskMsecWrite" Query="round(list-average($.)*10000) div 10000" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9} ms." P0="localize-path('LogicalDisk(%SMTPDRIVE%)\Avg. Disk sec/Write')" P9="round(list-average($.)*1000)"/>
										<Rule Name="iSMTPLogicalDiskAverageDiskMsecWriteSpikes" Query="round(list-max($.)*1000)" Error="None" Title="Maximum '{0}'" Text="Maximum {0} = {9} ms." P0="localize-path('LogicalDisk(%SMTPDRIVE%)\Avg. Disk sec/Write')" P9="round(list-max($.)*1000)"/>
										<Rule Name="fSMTPLogicalDiskAverageDiskMsecWrite10" Query="not($iSMTPLogicalDiskAverageDiskMsecWrite &lt; 10)" Error="Error" Sev="1" ReportIssue="Issue" Title="Logical disk performance issue on drive hosting SMTP virtual server" Text="Disk {3} is used by SMTP instance '{1}' but '{0}' is more than {8} ms on average. The measured value was {9} ms." P1="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P0="localize-path('LogicalDisk(%SMTPDRIVE%)\Avg. Disk sec/Write')" S3="%SMTPDRIVE%" S8="10" P9="$iSMTPLogicalDiskAverageDiskMsecWrite" GUID="29f01985-7b44-47cb-96f7-d7c92fd8e867"/>
										<Rule Name="fSMTPLogicalDiskAverageDiskMsecWriteSpikes50" Query="not($iSMTPLogicalDiskAverageDiskMsecWriteSpikes &lt; 50)" Error="Error" Sev="1" ReportIssue="Issue" Title="Logical disk performance issue on drive hosting SMTP virtual server" Text="Disk {3} is used by SMTP instance '{1}' but '{0}' exceeds {8} ms at least once. The measured maximum value was {9} ms." P0="localize-path('LogicalDisk(%SMTPDRIVE%)\Avg. Disk sec/Write')" P1="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" S3="%SMTPDRIVE%" S8="50" P9="$iSMTPLogicalDiskAverageDiskMsecWriteSpikes" GUID="29f01985-7b44-47cb-96f7-d7c92fd8e867"/>
									</Setting>
								</Object>
							</Object>
						</Object>
						<!-- Let's check whether the queue folder contains too many messages -->
						<Object Type="Variable" Name="SMTP Queue Drives" Key1="Unpack" Key2="%varAllSMTPQueueDirectory%">
							<Setting Key1="__KEY" Substitution="SORTKEY"/>
							<Setting Key1="__VALUE" Substitution="SMTPQUEUEDIR"/>
							<Object Type="File" Key1="%varExName%" Key2="%SMTPQUEUEDIR%">
								<Setting Key1="Files" Key2="*.*" Retrieve="CountOnly">
									<Rule Name="fSMTPQueueDirExceeds90000" Query="$. &gt; 90000" Error="Error" Sev="1" Title="SMTP queue folder contains more than {9} files" Text="The queue folder of SMTP instance '{1}' on server {2} contains more than {9} files. This may cause severe Exchange performance problems. The number of files detected: {8}." P1="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" S2="%varExName%" P8="$." S9="90000" GUID="1ac31051-7ad6-4f66-8ea0-6ff29c8053ee"/>
									<Rule Name="fSMTPQueueDirExceeds50000" Query="not ($fSMTPQueueDirExceeds90000) and $. &gt; 50000" Error="Warning" Sev="1" Title="SMTP queue folder contains more than {9} files" Text="The queue folder of SMTP instance '{1}' on server {2} contains more than {9} files. This may cause severe Exchange performance problems. The number of files detected: {8}." P1="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" S2="%varExName%" P8="$." S9="50000" GUID="1ac31051-7ad6-4f66-8ea0-6ff29c8053ee"/>
								</Setting>
							</Object>
						</Object>

						<Rule Name="szCheckSMTPDisk" Query="'CheckSMTPDisk'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fSMTPDiskIssueFound,string(@Title),$szExNoErrorStateText)" Title="A potential issue with disk performance was identified." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No issue with disk performance was identified."/>
						<Rule Name="szCheckSMTPDiskResult" Query="string(@Title)" Title="Disk Performance Check Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fSMTPDiskIssueFound" Query="$fSMTPLogicalDiskAverageDiskMsecRead10 or $fSMTPLogicalDiskAverageDiskMsecReadSpikes50 or $fSMTPLogicalDiskAverageDiskMsecWrite10 or $fSMTPLogicalDiskAverageDiskMsecWriteSpikes50 or $fSMTPQueueDirExceeds50000 or $fSMTPQueueDirExceeds90000" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckSMTPDiskStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckDCGCAvailability" Title="Check Active Directory Availability" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Active Directory Availability" Text="Please wait while the tool accesses the Directory Service Access (DSAccess) performance counters on server {2} to check Active Directory availability." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Active Directory Availability" Class="Area" GroupingClass="True" Display="Hide">
					<!-- Take the DSACCESS perf counters to see if it takes too much time to get info from Active Directory -->
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<Object Type="Pdh" Name="DSAccessLDAPTimeCheck" Key1="%varExName%" Key2="15" Key3="1" Level="1" SecurityContext="EXLOGON">
							<Rule Name="fGeneralErrorAccessPerf" Query="../Exception" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. Error message: {1}." S0="MSExchangeDSAccess Processes" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fBDBErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bdb')" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. This may be due to insufficient permissions. Error message: {1}." S0="MSExchangeDSAccess Processes" P1="../Exception/@Message" S2="%varExName%"/>
							<Setting Key1="MSExchangeDSAccess Processes" Key2="LDAP Read Time" Key3="*">
								<Rule Name="iDSAccessLDAPReadTimeMsec" Query="round(list-average($.)*10000) div 10000" Error="None" Title="{4}" Text="'{4}' of process {3} on server {2} is {9} ms on average." S2="%varExName%" P3="substring-after(../../@Name,'Processes')" P4="../@Key2" P9="round(list-average($.)*10000) div 10000"/>
								<Rule Name="fDSAccessLDAPReadTimeMsec100" Query="list-max($.) &gt;100" Error="Error" Sev="2" ReportIssue="Issue" Title="Active Directory availability issue" Text="'{4}' exceeds 100 ms for process {3} of server {2}. This indicates a possible Active Directory availability issue. Maximum value: {9} ms." S2="%varExName%" P3="substring-after(../../@Name,'Processes')" P4="../@Key2" P9="list-max($.)" GUID="ecdef5be-83b7-49ba-a48b-618708f4d1c0"/>
							</Setting>
							<Setting Key1="MSExchangeDSAccess Processes" Key2="LDAP Search Time" Key3="*">
								<Rule Name="iDSAccessLDAPSearchTimeMsec" Query="round(list-average($.)*10000) div 10000" Error="None" Title="{4}" Text="'{4}' of process {3} on server {2} is {9} ms on average." S2="%varExName%" P3="substring-after(../../@Name,'Processes')" P4="../@Key2" P9="round(list-average($.)*10000) div 10000"/>
								<Rule Name="fDSAccessLDAPSearchTimeMsec100" Query="list-max($.) &gt;100" Error="Error" Sev="2" ReportIssue="Issue" Title="Active Directory availability issue" Text="'{4}' exceeds 100 ms for process {3} of server {2}. This indicates a possible Active Directory availability issue. Maximum value: {9} ms." S2="%varExName%" P3="substring-after(../../@Name,'Processes')" P4="../@Key2" P9="list-max($.)" GUID="8d27bbc3-dd41-4463-b4a0-37cbe605ac25"/>
							</Setting>
						</Object>

						<Rule Name="szCheckDCGCAvailability" Query="'CheckDCGCAvailability'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fDSAcccessIssueFound, string(@Title), $szExNoErrorStateText)" Title="A potential issue with Active Directory availability was identified." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No issue with Active Directory availability was identified."/>
						<Rule Name="szCheckDCGCAvailabilityResult" Query="string(@Title)" Title="Active Directory Availability Check Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fDSAcccessIssueFound" Query="$fDSAccessLDAPReadTimeMsec100 or $fDSAccessLDAPSearchTimeMsec100" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckDCGCStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckDNSAvailability" Title="Check DNS Availability" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExFQDN%" Substitution="varExFQDN" Display="Hide"/>
			<Setting Key1="%varExDN%" Substitution="varExDN" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstance%" Substitution="varAllSMTPInstance" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstanceName%" Substitution="varAllSMTPInstanceName" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>
			<Setting Key1="%varMonadDCParameter%" Substitution="varMonadDCParameter" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking DNS Availability" Text="Please wait while the tool checks the availability of Domain Name System." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="DNS Availability" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="If" Name="%varExName%" Key1="true()" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Get the the datetime of exactly 24 hours ago in the yyyyMMddHHmmss.000000+000 format as this format is faster for a WMI query -->
						<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
						<!-- Let's get first the address of primary DNS for each NIC -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NetworkAdapter" Key4="MacAddress!=null and ServiceName!='RasPppoe' and ServiceName!='NIC1394' and ServiceName!='PptpMiniport'" Key5="*">
							<Rule Name="fNoNetWorkAdapterFound" Query="count(../Instance)=0"/>
							<Setting Key1="Caption" Substitution="NICCAPTION"/>
							<Object Type="WMI" Key1="%varExName%" Key3="Win32_NetworkAdapterConfiguration" Key4="Caption='%NICCAPTION%'">
								<Rule Name="fNoNetworkAdapterConfigurationFound" Query="count(../Instance)=0"/>
								<Setting Key1="DNSServerSearchOrder" Substitution="DNSADDRESS" SubstitutionFormat="^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*$----$1;">
									<Rule Name="szPrimaryDNSAddress" Query="$.[1]"/>
									<Rule Name="szDNSAddress" Query="$."/>
								</Setting>
								<Setting Key1="IPAddress">
									<Rule Name="szExIPAddress" Query="$.[matches(.,'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')]"/>
								</Setting>
								<Object Type="Cache" Name="DNSOrder" Key1="Add" Key2="DNSAddress" Key3="%DNSADDRESS%" Display="Hide">
									<Setting Key1="DNSAddr" Substitution="PRIMARYDNS" SubstitutionFormat="^(.*?);.*----$1">
										<Rule Name="fPrimaryDNSNotAliveUDP" Query="not($fPrimaryDNSAliveUDP) and $fPrimaryDNSTCPReturned and (not('%varIsExchange2007orLater%'='1') or ('%varIsExchange2007orLater%'='1' and not($fExternalDNSUseTCPOnly and $fInternalDNSUseTCPOnly)))" Error="Warning" Sev="1" Title="Primary DNS failed to respond to a UDP connection" Text="Cannot contact the primary DNS server ({1}) for Exchange server {2} using UDP. The DNS server ({1}) may be configured to accept only TCP queries. If SMTP services are configured to send only UDP queries, mail routing delays may occur." P1="$szPrimaryDNSAddress" S2="%varExName%" GUID="54af997b-afc4-4586-b267-67b53d9760d5" AlwaysEvaluate="True"/>
										<Rule Name="fPrimaryDNSResponseDifferent" Query="$fPrimaryDNSAliveUDP and $fPrimaryDNSTCPReturned and $szPrimaryDNSUDPResponse != $szPrimaryDNSTCPResponse" Error="Warning" Sev="3" Title="DNS responses are different between UDP and TCP" Text="Primary DNS ({1}) for server {2} responded successfully to both UDP and TCP connections but the returned responses are different. This may be caused by truncated UDP responses or other configuration issues." P1="$szPrimaryDNSAddress" S2="%varExName%" GUID="c94ef873-008d-49ce-9705-8de47c4497e0"/>
									</Setting>
									<!-- Now Check DNS -->
									<Object Type="Port" Name="IsDNSAlive" Key1="%PRIMARYDNS%">
										<Setting Key1="53">
											<Rule Name="fPrimaryDNSAliveTCP" Query="$.[2]='53 Available'" Error="None" Title="Primary DNS responded to a TCP connection" Text="Primary DNS ({1}) for server {2} responded successfully to a TCP connection." P1="$szPrimaryDNSAddress" S2="%varExName%"/>
											<Rule Name="fPrimaryDNSNotAliveTCP" Query="not ($fPrimaryDNSAliveTCP) and (not('%varIsExchange2007orLater%'='1') or ('%varIsExchange2007orLater%'='1' and not($fExternalDNSUseUDPOnly and $fInternalDNSUseUDPOnly)))" Error="Warning" Sev="1" Title="Primary DNS failed to respond to a TCP connection" Text="Cannot contact the primary DNS server ({1}) for Exchange server {2} using TCP. The DNS server ({1}) may be down or configured to accept only UDP queries. If the primary DNS server is unavailable, mail routing delays and performance problems may occur." P1="$szPrimaryDNSAddress" S2="%varExName%" GUID="b927d1e3-c764-4aba-9b91-7c936d07e034" AlwaysEvaluate="True"/>
										</Setting>
									</Object>
									<!-- Check to see if the DNS response changes between UDP and TCP -->
									<Object Type="DNS" Key1="%PRIMARYDNS%" Key2="%varExFQDN%" Key3="AcceptTruncatedResponse">
										<Setting Key1="A">
											<Rule Name="fPrimaryDNSAliveUDP" Query="$.[4] != 'DNS Query Result = '" Error="None" Title="Primary DNS responded to a UDP connection" Text="Primary DNS ({1}) for server {2} responded successfully to a UDP connection." P1="$szPrimaryDNSAddress" S2="%varExName%"/>
											<Rule Name="szPrimaryDNSUDPResponse" Query="if ($fPrimaryDNSAliveUDP, substring-after($.[4],'DNS Query Result = '))"/>
										</Setting>
									</Object>
									<Object Type="DNS" Key1="%PRIMARYDNS%" Key2="%varExFQDN%" Key3="UseTcpOnly">
										<Setting Key1="A">
											<Rule Name="fPrimaryDNSTCPReturned" Query="$.[4] != 'DNS Query Result = '"/>
											<Rule Name="szPrimaryDNSTCPResponse" Query="if ($fPrimaryDNSTCPReturned, substring-after($.[4],'DNS Query Result = '))"/>
										</Setting>
									</Object>
								</Object>
								<Object Type="Cache" Name="DNSOrder" Key1="Delete" Key2="DNSAddress" Display="Hide"/>
							</Object>
						</Object>

						<Object Type="If" Name="Exchange 2000/2003 DNS Settings" Key1="not('%varIsExchange2007orLater%'='1')">
							<!-- Check for external DNS servers -->
							<Object Type="Variable" Name="SMTP Instance List" Key1="Unpack" Key2="%varAllSMTPInstance%">
								<Setting Key1="__KEY" Substitution="SORTKEY"/>
								<Setting Key1="__VALUE" Substitution="SMTPINSTANCE"/>
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%">
									<Setting Key1="msExchSmtpExternalDNSServers" Substitution="PRIMARYEXTDNS" SubstitutionFormat="(^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*$----$1">
										<Rule Name="szExternalDNS" Query="$."/>
										<Rule Name="fPrimaryExtDNSNotAliveUDP" Query="not($fPrimaryExtDNSAliveUDP) and $fPrimaryExtDNSTCPReturned" Error="Warning" Sev="1" Title="Primary external DNS failed to respond to a UDP connection" Text="Cannot contact the primary external DNS server ({1}) for SMTP instance '{3}' on Exchange server {2} using UDP. The external DNS server ({1}) may be configured to accept only TCP queries. If SMTP services are configured to send only UDP queries, mail routing delays and performance problems may occur." S1="%PRIMARYEXTDNS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" GUID="761d90e3-091c-4e2e-bff4-84d9901deb27"/>
										<Rule Name="fPrimaryExtDNSResponseDifferent" Query="$fPrimaryExtDNSAliveUDP and $fPrimaryExtDNSTCPReturned and $szPrimaryExtDNSUDPResponse != $szPrimaryExtDNSTCPResponse" Error="Warning" Sev="3" Title="DNS responses are different between UDP and TCP" Text="Primary external DNS ({1}) for SMTP instance '{3}' on server {2} responded successfully to both UDP and TCP connections but the returned responses are different. This may be caused by truncated UDP responses or other configuration issues." S1="%PRIMARYEXTDNS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" GUID="8b9e8b25-15ab-46e7-8e4b-62ddc221d2ae"/>
									</Setting>
									<Object Type="Port" Name="IsExtDNSAlive" Key1="%PRIMARYEXTDNS%">
										<Setting Key1="53">
											<Rule Name="fPrimaryExtDNSAliveTCP" Query="$.[2]='53 Available'" Error="None" Title="Primary external DNS responded to a TCP connection" Text="Primary external DNS ({1}) for SMTP instance '{3}' on server {2} responded successfully to a TCP connection." S1="%PRIMARYEXTDNS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')"/>
											<Rule Name="fPrimaryExtDNSNotAliveTCP" Query="not ($fPrimaryExtDNSAliveTCP)" Error="Warning" Sev="1" Title="Primary external DNS failed to respond to a TCP connection" Text="Cannot contact the primary external DNS server ({1}) for SMTP instance '{3}' on server {2} using TCP. The DNS server ({1}) may be down or configured to accept only UDP queries. If the primary external DNS server is unavailable, mail routing delays and performance problems may occur." S1="%PRIMARYEXTDNS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" GUID="20c1da08-eea3-4beb-95b6-9154b0b58514"/>
										</Setting>
									</Object>
									<!-- Check to see if the DNS response changes between UDP and TCP -->
									<Object Type="DNS" Key1="%PRIMARYEXTDNS%" Key2="%varExFQDN%" Key3="AcceptTruncatedResponse">
										<Setting Key1="A">
											<Rule Name="fPrimaryExtDNSAliveUDP" Query="$.[4] != 'DNS Query Result = '" Error="None" Title="Primary external DNS responded to a UDP connection" Text="Primary external DNS ({1}) for SMTP instance '{3}' on server {2} responded successfully to a UDP connection." S1="%PRIMARYEXTDNS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')"/>
											<Rule Name="szPrimaryExtDNSUDPResponse" Query="if ($fPrimaryExtDNSAliveUDP, substring-after($.[4],'DNS Query Result = '))"/>
										</Setting>
									</Object>
									<Object Type="DNS" Key1="%PRIMARYEXTDNS%" Key2="%varExFQDN%" Key3="UseTcpOnly">
										<Setting Key1="A">
											<Rule Name="fPrimaryExtDNSTCPReturned" Query="$.[4] != 'DNS Query Result = '"/>
											<Rule Name="szPrimaryExtDNSTCPResponse" Query="if ($fPrimaryExtDNSTCPReturned, substring-after($.[4],'DNS Query Result = '))"/>
										</Setting>
									</Object>
								</Object>
							</Object>
							<!-- Finally, check if the system event log contains events 2012 and 2013 -->
							<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='System' AND EventCode=2012 AND SourceName='smtpsvc' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
								<Setting Key1="EventCode"/>
								<Setting Key1="EventType"/>
								<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
								<Setting Key1="Data"/>
								<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
									<Rule Name="fEvt2012WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A DNS warning event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the system log of server {2} within the last 24 hours. This may indicate that server {2} is having DNS availability issues. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="2012"/>
								</Setting>
							</Object>
							<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='System' AND EventCode=2013 AND SourceName='smtpsvc' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
								<Setting Key1="EventCode"/>
								<Setting Key1="EventType"/>
								<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
								<Setting Key1="Data"/>
								<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
									<Rule Name="fEvt2013WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A DNS warning event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the system log of server {2} within the last 24 hours. This may indicate that server {2} is having DNS availability issues. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="2013"/>
								</Setting>
							</Object>
						</Object>

						<!-- Let's look at the E12 DNS configurations -->
						<Object Type="If" Name="Exchange Server 2007 DNS Settings" Key1="'%varIsExchange2007orLater%'='1'" Display="Hide">
							<Object Type="MonadCommand" Name="Identity" Key1="get-TransportServer -Identity %varExName% %varMonadDCParameter%">
								<Rule Name="fGetTransportServerException" Query="../Exception" Error="Error" Sev="1" Title="Error executing '{0}'" Text="Error executing '{0}' on server {2}. Error message: {1}." S0="get-TransportServer -Identity %varExName%" P1="../Exception/@Message" S2="%varExName%"/>
								<Setting Key1="ExternalDNSAdapterEnabled" Substitution="EXTERNALDNSADAPTERENABLED">
									<Rule Name="fE12ExternalDNSAdaptersEnabled" Query="$."/>
								</Setting>
								<Setting Key1="ExternalDNSAdapterGuid"/>
								<Setting Key1="ExternalDNSProtocolOption" Format="Enum">
									<Rule Name="fExternalDNSAny" Query="$.='0'"/>
									<Rule Name="fExternalDNSUseUDPOnly" Query="$.='1'" Error="NonDefault" Title="External DNS Protocol Option" Text="Server {2} is configured to send only UDP queries to external DNS servers." S2="%varExName%"/>
									<Rule Name="fExternalDNSUseTCPOnly" Query="$.='2'" Error="NonDefault" Title="External DNS Protocol Option" Text="Server {2} is configured to send only TCP queries to external DNS servers." S2="%varExName%"/>
								</Setting>
								<Setting Key1="ExternalDNSServers" Substitution="EXTERNALDNSSERVERS" SubstitutionFormat="$----,">
									<Rule Name="szE12ExternalDNSServers" Query="if($fE12ExternalDNSAdaptersEnabled='False',$.)"/>
								</Setting>
								<Setting Key1="InternalDNSAdapterEnabled" Substitution="INTERNALDNSADAPTERENABLED">
									<Rule Name="fE12InternalDNSAdaptersEnabled" Query="$."/>
								</Setting>
								<Setting Key1="InternalDNSAdapterGuid"/>
								<Setting Key1="InternalDNSProtocolOption" Format="Enum">
									<Rule Name="fInternalDNSAny" Query="$.='0'"/>
									<Rule Name="fInternalDNSUseUDPOnly" Query="$.='1'" Error="NonDefault" Title="Internal DNS Protocol Option" Text="Server {2} is configured to send only UDP queries to internal DNS servers." S2="%varExName%"/>
									<Rule Name="fInternalDNSUseTCPOnly" Query="$.='2'" Error="NonDefault" Title="Internal DNS Protocol Option" Text="Server {2} is configured to send only TCP queries to internal DNS servers." S2="%varExName%"/>
								</Setting>
								<Setting Key1="InternalDNSServers" Substitution="INTERNALDNSSERVERS" SubstitutionFormat="$----,">
									<Rule Name="szE12InternalDNSServers" Query="if($fE12InternalDNSAdaptersEnabled='False',$.)"/>
								</Setting>

								<Object Type="If" Key1="'%EXTERNALDNSADAPTERENABLED%'='False'">
									<Object Type="Cache" Name="HubTransportExternalDNS" Key1="Add" Key2="DNSAddresses" Key3="%EXTERNALDNSSERVERS%" Key4="," Display="Hide">
										<Setting Key1="DNSAddress" Substitution="PRIMARYDNS"/>
										<!-- Now Check DNS -->
										<Object Type="Port" Name="IsDNSAlive" Key1="%PRIMARYDNS%">
											<Setting Key1="53">
												<Rule Name="fE12ExternalDNSAliveTCP" Query="$.[2]='53 Available'" Error="None" Title="External DNS server responded to a TCP connection" Text="External DNS server ({1}) used by transport on server {2} responded successfully to a TCP connection." S1="%PRIMARYDNS%" S2="%varExName%"/>
												<Rule Name="fE12ExternalDNSNotAliveTCP" Query="not ($fE12ExternalDNSAliveTCP)" Error="Warning" Sev="1" Title="External DNS server failed to respond to a TCP connection" Text="Cannot contact the external DNS server ({1}) used by transport on server {2} using TCP. The DNS server ({1}) may be down or configured to accept only UDP queries. If the primary external DNS server is unavailable, mail routing delays and performance problems may occur." S1="%PRIMARYDNS%" S2="%varExName%" S3="Transport Server Settings"/>
											</Setting>
										</Object>
										<!-- Check to see if the DNS response changes between UDP and TCP -->
										<Object Type="DNS" Key1="%PRIMARYDNS%" Key2="%varExFQDN%" Key3="AcceptTruncatedResponse">
											<Setting Key1="A">
												<Rule Name="fE12ExternalDNSAliveUDP" Query="$.[4] != 'DNS Query Result = '" Error="None" Title="External DNS server responded to a UDP connection" Text="External DNS server ({1}) defined on '{3}' on server {2} responded successfully to a UDP connection." S1="%PRIMARYDNS%" S2="%varExName%" S3="Transport Server Settings"/>
												<Rule Name="szE12ExternalDNSUDPResponse" Query="if ($fE12ExternalDNSAliveUDP, substring-after($.[4],'DNS Query Result = '))"/>
											</Setting>
										</Object>
										<Object Type="DNS" Key1="%PRIMARYDNS%" Key2="%varExFQDN%" Key3="UseTcpOnly">
											<Setting Key1="A">
												<Rule Name="fE12ExternalDNSTCPReturned" Query="$.[4] != 'DNS Query Result = '"/>
												<Rule Name="szE12ExternalDNSTCPResponse" Query="if ($fE12ExternalDNSTCPReturned, substring-after($.[4],'DNS Query Result = '))"/>
											</Setting>
										</Object>
									</Object>
									<Object Type="Cache" Name="HubTransportExternalDNS" Key1="Delete" Key2="DNSAddresses" Display="Hide"/>
								</Object>

								<Object Type="If" Key1="'%INTERNALDNSADAPTERENABLED%'='False'">
									<Object Type="Cache" Name="HubTransportInternalDNS" Key1="Add" Key2="DNSAddresses" Key3="%INTERNALDNSSERVERS%" Key4="," Display="Hide">
										<Setting Key1="DNSAddress" Substitution="PRIMARYDNS"/>
										<!-- Now Check DNS -->
										<Object Type="Port" Name="IsDNSAlive" Key1="%PRIMARYDNS%">
											<Setting Key1="53">
												<Rule Name="fE12InternalDNSAliveTCP" Query="$.[2]='53 Available'" Error="None" Title="Internal DNS server responded to a TCP connection" Text="Internal DNS server ({1}) defined on '{3}' on server {2} responded successfully to a TCP connection." S1="%PRIMARYDNS%" S2="%varExName%" S3="Transport Server Settings"/>
												<Rule Name="fE12InternalDNSNotAliveTCP" Query="not ($fE12InternalDNSAliveTCP)" Error="Warning" Sev="1" Title="Internal DNS server failed to respond to a TCP connection" Text="Cannot contact the internal DNS server ({1}) defined on '{3}' on server {2} using TCP. The DNS server ({1}) may be down or configured to accept only UDP queries. If the primary external DNS server is unavailable, mail routing delays and performance problems may occur." S1="%PRIMARYDNS%" S2="%varExName%" S3="Transport Server Settings"/>
											</Setting>
										</Object>
										<!-- Check to see if the DNS response changes between UDP and TCP -->
										<Object Type="DNS" Key1="%PRIMARYDNS%" Key2="%varExFQDN%" Key3="AcceptTruncatedResponse">
											<Setting Key1="A">
												<Rule Name="fE12InternalDNSAliveUDP" Query="$.[4] != 'DNS Query Result = '" Error="None" Title="Internal DNS server responded to a UDP connection" Text="Internal DNS server ({1}) defined on '{3}' on server {2} responded successfully to a UDP connection." S1="%PRIMARYDNS%" S2="%varExName%" S3="Transport Server Settings"/>
												<Rule Name="szE12InternalDNSUDPResponse" Query="if ($fE12InternalDNSAliveUDP, substring-after($.[4],'DNS Query Result = '))"/>
											</Setting>
										</Object>
										<Object Type="DNS" Key1="%PRIMARYDNS%" Key2="%varExFQDN%" Key3="UseTcpOnly">
											<Setting Key1="A">
												<Rule Name="fE12InternalDNSTCPReturned" Query="$.[4] != 'DNS Query Result = '"/>
												<Rule Name="szE12InternalDNSTCPResponse" Query="if ($fE12InternalDNSTCPReturned, substring-after($.[4],'DNS Query Result = '))"/>
											</Setting>
										</Object>
									</Object>
									<Object Type="Cache" Name="HubTransportInternalDNS" Key1="Delete" Key2="DNSAddresses" Display="Hide"/>
								</Object>
							</Object>
						</Object>

						<Rule Name="szCheckDNSAvailability" Query="'CheckDNSAvailability'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fDNSIssueFound or $fNoDNSServerFound, string(@Title), $szExNoErrorStateText)" Title="A potential issue with DNS availability was identified." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No issue with DNS availability was identified."/>
						<Rule Name="szCheckDNSAvailabilityResult" Query="string(@Title)" Title="DNS Availability Check Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="szAllDNSAddress" Query="replace (concat (join (',',$szDNSAddress), ',', join (',',$szExternalDNS), ',', join (',',$szE12InternalDNSServers), ',', join (',',$szE12ExternalDNSServers)), ',', ';')" AlwaysEvaluate="True">
							<Variable Name="varAllDNSAddress" Scope="Global"/>
						</Rule>
						<Rule Name="szAllExIPAddress" Query="join(';',$szExIPAddress)">
							<Variable Name="varAllExIPAddress" Scope="Global"/>
						</Rule>
						<Rule Name="fDNSIssueFound" Query="$fPrimaryDNSNotAliveUDP or $fPrimaryDNSNotAliveTCP or $fPrimaryExtDNSNotAliveUDP or $fPrimaryExtDNSNotAliveTCP or $fEvt2012WithinLast24hours or $fEvt2013WithinLast24hours" AlwaysEvaluate="True"/>
						<Rule Name="fDNSPossibleIntermittentIssue" Query="($fEvt2012WithinLast24hours or $fEvt2013WithinLast24hours) and not($fPrimaryDNSNotAliveUDP or $fPrimaryDNSNotAliveTCP or $fPrimaryExtDNSNotAliveUDP or $fPrimaryExtDNSNotAliveTCP)" Error="Warning" Sev="2" Title="Potential intermittent DNS issue" Text="Primary DNS servers for server {2} responded successfully to the connection requests by the tool but events showing DNS connectivity issues were found in the event logs. This may indicate that server {2} is having an intermittent DNS availability issue." S2="%varExName%" AlwaysEvaluate="True"/>
						<Rule Name="fNoDNSServerFound" Query="($fNoNetWorkAdapterFound or $fNoNetworkAdapterConfigurationFound) and count($szExternalDNS) &lt;1" Error="Error" Sev="2" Title="No DNS servers were found" Text="No DNS servers that are used by server {2} were found. Please check the DNS configuration." S2="%varExName%" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckDNSStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MADLFileVersion" Title="Check File Version" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varExVersionNumber%" Substitution="varExVersionNumber" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking File Version" Text="Please wait while the tool checks the version of several files." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="File Version" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Let's check the file version of phatq.dll, phatcat.dll, store.exe, drviis.dll, exsmtp.dll -->
						<Object Type="Registry" Key1="%varExName%" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\Setup" SecurityContext="EXLOGON">
							<Setting Key1="Services" Substitution="EXCHBINPATHD" SubstitutionFormat="\\----\\"/>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\Phatq.dll'">
								<Setting Key1="Version">
									<Rule Name="fFileVersionPhatqNewer" Query="substring($., 5, 4) &gt; $iFileVersionStore" Error="Warning" Sev="3" Title="Updated {5} file detected" Text="{5} file version on server {2} is more recent than the installed version of Exchange. This is probably a software update. Installed file version: {6}." S2="%varExName%" S5="PHATQ.DLL" P6="$." GUID="5104a6a0-6c8d-4bf9-b056-6ed42faf8a92"/>
									<Rule Name="fFileVersionPhatqOlder" Template="tExFileOlder" ReportIssue="Issue" S5="PHATQ.DLL" GUID="5e4b405c-a0fa-40b6-bb36-130f1067a12b"/>
								</Setting>
							</Object>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\PhatCat.dll'">
								<Setting Key1="Version">
									<Rule Name="fFileVersionPhatCatNewer" Query="substring($., 5, 4) &gt; $iFileVersionStore" Error="Warning" Sev="3" Title="Updated {5} file detected" Text="{5} file version on server {2} is more recent than the installed version of Exchange. This is probably a software update. Installed file version: {6}." S2="%varExName%" S5="PHATCAT.DLL" P6="$." GUID="5104a6a0-6c8d-4bf9-b056-6ed42faf8a92"/>
									<Rule Name="fFileVersionPhatCatOlder" Template="tExFileOlder" ReportIssue="Issue" S5="PHATCAT.DLL" GUID="7b3d4096-cba1-464b-b73f-fcf416f91965"/>
								</Setting>
							</Object>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\Store.exe'">
								<Setting Key1="Version">
									<Rule Name="iFileVersionStore" Query="substring($., 5, 4)"/>
									<Rule Name="fFileVersionStoreNewer" Query="substring($., 5, 4) &gt; @S9" Error="Warning" Sev="3" Title="Updated {5} file detected" Text="{5} file version on server {2} is more recent than the installed version of Exchange. This is probably a software update. Installed file version: {6}." S2="%varExName%" S5="STORE.EXE" P6="$." S9="%varExVersionNumber%" GUID="5104a6a0-6c8d-4bf9-b056-6ed42faf8a92"/>
									<Rule Name="fFileVersionStoreOlder" Template="tExFileOlder" ReportIssue="Issue" S5="STORE.EXE" GUID="78174536-9e0c-4c17-a8e9-b9ffd7e7bdce"/>
								</Setting>
							</Object>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\drviis.dll'">
								<Setting Key1="Version">
									<Rule Name="fFileVersionDrvIisNewer" Query="substring($., 5, 4) &gt; $iFileVersionStore" Error="Warning" Sev="3" Title="Updated {5} file detected" Text="{5} file version on server {2} is more recent than the installed version of Exchange. This is probably a software update. Installed file version: {6}." S2="%varExName%" S5="DRVIIS.DLL" P6="$." GUID="5104a6a0-6c8d-4bf9-b056-6ed42faf8a92"/>
									<Rule Name="fFileVersionDrvIisOlder" Template="tExFileOlder" ReportIssue="Issue" S5="DRVIIS.DLL" GUID="b0de423f-08ef-4bc2-b07e-df262cacb9fe"/>
								</Setting>
							</Object>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\exsmtp.dll'">
								<Setting Key1="Version">
									<Rule Name="fFileVersionExSMTPNewer" Query="substring($., 5, 4) &gt; $iFileVersionStore" Error="Warning" Sev="3" Title="Updated {5} file detected" Text="{5} file version on server {2} is more recent than the installed version of Exchange. This is probably a software update. Installed file version: {6}." S2="%varExName%" S5="EXSMTP.DLL" P6="$." GUID="5104a6a0-6c8d-4bf9-b056-6ed42faf8a92"/>
									<Rule Name="fFileVersionExSMTPOlder" Template="tExFileOlder" ReportIssue="Issue" S5="EXSMTP.DLL" GUID="37a78a57-a171-4251-9a2e-f7c265190ddf"/>
								</Setting>
							</Object>
						</Object>

						<Rule Name="szMADLFileVersion" Query="'MADLFileVersion'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fFileVersionIssueFound, string(@Title), $szExNoErrorStateText)" Title="Potential issues with file version were identified." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No critical issue with file version was identified."/>
						<Rule Name="szMADLFileVersionResult" Query="string(@Title)" Title="File Version Check Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fFileVersionIssueFound" Query="$fFileVersionPhatqNewer or $fFileVersionPhatqOlder or $fFileVersionPhatCatNewer or $fFileVersionPhatCatOlder or $fFileVersionStoreOlder or $fFileVersionDrvIisNewer or $fFileVersionDrvIisOlder or $fFileVersionExSMTPNewer or $fFileVersionExSMTPOlder" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayMADLFileVersionStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
						<Rule NextStep="MADLJournaling" Name="fGotoMADLJournaling" Query="not ($fFileVersionIssueFound)" Priority="2" Text="- Check whether message journaling is related to the mail flow issue" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="MADLPermission" Name="fGotoMADLPermission" Query="not ($fFileVersionIssueFound)" Priority="3" Text="- Check whether there are permissions problems that may cause mail flow issues" Display="Hide" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MADLJournaling" Title="Check Journaling" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varAllCommonHomeMDB%" Substitution="varAllCommonHomeMDB" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Message Journaling" Text="Please wait while the tool checks the message journaling settings of server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Journaling" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="If" Name="%varExName%" Key1="true()" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Get the the datetime of exactly 24 hours ago in the yyyyMMddHHmmss.000000+000 format as this format is faster for a WMI query -->
						<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
						<!-- Let's look if the app event log contains any events 9003, 9004, 9035 or 6004 as they are the signs of Journaling problems -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=9003 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt9003WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A categorizer warning event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="9003"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=9004 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt9004WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A categorizer error event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="9004"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=9035 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt9035WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A categorizer warning event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="9035"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=6004 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt6004WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A categorizer warning event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="6004" GUID="e58485d9-20d6-4798-8f53-ebc55fcfd474"/>
							</Setting>
						</Object>
						<!-- Next, let's get the list of mailbox stores with journaling enabled -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectClass=msExchPrivateMDB)(msExchMessageJournalRecipient=*))">
							<Setting Key1="msExchOwningServer">
								<Rule Name="szJournalEnabledExName" Query="substring-before(substring-after($.,'CN='),',')"/>
							</Setting>
							<Setting Key1="cn">
								<Rule Name="szMailboxStore" Query="$."/>
							</Setting>
							<Setting Key1="distinguishedName">
								<Rule Name="fDestHomeMDB" Query="($fStdJournalingRecipDeleted or $fStdJournalingRecipNoNickname or $fStdJournalingRecipDisabled) and contains(upper-case(@S4), upper-case($.))" Error="Error" Sev="2" ReportIssue="Issue" Title="Messages in the queue are addressed to a database with journaling recipient problems" Text="One or more messages in the 'Messages awaiting directory lookup' queue on server {1} are addressed to database '{3}' on server {2}. Database '{3}' appears to have journaling recipient problems." S1="%varExName%" P2="$szJournalEnabledExName" P3="$szMailboxStore" S4="%varAllCommonHomeMDB%" AlwaysEvaluate="True"/>
							</Setting>
							<Setting Key1="msExchMessageJournalRecipient" Substitution="JOURNALRECIP">
								<Rule Name="szStdJournalingRecipDn" Query="$." Error="None" Title="Database journaling is enabled" Text="Message journaling is enabled for database '{3}' on server {2}. Journal recipient is '{1}'." P1="$." P2="$szJournalEnabledExName" P3="$szMailboxStore"/>
								<Rule Name="fStdJournalingRecipDeleted" Query="contains($., 'DEL:')" Error="Error" Sev="2" ReportIssue="Issue" Title="Journaling recipient points to a deleted object" Text="The designated journaling recipient for database '{3}' on server {2} points to a deleted object ({1}). This can cause messages to queue. Use the Exchange System Manager tool to nominate a new recipient for archive messages." P1="$." P2="$szJournalEnabledExName" P3="$szMailboxStore" GUID="27f23d63-71f1-4033-abb4-1c8d88aedc8d"/>
								<Rule Name="fStdJournalingRecipNoNickname" Query="count($szStdJournalingRecipCn)=1 and count($szStdJournalingRecipNickname)=0" Error="Warning" Sev="2" Title="Journaling recipient is not valid" Text="The designated journaling recipient for database '{3}' on server {2} points to an object that does not have a valid mailNickname. This can cause messages to queue. Verify that object '{1}' is mailbox-enabled or use the Exchange System Manager tool to nominate a new recipient for archive messages." P1="$." P2="$szJournalEnabledExName" P3="$szMailboxStore" GUID="00701177-1d5c-4b19-b0f7-2f3e6c1e5c4d" AlwaysEvaluate="True"/>
							</Setting>
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%JOURNALRECIP%">
								<Setting Key1="cn">
									<Rule Name="szStdJournalingRecipCn" Query="$."/>
								</Setting>
								<Setting Key1="mailNickname">
									<Rule Name="szStdJournalingRecipNickname" Query="$."/>
								</Setting>
								<Setting Key1="msExchMasterAccountSid">
									<Rule Name="szStdJournalingRecipMAS" Query="$."/>
								</Setting>
								<Setting Key1="msExchUserAccountControl">
									<Rule Name="fStdJournalingRecipDisabled" Query="$.=2 and not($szStdJournalingRecipMAS)" Error="Warning" Sev="2" Title="Journaling recipient points to a disabled account" Text="The designated journaling recipient for database '{3}' on server {2} points to a disabled account ({1}). This can cause messages to queue or be sent to the badmail folder. Enable the specified account or use the Exchange System Manager tool to nominate a new recipient for archive messages." S1="%JOURNALRECIP%" P2="$szJournalEnabledExName" P3="$szMailboxStore" GUID="cc364af0-771e-4b12-b024-812f1c025e4e" AlwaysEvaluate="True"/>
								</Setting>
							</Object>
						</Object>
						<!-- Also, let's check whether the Information Store service is stopped on this server -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='MSExchangeIS'">
							<Setting Key1="Started">
								<Rule Name="fStoreStopped" Query="$.='False'" Error="Warning" Sev="2" Title="Store service is stopped" Text="The store service on server {2} is not running. This can cause messages to queue when they are destined to databases with message journaling is enabled." S2="%varExName%"/>
							</Setting>
						</Object>

						<Rule Name="szMADLJournaling" Query="'MADLJournaling'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fJournalPotentialIssueAtLeastOne,string(@Title),$szExNoErrorStateText)" Title="A potential issue with message journaling was identified" AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No issue with message journaling was identified"/>
						<Rule Name="szMADLJournalingResult" Query="string(@Title)" Title="Message Journaling Check Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fCatRetryableHardErrorEvents" Query="$fEvt9035WithinLast24hours or ($fEvt9003WithinLast24hours and $fEvt9004WithinLast24hours and $fEvt6004WithinLast24hours)" AlwaysEvaluate="True">
							<Variable Name="varCatRetryableHardErrorEvents" Scope="Global"/>
						</Rule>
						<Rule Name="fJournalPotentialIssueAtLeastOne" Query="$fEvt9003WithinLast24hours or $fEvt9004WithinLast24hours or $fEvt9035WithinLast24hours or $fEvt6004WithinLast24hours or $fStdJournalingRecipDeleted or $fStdJournalingRecipNoNickname or $fStdJournalingRecipDisabled or $fStoreStopped" AlwaysEvaluate="True"/>
						<Rule Name="fJournalingRecipIssueProbableRootCause" Query="(($fEvt9003WithinLast24hours and $fEvt9004WithinLast24hours) or ($fEvt9035WithinLast24hours and $fEvt6004WithinLast24hours)) and $fDestHomeMDB" Error="Error" Sev="1" ReportIssue="RootCause" Title="Probable message journaling recipient problems" Text="The tool has determined that journaling recipient problems are probably causing the 'Messages awaiting directory lookup' queue issue at server {2}." S2="%varExName%" GUID="116423b4-e142-4327-b375-be34fb71f27f" AlwaysEvaluate="True"/>
						<Rule Name="fJournalingRecipIssuePotentialRootCause" Query="not ($fJournalingRecipIssueProbableRootCause) and ((($fEvt9003WithinLast24hours and $fEvt9004WithinLast24hours) or ($fEvt9035WithinLast24hours and $fEvt6004WithinLast24hours)) and ($fStdJournalingRecipDeleted or $fStdJournalingRecipNoNickname or $fStdJournalingRecipDisabled))" Error="Error" Sev="1" ReportIssue="RootCause" Title="Potential message journaling recipient problems" Text="The tool has determined that journaling recipient problems may be causing the 'Messages awaiting directory lookup' queue issue at server {2}." S2="%varExName%" GUID="116423b4-e142-4327-b375-be34fb71f27f" AlwaysEvaluate="True"/>
						<Rule Name="fJournalingStoreIssuePotentialRootCause" Query="$fEvt9003WithinLast24hours and $fStoreStopped" Error="Error" Sev="1" ReportIssue="RootCause" Title="Potential message journaling and store service problems" Text="The tool has determined that message journaling problems may be causing the 'Messages awaiting directory lookup' queue issue at server {2}. The store service needs to be running when routing messages to servers with message journaling enabled." S2="%varExName%" GUID="5080460e-f3f1-43b7-b772-c1fa362acf66" AlwaysEvaluate="True"/>
						<Rule NextStep="DisplayResultsStep" Name="fDisplayMADLJournalingStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MADLPermission" Title="Check Permissions" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varConfigDN%" Substitution="varConfigDN" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varAllCommonHomeServer%" Substitution="varAllCommonHomeServer" Display="Hide"/>
			<Setting Key1="%varAllCommonHomeMDB%" Substitution="varAllCommonHomeMDB" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varCatRetryableHardErrorEvents%" Substitution="varCatRetryableHardErrorEvents" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Possible Permissions Problems" Text="Please wait while the tool checks whether there are any permissions problems." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Permissions" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="If" Name="%varExName%" Key1="true()" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Get the the datetime of exactly 24 hours ago in the yyyyMMddHHmmss.000000+000 format as this format is faster for a WMI query -->
						<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
						<!-- Let's check there are events 929, 9003 and 9004 -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=929 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt929WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="A categorizer error event (ID: {9}) was logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" S8="%EVTTIME%" S9="929"/>
							</Setting>
							<Rule Name="fEvt929orCatRetryableHardErrorEvents" Query="$fEvt929WithinLast24hours or @S1='1'" S1="%varCatRetryableHardErrorEvents%" AlwaysEvaluate="True"/>
						</Object>

						<!-- Let's check if there are any mail flow related objects with permissions inheritance blocked -->
						<!-- This block is a 'mail flow' subset of ExBPA.Permissions.xml with some modifications made so that substitutions and variables work -->
						<!-- // Verify that permissions inheritance has not been disabled on the Microsoft Exchange container -->
						<Object Type="Directory" Key2="cn=Microsoft Exchange,cn=Services,%varConfigDN%">
							<Setting Key1="distinguishedName" Substitution="DN"/>
							<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
								<Rule Name="fInhBlockExchangeContainer" Template="tInhBlockConfig" ReportIssue="Issue"/>
							</Setting>

							<!-- // Verify that permissions inheritance has not been disabled on the Exchange Organization container -->
							<Object Type="Directory" Key2="%varExOrgDN%">
								<Setting Key1="distinguishedName" Substitution="DN"/>
								<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
									<Rule Name="fInhBlockOrgContainer" Template="tInhBlockConfig" ReportIssue="Issue"/>
								</Setting>

								<!-- // Verify that permissions inheritance has not been disabled on any Admin Group object -->
								<Object Type="Directory" Key2="cn=Administrative Groups,%DN%" Key3="(&amp;(objectCategory=msExchAdminGroup)(cn=*))" Key4="OneLevel">
									<Setting Key1="distinguishedName" Substitution="DN"/>
									<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
										<Rule Name="fInhBlockAdminGroup" Template="tInhBlockConfig" ReportIssue="Issue"/>
									</Setting>

									<!-- // Verify that permissions inheritance has not been disabled on any Routing Group object -->
									<Object Type="Directory" Key2="cn=Routing Groups,%DN%" Key3="" Key4="OneLevel">
										<Setting Key1="distinguishedName" Substitution="DN"/>
										<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
											<Rule Name="fInhBlockRoutingGroup" Template="tInhBlockConfig" ReportIssue="Issue"/>
										</Setting>

										<!-- // Verify that permissions inheritance has not been disabled on the Connections container under the Routing Group object -->
										<Object Type="Directory" Key2="cn=Connections,%DN%">
											<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
												<Rule Name="fInhBlockConnectionsContainer" Template="tInhBlockConfig" ReportIssue="Issue"/>
											</Setting>
										</Object>
									</Object>

									<!-- // Verify that permission inheritance has not been disabled on any Servers container under the Admin Group object -->
									<Object Type="Directory" Key2="cn=Servers,%DN%">
										<Setting Key1="distinguishedName" Substitution="DN"/>
										<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
											<Rule Name="fInhBlockServersContainer" Template="tInhBlockConfig" ReportIssue="Issue"/>
										</Setting>

										<!-- // Verify that permission inheritance has not been disabled on any Exchange Server object -->
										<Object Type="Directory" Key2="%DN%" Key3="(&amp;(objectCategory=msExchExchangeServer)(cn=*))" Async="100">
											<Setting Key1="distinguishedName" Substitution="DN"/>
											<Setting Key1="cn">
												<Rule Name="szRemoteServerName" Query="lower-case($.)"/>
											</Setting>
											<Setting Key1="legacyExchangeDN">
												<Rule Name="fDestHomeServer" Query="$fInhBlockExchangeServer and contains(upper-case(@S4), upper-case($.))" Error="Error" Sev="1" ReportIssue="Issue" Title="Messages backing up on server {1} are addressed to a server with a permissions problem" Text="One or more messages in the 'Messages awaiting directory lookup' queue on server {1} are addressed to server {2}. Server {2} appears to have an inherited permissions problem." S1="%varExName%" P2="$szRemoteServerName" S4="%varAllCommonHomeServer%"/>
											</Setting>
											<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
												<Rule Name="fInhBlockExchangeServer" Template="tInhBlockConfig" ReportIssue="Issue" Text="Access control list (ACL) inheritance is blocked for '{3}'. This security setting will cause messages destined to this server ({2}) to queue on other servers. Follow Microsoft Knowledge Base article 264733 and use the Active Directory Sites and Services program to re-enable inheritance on this object." P2="$szRemoteServerName"/>
											</Setting>

											<!-- // Verify that permission inheritance has not been disabled on the InformationStore object -->
											<Object Type="Directory" Key2="cn=InformationStore,%DN%">
												<Setting Key1="distinguishedName" Substitution="DN">
													<Rule Name="fDestHomeMDB" Query="$fInhBlockInformationStore and contains(upper-case(@S4), upper-case($.))" Error="Error" Sev="1" ReportIssue="Issue" Title="Messages backing up on server {1} are addressed to a mailbox store with a permissions problem" Text="One or more messages in the 'Messages awaiting directory lookup' queue on server {1} are addressed to the mailbox store '{3}' on server {2}. This mailbox store appears to have an inherited permissions problem." S1="%varExName%" P2="$szRemoteServerName" P3="$." S4="%varAllCommonHomeMDB%"/>
												</Setting>
												<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
													<Rule Name="fInhBlockInformationStore" Template="tInhBlockConfig" ReportIssue="Issue"/>
												</Setting>

												<!-- // Verify that permission inheritance has not been disabled on any Storage Group object -->
												<Object Type="Directory" Key2="%DN%" Key3="objectClass=msExchStorageGroup">
													<Setting Key1="distinguishedName" Substitution="DN"/>
													<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
														<Rule Name="fInhBlockSG" Template="tInhBlockConfig" ReportIssue="Issue"/>
													</Setting>

													<!-- // Verify that permission inheritance has not been disabled on any database object -->
													<Object Type="Directory" Key2="%DN%" Key3="objectClass=msExchMDB">
														<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
															<Rule Name="fInhBlockMDB" Template="tInhBlockConfig" ReportIssue="Issue"/>
														</Setting>
													</Object>
												</Object>
											</Object>

											<!-- // Verify that permission inheritance has not been disabled on the System Attendant object -->
											<Object Type="Directory" Key2="cn=Microsoft System Attendant,%DN%">
												<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
													<Rule Name="fInhBlockMAD" Template="tInhBlockConfig" ReportIssue="Issue"/>
												</Setting>
											</Object>

											<!-- // Verify that permission inheritance has not been disabled on the Protocols container -->
											<Object Type="Directory" Key2="cn=Protocols,%DN%">
												<Setting Key1="distinguishedName" Substitution="DN"/>
												<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
													<Rule Name="fInhBlockProtocolsContainer" Template="tInhBlockConfig" ReportIssue="Issue"/>
												</Setting>

												<!-- // Verify that permission inheritance has not been disabled on SMTP protocol container -->
												<Object Type="Directory" Key2="cn=SMTP,%DN%">
													<Setting Key1="distinguishedName" Substitution="DN"/>
													<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
														<Rule Name="fInhBlockSMTPProtocol" Template="tInhBlockConfig" ReportIssue="Issue"/>
													</Setting>

													<!-- // Verify that permission inheritance has not been disabled on any virtual server instance -->
													<Object Type="Directory" Key2="%DN%" Key3="objectCategory=protocolCfgSMTPServer">
														<Setting Key1="adminDisplayName" Substitution="SMTPVSI"/>
														<Setting Key1="ntSecurityDescriptor" Format="SecurityDescriptor" NotForExport="True">
															<Rule Name="fInhBlockSMTPVSI" Template="tInhBlockConfig" ReportIssue="Issue"/>
														</Setting>
													</Object>
												</Object>
											</Object>
										</Object>
									</Object>
								</Object>
							</Object>
						</Object>

						<Rule Name="szMADLPermission" Query="'MADLPermission'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fPermissionsIssueProbableRootCause or $fPermissionsIssuePotentialRootCause ,string(@Title),$szExNoErrorStateText)" Title="A potential permissions issue was identified" AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No permissions issue was identified"/>
						<Rule Name="szMADLPermissionResult" Query="string(@Title)" Title="Permissions Problems Check Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fInhBlockAtLeastOne" Query="$fInhBlockExchangeContainer or $fInhBlockOrgContainer or $fInhBlockAdminGroup or $fInhBlockRoutingGroup or $fInhBlockConnectionsContainer or $fInhBlockServersContainer or $fInhBlockExchangeServer or $fInhBlockInformationStore or $fInhBlockSG or $fInhBlockMDB or $fInhBlockMAD or $fInhBlockProtocolsContainer or $fInhBlockSMTPProtocol or $fInhBlockSMTPVSI" AlwaysEvaluate="True"/>
						<Rule Name="fPermissionsIssueProbableRootCause" Query="$fEvt929orCatRetryableHardErrorEvents and ($fDestHomeServer or $fDestHomeMDB)" Error="Error" Sev="1" ReportIssue="RootCause" Title="Probable permissions problems" Text="The tool has determined that permissions problems on one or more objects used by Exchange is probably causing the 'Messages awaiting directory lookup' queue issue at server {2}." S2="%varExName%" GUID="9d0f26eb-a6f3-4e67-99ec-bbe0a39347d7" AlwaysEvaluate="True"/>
						<Rule Name="fPermissionsIssuePotentialRootCause" Query="not ($fPermissionsIssueProbableRootCause) and $fEvt929orCatRetryableHardErrorEvents and $fInhBlockAtLeastOne" Error="Error" Sev="1" ReportIssue="RootCause" Title="Potential permissions problems" Text="The tool has determined that permissions problems on one or more objects used by Exchange may be causing the 'Messages awaiting directory lookup' queue issue at server {2}." S2="%varExName%" GUID="9d0f26eb-a6f3-4e67-99ec-bbe0a39347d7" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayMADLPermissionStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="LDInitialCheck" Title="Local Delivery Initial Check" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varExDN%" Substitution="varExDN" Display="Hide"/>
			<Setting Key1="%varLDLinkName%" Substitution="varLDLinkName" Display="Hide"/>
			<Setting Key1="%varRemoteDeliveryBackedUp%" Substitution="varRemoteDeliveryBackedUp" Display="Hide"/>
			<Setting Key1="%varIsExchange2003%" Substitution="varIsExchange2003" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>
			<Setting Key1="%varAllLDMailboxNames%" Substitution="varAllLDMailboxNames" Display="Hide"/>
			<Setting Key1="%varMonadDCParameter%" Substitution="varMonadDCParameter" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of the Local Delivery Queue" Text="Please wait while the tool performs initial analysis of the 'Local delivery' queue on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="If" Name="MapiConnectivityCheck" Key1="'%varIsExchange2007orLater%'='1'">
					<!-- Check if logon to each database on server succeeds -->
					<Object Type="Group" Name="Mailbox Server Role Database Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
						<Object Type="Cache" Name="MailboxList" Key1="Add" Key2="MailboxNames" Key3="%varAllLDMailboxNames%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
							<Setting Key1="MailboxName" Substitution="MBNAME"/>

							<Object Type="MonadCommand" Name="Server" Key1="test-MapiConnectivity -Server %MBNAME% -PerConnectionTimeout 120 %varMonadDCParameter%">
								<Rule Name="szExceptionText" Query="../Exception/@Message"/>
								<Rule Name="fFatalMonadError" Query="../Exception" Error="Error" Sev="1" Title="Error executing Exchange Management Shell command. Aborting SMTP queue analysis" Text="Unable to query the queue settings on server {2}. User credentials may be incorrect, or there may be a problem with the PowerShell service on that computer. Error message: {1}" P1="$szExceptionText" S2="%MBNAME%" AlwaysEvaluate="True"/>
								<Setting Key1="StorageGroup" Substitution="SG"/>
								<Setting Key1="Database" Substitution="DB"/>
								<Setting Key1="Error" Substitution="ERROR">
									<Rule Name="szError" Query="$."/>
								</Setting>
								<Setting Key1="Result" Substitution="RESULT"/>
								<Setting Key1="Result.Value" Format="Enum">
									<Rule Name="fMapiConnectivityResultUnknown" Query="$.='0'" Error="None" Title="Test-MapiConnectivity unknown for mailbox database '{3}\{4}'" Text="Result of Test-MapiConnectivity for mailbox database {3}\{4} on server {2} was '{6}' with Error='{5}'." S2="%MBNAME%" S3="%SG%" S4="%DB%" S5="%ERROR%" S6="%RESULT%"/>
									<Rule Name="fMapiConnectivityResultSuccess" Query="$.='1'" Error="None" Title="Test-MapiConnectivity success for mailbox database '{3}\{4}'" Text="Result of Test-MapiConnectivity for mailbox database {3}\{4} on server {2} was '{6}'." S2="%MBNAME%" S3="%SG%" S4="%DB%" S6="%RESULT%"/>
									<Rule Name="fMapiConnectivityResultFailure" Query="$.='2'" Error="Error" Sev="1" ReportIssue="Issue" Title="Test-MapiConnectivity failure for mailbox database '{3}\{4}'" Text="Result of Test-MapiConnectivity for mailbox database {3}\{4} on server {2} was '{6}' with Error='{5}'." S2="%MBNAME%" S3="%SG%" S4="%DB%" S5="%ERROR%" S6="%RESULT%"/>
									<!-- Bug Bug, this Rule is not localizable because test-mapiconnectivity Error doesn't return an enum. The code may be changed and we want to capture this rule. -->
									<Rule Name="fMapiResultDatabaseDismounted" Query="$fMapiConnectivityResultFailure and contains($szError,'dismounted')" Error="None" ReportIssue="Recommendation" Title="Mount the mailbox database" Text="Dismounted databases can be mounted within the Exchange Management Shell by issuing the command &quot;mount-database -Identity '{2}\{3}\{4}'&quot;. It is important for this service to be running in order to deliver messages." S2="%MBNAME%" S3="%SG%" S4="%DB%" AlwaysEvaluate="True"/>
								</Setting>
							</Object>
							<Object Type="MonadCommand" Name="Server" Key1="Get-PublicFolderDatabase -Server %MBNAME% -Status %varMonadDCParameter%">
								<Setting Key1="Name" Substitution="PUBLICDBNAME"/>
								<Setting Key1="StorageGroupName" Substitution="PUBLICDBSGNAME"/>
								<Setting Key1="Mounted">
									<Rule Name="fE12PublicStoreNotMounted" Query="$.='False'" Error="Error" Sev="2" ReportIssue="RootCause" Title="Public Folder database not mounted" Text="The public folder database '{3}\{4}' on server {2} is not mounted. Dismounted databases can be mounted within the Exchange Management Shell by issuing the command &quot;mount-database -Identity '{2}\{3}\{4}'&quot;." S2="%MBNAME%" S3="%PUBLICDBSGNAME%" S4="%PUBLICDBNAME%"/>
								</Setting>
							</Object>
						</Object>
					</Object>

					<Object Type="Group" Name="Post-Analysis Rules" Display="Hide">
						<Rule Name="szCheckMapiConnectivity" Query="'LDInitialCheck'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fMapiConnectivityResultFailure,string(@Title),$szExNoErrorStateText)" Title="MAPI connectivity test failed." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No MAPI connectivity problems."/>
						<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Initial Local Delivery Analysis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>
						<Rule NextStep="DisplayResultsStep" Name="fDisplayLDInitialCheckStatus" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
						<Rule NextStep="LDCheckStoreService" Name="fGotoLDCheckStoreService" Query="$fMapiConnectivityResultFailure" Priority="2" Text="- Check Microsoft Exchange Information Store service of mailbox servers" Display="Hide" AlwaysEvaluate="True"/>
					</Object>
				</Object>

				<Object Type="If" Name="Basic Checks" Key1="not('%varIsExchange2007orLater%'='1')">
					<Object Type="Group" Name="Local Server Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
						<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
							<!-- Let's begin with some basic checks such as whether the store service is up and running -->
							<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='MSExchangeIS'">
								<Setting Key1="Started">
									<Rule Name="fStoreStopped" Query="$.='False'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not started" Text="The '{0}' service on server {2} is not started. Messages will not be delivered to mailboxes on this server and users will be unable to access resources." S0="MSExchangeIS" S2="%varExName%"/>
								</Setting>
								<Setting Key1="State">
									<Rule Name="fStoreNotRunning" Query="not($.='Running') and not($fStoreStopped)" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="The '{0}' service on server {2} is not running. Messages will not be delivered to mailboxes on this server and users will be unable to access resources.  Current service state: {3}" S0="MSExchangeIS" S2="%varExName%" P3="$."/>
								</Setting>
							</Object>
							<!-- Next, we check whether any stores are dismounted -->
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=InformationStore,%varExDN%" Key3="(|(objectCategory=msExchPrivateMDB)(objectCategory=msExchPublicMDB))">
								<Setting Key1="cn">
									<Rule Name="szMDBCN" Query="$."/>
								</Setting>
								<Setting Key1="distinguishedName" Substitution="MDBDN"/>
								<Setting Key1="objectCategory">
									<Rule Name="szMDBType" Query="if (starts-with($., 'CN=ms-Exch-Private-MDB'), string(@Title), $szMDBPF)" Title="Mailbox store"/>
									<Rule Name="szMDBPF" Query="string(@Title)" Title="Public store"/>
								</Setting>
								<Setting Key1="objectGUID" Format="System.Guid" Substitution="MDBGUID" SubstitutionFormat="System.Guid"/>
								<Object Type="MdbAdmin" Key1="%varExName%" Key2="ListMdbStatus" Key3="%MDBGUID%">
									<Rule Name="fErrorAccessMDB" Query="../Exception" Title="Error accessing store information" Text="Error accessing information of {0} '{3}' on server {2}. Error message: {1}." P0="lower-case($szMDBType)" P1="../Exception/@Message" S2="%varExName%" P3="$szMDBCN"/>
									<Setting Key1="Status">
										<Rule Name="fMDBDismounted" Query="$.='0'" Error="Error" Sev="1" ReportIssue="Issue" Title="{1} dismounted" Text="{1} '{3}' on server {2} is dismounted. This store needs to be mounted in order for messages to be delivered to it." P1="$szMDBType" S2="%varExName%" P3="$szMDBCN"/>
										<Rule Name="fMDBMounted" Query="$.='1'" Error="None" Title="{1} mounted" Text="{1} '{3}' on server {2} is mounted." P1="$szMDBType" S2="%varExName%" P3="$szMDBCN"/>
									</Setting>
								</Object>
								<!-- Also, let's check if any SMTP system mailbox objects are missing -->
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Connections,%varExOrgDN%" Key3="(&amp;(objectCategory=mailGateway)(homeMDB=%MDBDN%))">
									<Setting Key1="distinguishedName">
										<Rule Name="szSMTPMBXDN" Query="$." Error="None" Title="SMTP system mailbox found" Text="{1} '{3}' on server {2} has the corresponding SMTP system mailbox object '{4}'." P1="$szMDBType" S2="%varExName%" P3="$szMDBCN" P4="$."/>
									</Setting>
									<Rule Name="fSMTPMBXMissing" Query="not (../Exception) and count ($szSMTPMBXDN) &lt;1" Error="Error" Sev="2" ReportIssue="Issue" Title="Missing SMTP system mailbox" Text="{1} '{3}' on server {2} does not appear to have a corresponding SMTP system mailbox object in Active Directory. This may cause messages to back up in the 'Local delivery' queue." P1="$szMDBType" S2="%varExName%" P3="$szMDBCN" AlwaysEvaluate="True"/>
								</Object>
							</Object>

							<Rule Name="szLDInitialCheck" Query="'LDInitialCheck'">
								<Variable Name="varPreviousName" Scope="Children"/>
							</Rule>
							<Rule Name="szLDErrorStateText" Query="if($fLDBasicIssueFound, string(@Title), $szExNoErrorStateText)" Title="A potential issue that may affect the 'Local delivery' queue was identified" AlwaysEvaluate="True">
								<Variable Name="varErrorStateText" Scope="Global"/>
							</Rule>
							<Rule Name="szLDNoErrorStateText" Query="string(@Title)" Title="No issues that may affect 'Local delivery' queue were identified"/>
							<Rule Name="szLDInitialCheckResult" Query="string(@Title)" Title="Local Delivery Queue Initial Analysis Results">
								<Variable Name="varDisplayTitle" Scope="Global"/>
							</Rule>

							<Rule Name="fLDBasicIssueFound" Query="$fStoreStopped or count ($fMDBDismounted) &gt;1" AlwaysEvaluate="True"/>
							<Rule Name="fLDFailHard" Query="$fStoreStopped" AlwaysEvaluate="True"/>

							<Rule Name="szProbLinkName" Query="string('%varLDLinkName%')">
								<Variable Name="varProbLinkName" Scope="Children"/>
							</Rule>
							<Rule Name="szProbLinkLongName" Query="string(@Title)" Title="Local delivery">
								<Variable Name="varProbLinkLongName" Scope="Children"/>
							</Rule>
							<Rule Name="szGroupingClass" Query="'Local Server Status'">
								<Variable Name="varGroupingClass" Scope="Children"/>
							</Rule>

							<Rule NextStep="DisplayResultsStep" Name="fDisplayLDInitialCheckStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
							<Rule NextStep="LDCheckEventLog" Name="fGotoLDCheckEventLog" Query="not ($fLDFailHard)" Priority="2" Text="- Check event logs for known 'Local delivery' queue issues" Display="Hide" AlwaysEvaluate="True"/>
							<Rule NextStep="RecipientCheck" Name="fGotoRecipientCheck" Query="not ($fLDFailHard) and @S1='1'" Priority="3" Text="- Check whether there are common destinations shared by messages in the 'Local delivery' queue (this step is conducted only when the server is running Exchange Server 2003)" S1="%varIsExchange2003%" Display="Hide" AlwaysEvaluate="True"/>
							<Rule NextStep="LDCheckKnownIssue" Name="fGotoLDCheckKnownIssue" Query="not ($fLDFailHard)" Priority="3" Text="- Check various server configuration for known 'Local delivery' queue issues" Display="Hide" AlwaysEvaluate="True"/>
							<Rule NextStep="MADLDLCheck" Name="fGotoMADLDLCheck" Query="true()" Priority="5" Text="- Check if distribution group expansions are related to the mail flow issue" Display="Hide" AlwaysEvaluate="True"/>
							<Rule NextStep="CheckRegtrace" Name="fGotoCheckRegtrace" Query="true()" Priority="7" Text="- Check whether regtrace is left enabled" Display="Hide" AlwaysEvaluate="True"/>
							<Rule NextStep="CheckAV" Name="fGotoCheckAV" Query="true()" Priority="7" Text="- Check antivirus settings that may have impacts on mail flows" Display="Hide" AlwaysEvaluate="True"/>
							<Rule NextStep="CheckSMTPDisk" Name="fGotoCheckSMTPDisk" Query="true()" Priority="7" Text="- Check the performance of disks used by the SMTP instance" Display="Hide" AlwaysEvaluate="True"/>
							<Rule NextStep="CheckDCGCAvailability" Name="fGotoCheckDCGCAvailability" Query="true()" Priority="9" Text="- Check Active Directory availability" Display="Hide" AlwaysEvaluate="True"/>
							<Rule NextStep="CheckDNSAvailability" Name="fGotoCheckDNSAvailability" Query="@S1!='1'" Priority="9" Text="- Check DNS availability" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
							<Rule NextStep="CheckDomainRouting" Name="fGotoCheckDomainRouting" Query="@S1!='1'" Priority="9" Text="- Check the domain routing information stored in recipient policies, connectors and the metabase" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
						</Object>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="LDCheckEventLog" Title="Check Event Log" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Event Logs" Text="Please wait while the tool checks whether there are known events in the event logs on server {2} that are related to 'Local delivery' queue issues." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Local Server Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="If" Name="%varExName%" Key1="true()" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Get the the datetime of exactly 24 hours ago in the yyyyMMddHHmmss.000000+000 format as this format is faster for a WMI query -->
						<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
						<!-- Let's look if the specified event log contains any relevant events -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=326 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="Category"/>
							<Setting Key1="CategoryString">
								<Rule Name="szEvt326Category" Query="$."/>
							</Setting>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- "/>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="fEvt326WithinLast24hours" Query="true()" Error="Warning" Sev="2" Title="{3} error event logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Event description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt326Category" S8="%EVTTIME%" S9="326"/>
							</Setting>
						</Object>
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="Logfile='Application' AND EventCode=327 AND SourceName='MSExchangeTransport' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1" TrackProgress="TrackProgress">
							<Setting Key1="EventCode"/>
							<Setting Key1="Category"/>
							<Setting Key1="CategoryString">
								<Rule Name="szEvt327Category" Query="normalize-space($.)"/>
							</Setting>
							<Setting Key1="EventType"/>
							<Setting Key1="Message" Substitution="EVTMESSAGE" SubstitutionFormat="([\r\n])---- ">
								<Rule Name="fEvtPFJetRecordNotFound" Query="contains ($., 'EcLocallyDeliverMsg2') and contains ($., '-1601') and $fEvt327WithinLast24hours" Error="Error" Sev="3" ReportIssue="Issue" Title="{3} warning event with '{4}' error" Text="Server {2} encountered a '{4}' error when processing a message for local delivery during the last 24 hours. This may indicate that the public folder hierarchy on this sever is not up-to-date. Event ID: {9}. Last occurrence at {8}. Description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt327Category" S4="JET_errRecordNotFound" P8="$dEvt327LocalTime" S9="327"/>
								<Rule Name="fEvtDirNotFound" Query="contains ($., 'EcSetFileHandleProp') and contains ($., '-2147024893') and $fEvt327WithinLast24hours" Error="Error" Sev="3" ReportIssue="Issue" Title="{3} warning event with '{4}' error" Text="Server {2} encountered a '{4}' error when processing a message for local delivery during the last 24 hours. Event ID: {9}. Last occurrence at {8}. Description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt327Category" S4="COR_E_DIRECTORYNOTFOUND" P8="$dEvt327LocalTime" S9="327"/>
								<Rule Name="fEvtMAPIInvalidParam" Query="contains ($., 'EcGetMime') and contains ($., '-2147024809') and $fEvt327WithinLast24hours" Error="Error" Sev="3" ReportIssue="Issue" Title="{3} warning event with '{4}' error" Text="Server {2} encountered a '{4}' error when processing a message for local delivery during the last 24 hours. Event ID: {9}. Last occurrence at {8}. Description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt327Category" S4="MAPI_E_INVALID_PARAMETER" P8="$dEvt327LocalTime" S9="327"/>
								<Rule Name="fEvtJetTooBig2000" Query="contains ($., 'EcSetFileHandleProp') and contains ($., '-1026') and $fEvt327WithinLast24hours" Error="Error" Sev="3" ReportIssue="Issue" Title="{3} warning event with '{4}' error" Text="Server {2} encountered a '{4}' error when processing a message for local delivery during the last 24 hours. This may indicate that the format of the message is not supported. Event ID: {9}. Last occurrence at {8}. Description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt327Category" S4="JET_errRecordTooBig" P8="$dEvt327LocalTime" S9="327"/>
								<Rule Name="fEvtJetTooBig2003" Query="contains ($., 'EcLocallyDeliverMsg') and contains ($., '-1026') and $fEvt327WithinLast24hours" Error="Error" Sev="3" ReportIssue="Issue" Title="{3} warning event with '{4}' error" Text="Server {2} encountered a '{4}' error when processing a message for local delivery during the last 24 hours. This may indicate that the format of the message is not supported. Event ID: {9}. Last occurrence at {8}. Description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt327Category" S4="JET_errRecordTooBig" P8="$dEvt327LocalTime" S9="327"/>
								<Rule Name="fEvtMbxJetRecordNotFound" Query="contains ($., 'EcOpenItemForLocalDelivery') and contains ($., '-1601') and $fEvt327WithinLast24hours" Error="Error" Sev="3" ReportIssue="Issue" Title="{3} warning event with '{4}' error" Text="Server {2} encountered a '{4}' error when processing a message for local delivery during the last 24 hours. This may indicate that there is a corrupted recipient mailbox. Event ID: {9}. Last occurrence at {8}. Description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt327Category" S4="JET_errRecordNotFound" P8="$dEvt327LocalTime" S9="327"/>
								<Rule Name="fEvtMAPINotFound" Query="(contains ($., 'EcOpenAttach') or contains ($., 'EcSubmitMessage') or contains ($., 'EcOpenMessageProp')) and contains ($., '-2147221233 ') and $fEvt327WithinLast24hours" Error="Error" Sev="3" ReportIssue="Issue" Title="{3} warning event with '{4}' error" Text="Server {2} encountered a '{4}' error when processing a message for local delivery during the last 24 hours. Event ID: {9}. Last occurrence at {8}. Description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt327Category" S4="MAPI_E_NOT_FOUND" P8="$dEvt327LocalTime" S9="327"/>
								<Rule Name="fEvtMAPIFailed" Query="contains ($., 'EcGetMime') and contains ($., '-2147467259') and $fEvt327WithinLast24hours" Error="Error" Sev="3" ReportIssue="Issue" Title="{3} warning event with '{4}' error" Text="Server {2} encountered a '{4}' error when processing a message for local delivery during the last 24 hours. Event ID: {9}. Last occurrence at {8}. Description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt327Category" S4="MAPI_E_CALL_FAILED" P8="$dEvt327LocalTime" S9="327"/>
								<Rule Name="fEvtOther" Query="not ($fEvtPFJetRecordNotFound or $fEvtDirNotFound or $fEvtMAPIInvalidParam or $fEvtJetTooBig2000 or $fEvtJetTooBig2003 or $fEvtMbxJetRecordNotFound or $fEvtMAPINotFound or $fEvtMAPIFailed) and $fEvt327WithinLast24hours" Error="Warning" Sev="2" Title="{3} warning event logged within the last 24 hours" Text="There is at least one occurrence of Event ID {9} in the application log of server {2} within the last 24 hours. Last occurrence at {8}. Description: {1}" S1="%EVTMESSAGE%" S2="%varExName%" P3="$szEvt327Category" P8="$dEvt327LocalTime" S9="327"/>
							</Setting>
							<Setting Key1="Data"/>
							<Setting Key1="TimeWritten" Substitution="EVTTIME" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8">
								<Rule Name="dEvt327LocalTime" Query="'%EVTTIME%'"/>
								<Rule Name="fEvt327WithinLast24hours" Query="true()"/>
							</Setting>
						</Object>
						<Rule Name="szLDCheckEventLog" Query="'LDCheckEventLog'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fEventlogFound, string(@Title), $szExNoErrorStateText)" Title="Potentially related event log entries were found." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No relevant event log entries were found."/>
						<Rule Name="szLDCheckEventLogResult" Query="string(@Title)" Title="Local Delivery Queue Event Log Analysis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="szEvt327Type" Query="if($fEvtPFJetRecordNotFound, '1', if($fEvtDirNotFound, '2', if($fEvtMAPIInvalidParam, '3', if($fEvtJetTooBig2000, '4', if($fEvtJetTooBig2003, '5', if($fEvtMbxJetRecordNotFound, '6', if($fEvtMAPINotFound, '7', if($fEvtMAPIFailed, '8', '0'))))))))" AlwaysEvaluate="True">
							<Variable Name="varEvt327Type" Scope="Global"/>
						</Rule>

						<Rule Name="fEventlogFound" Query="$fEvt326WithinLast24hours or $fEvt327WithinLast24hours" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayLDCheckEventLogStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="LDCheckKnownIssue" Title="Check Known Local Delivery Queue Issues" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varEvt327Type%" Substitution="varEvt327Type" Display="Hide"/>
			<Setting Key1="%varIsExchange2000%" Substitution="varIsExchange2000" Display="Hide"/>
			<Setting Key1="%varIsExchange2003%" Substitution="varIsExchange2003" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Known Local Delivery Issues" Text="Please wait while the tool checks whether server {2} may be experiencing known 'Local delivery' queue issues." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Local Server Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True">
						<!-- First, check KB328870 -->
						<Object Type="Registry" Key1="%varExName%" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\Setup">
							<Setting Key1="Services" Substitution="EXCHBINPATHD" SubstitutionFormat="\\----\\"/>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\Phatq.dll'">
								<Setting Key1="Version">
									<Rule Name="fExchange2000PhatqOlder" Query="@S1='1' and substring($., 5, 4) &lt; 6329" Error="Warning" Sev="2" Title="Older {5} detected" Text="The version of {5} installed on server {2} may cause messages to public folders to queue before the hierarchy can replicate. If server {2} has been brought online recently, follow Microsoft Knowledge Base article 328870 and apply the latest service pack and roll-up. Installed file version: {6}." S1="%varIsExchange2000%" S2="%varExName%" S5="PHATQ.DLL" P6="$."/>
								</Setting>
							</Object>
							<Object Type="Registry" Key1="%varExName%" Key3="System\CurrentControlSet\Services\SMTPSvc\Parameters">
								<Setting Key1="__KEYPATH">
									<Rule Name="fMissingHierarchy" Query="@S0='1' and ($fExchange2000PhatqOlder or $fIgnorePFTimeLimitLessThanTwoDays)" Error="Error" Sev="2" ReportIssue="RootCause" Title="Public folder store possibly without up-to-date hierarchy" Text="Messages may be stuck in the 'Local delivery' queue on server {2} due to an incomplete public folder hierarchy. Please ensure that messages are not routed to this server before the hierarchy replication is complete and server {2} is receiving replication messages." S0="%varEvt327Type%" S2="%varExName%" AlwaysEvaluate="True"/>
								</Setting>
								<Setting Key1="IgnorePFTimeLimit">
									<Rule Name="fIgnorePFTimeLimitLessThanTwoDays" Query="count($.) &lt;2" Error="Warning" Sev="2" Title="IgnorePFTimeLimit value set to less than two days" Text="The SMTP IgnorePFTimeLimit value on server {2} has been manually set and it is less than the default value of 2. Current value: {9}." S2="%varExName%" P9="$." GUID="6198f999-4337-4487-bbb8-077c2e205d43"/>
								</Setting>
							</Object>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\Store.exe'">
								<Setting Key1="Version">
									<!-- KB823491(2000) and KB823494(2003) -->
									<Rule Name="fExchange2000FailedConversion" Query="@S0='3' and @S1='1' and substring($., 5, 4) &lt; 6493" Error="Error" Sev="2" ReportIssue="RootCause" Title="Possible content conversion failure" Text="It appears that content conversion failures may be causing the 'Local delivery' queue issue at server {2}. Follow Microsoft Knowledge Base article 328870 and apply the latest service pack and roll-up. Installed file version: {6}." S0="%varEvt327Type%" S1="%varIsExchange2000%" S2="%varExName%" P6="$."/>
									<Rule Name="fExchange2003FailedConversion" Query="@S0='3' and @S1='1' and (substring($., 5, 4) &lt; 6980 or (substring($., 5, 4) = '6980' and substring-after($., substring($., 5, 5)) &lt; 15))" Error="Error" Sev="2" ReportIssue="RootCause" Title="Possible content conversion failure" Text="It appears that content conversion failures may be causing the 'Local delivery' queue issue at server {2}. Follow Microsoft Knowledge Base article 328870 and apply the latest service pack and roll-up. Installed file version: {6}." S0="%varEvt327Type%" S1="%varIsExchange2003%" S2="%varExName%" P6="$."/>
									<!-- KB826134(2000) and KB896363(2003) -->
									<Rule Name="fExchange2000JetTooBig" Query="@S0='4' and @S1='1' and substring($., 5, 4) &lt; 6521" Error="Error" Sev="2" ReportIssue="RootCause" Title="Possible JET_errRecordTooBig error" Text="Messages causing JET_errRecordTooBig errors may be stuck in the 'Local delivery' queue on server {2}. Follow Microsoft Knowledge Base article 826134 and apply the latest service pack and roll-up. Installed file version: {6}." S0="%varEvt327Type%" S1="%varIsExchange2000%" S2="%varExName%" P6="$."/>
									<Rule Name="fExchange2003JetTooBig" Query="@S0='5' and @S1='1' and (substring($., 5, 4) &lt; 7233 or (substring($., 5, 4) = '7233' and substring-after($., substring($., 5, 5)) &lt; 28))" Error="Error" Sev="2" ReportIssue="RootCause" Title="Possible JET_errRecordTooBig error" Text="Messages causing JET_errRecordTooBig errors may be stuck in the 'Local delivery' queue on server {2}. Follow Microsoft Knowledge Base article 896363 and apply the latest service pack and roll-up. Installed file version: {6}." S0="%varEvt327Type%" S1="%varIsExchange2003%" S2="%varExName%" P6="$."/>
									<!-- KB908062 -->
									<Rule Name="fExchange2003ecBufferTooSmall" Query="@S0='8' and @S1='1' and (substring($., 5, 4) &lt; 7233 or (substring($., 5, 4) = '7233' and substring-after($., substring($., 5, 5)) &lt; 59))" Error="Error" Sev="2" ReportIssue="RootCause" Title="Possible migrated mailbox issue" Text="Messages from migrated mailboxes may be stuck in the 'Local delivery' queue on server {2}. Follow Microsoft Knowledge Base article 908062 to determine whether the observed symptom is the same and apply the latest service pack and roll-up. Installed file version: {6}." S0="%varEvt327Type%" S1="%varIsExchange2003%" S2="%varExName%" P6="$."/>
								</Setting>
							</Object>
						</Object>
						<!-- KB298415 -->
						<Object Type="Registry" Key1="%varExName%" Key3="System\CurrentControlSet\Services\MSExchangeIS\ParametersSystem">
							<Setting Key1="__KEYPATH">
								<Rule Name="fMissingWorkingDirError" Query="@S0='2' and count($szWorkingDirectoryDrive)=0" Error="Error" Sev="2" ReportIssue="RootCause" Title="Possible missing store working directory issue" Text="It appears that a missing working directory for the store on server {2} may be causing the 'Local delivery' queue issue at server {2}. Please follow Microsoft Knowledge Base article 298415 and specify a valid directory. Current working directory: {5}." S0="%varEvt327Type%" S2="%varExName%" P5="$szWorkingDir" AlwaysEvaluate="True"/>
								<Rule Name="fMissingWorkingDirWarning" Query="not($fMissingWorkingDirError) and count($szWorkingDirectoryDrive)=0" Error="Warning" Sev="2" Title="Missing store working directory" Text="The specified working directory for the store on server {2} does not appear to exist. This may cause messages with attachments to queue. Follow Microsoft Knowledge Base article 298415 and specify a valid folder. Current working directory: {5}." S2="%varExName%" P5="$szWorkingDir" GUID="28b658a9-2fee-4f1c-a30d-532f7b897a62" AlwaysEvaluate="True"/>
							</Setting>
							<Setting Key1="Working Directory" Substitution="WORKINGDIR" SubstitutionFormat="\\----\\">
								<Rule Name="szWorkingDir" Query="$."/>
							</Setting>
							<Object Type="WMI" Key1="%varExName%" Key3="Win32_Directory" Key4="name='%WORKINGDIR%'">
								<Setting Key1="Drive">
									<Rule Name="szWorkingDirectoryDrive" Query="$."/>
								</Setting>
							</Object>
						</Object>

						<Rule Name="szLDCheckKnownIssue" Query="'LDCheckKnownIssue'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fLDKnownIssueFound, string(@Title), $szExNoErrorStateText)" Title="A known 'Local delivery' queue issue was found." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No known 'Local delivery' queue issues were found."/>
						<Rule Name="szLDCheckKnownIssueResult" Query="string(@Title)" Title="Local Delivery Known Issues">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fLDKnownIssueFound" Query="$fExchange2000PhatqOlder or $fMissingHierarchy or $fIgnorePFTimeLimitLessThanTwoDays or $fExchange2000FailedConversion or $fExchange2003FailedConversion or $fExchange2000JetTooBig or $fExchange2003JetTooBig or $fMissingWorkingDirError or $fMissingWorkingDirWarning" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayLDCheckKnownIssueStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="LDCheckStoreService" Title="Check Microsoft Exchange Information Store Service" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varAllLDMailboxNames%" Substitution="varAllLDMailboxNames" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varIsExchange2007orLater%" Substitution="varIsExchange2007orLater" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of Mailbox Servers Store Service" Text="Please wait while the tool analyzes the mailbox servers Microsoft Exchange Information Store service that {2} is trying to connect to." S2="%varExName%">
				<Object Type="If" Name="StoreServiceCheck" Key1="'%varIsExchange2007orLater%'">
					<!-- Check if logon to each database on server succeeds -->
					<Object Type="Group" Name="Mailbox Server Role Database Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
						<Object Type="Cache" Name="MailboxList" Key1="Add" Key2="MailboxNames" Key3="%varAllLDMailboxNames%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
							<Setting Key1="MailboxName" Substitution="MBNAME">
								<Rule Name="szMailboxServer" Query="$."/>
							</Setting>
							<!-- Check whether the store service is up and running -->
							<Object Type="WMI" Key1="%MBNAME%" Key3="Win32_Service" Key4="Name='MSExchangeIS'" SecurityContext="EXLOGON">
								<Rule Name="fWMIServiceStatusException" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%MBNAME%"/>
								<Setting Key1="Started">
									<Rule Name="fStoreStarted" Query="$.='True'" Error="None" Title="'{0}' service started" Text="'{0}' service is started on server {2}." S0="MSExchangeIS" S2="%MBNAME%"/>
									<Rule Name="fStoreNotStarted" Query="$.='False'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not started" Text="'{0}' service is not started on server {2}. It is important for this service to be started to deliver messages." S0="MSExchangeIS" S2="%MBNAME%"/>
								</Setting>
								<Setting Key1="StartMode">
									<Rule Name="fStoreDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service disabled" Text="'{0}' service is disabled on server {2}. It is important for this service to be running to deliver messages." S0="MSExchangeIS" S2="%MBNAME%"/>
									<Rule Name="fStoreManual" Query="$.='Manual'" Error="Warning" Sev="2" Title="'{0}' service manual startup" Text="{0} service is set to be started manually on server {2}. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="MSExchangeIS" S2="%MBNAME%"/>
								</Setting>
								<Setting Key1="State">
									<Rule Name="fStoreNotRunning" Query="not($.='Running') and $fStoreStarted" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service is not running on server {2}. It is important for this service to be running to deliver messages. Current state: {4}" S0="MSExchangeIS" S2="%MBNAME%" P4="$."/>
								</Setting>
							</Object>
						</Object>
					</Object>
					<Rule Name="szLDCheckStoreService" Query="'LDCheckStoreService'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fPotentialCauseFound, string(@Title), $szExNoErrorStateText)" Title="A potential issue with mail delivery on the server was identified." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="More investigation necessary."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Mailbox Delivery Diagnosis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="fRootCauseFound" Query="$fStoreNotStarted or $fStoreDisabled" Error="None" ReportIssue="Recommendation" Title="Start Microsoft Exchange Information Store service on remote server" Text="Start the Microsoft Exchange Information Store service on server {2}. It is important for this service to be running in order to deliver messages." P2="$szMailboxServer" AlwaysEvaluate="True"/>
					<Rule Name="fPotentialCauseFound" Query="$fStoreNotStarted" AlwaysEvaluate="True"/>
					<Rule Name="fMoreInv" Query="not($fPotentialCauseFound or $fWMIServiceStatusException)" Error="Warning" Sev="2" ReportIssue="Summary" Title="Other root causes" Text="It appears that the Microsoft Exchange Information Store service on server {2} is started but the database did not respond. Check if there are any network errors or hung services." P2="$szMailboxServer"/>

					<Rule NextStep="DisplayResultsStep" Name="fLDCheckStoreServiceStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="PRInitialCheck" Title="Routing Queue Initial Check" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varRemoteDeliveryBackedUp%" Substitution="varRemoteDeliveryBackedUp" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of the 'Messages Waiting to Be Routed' Queue" Text="Please wait while the tool performs initial analysis of the 'Messages waiting to be routed' queue on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Messages Waiting to Be Routed Queue" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Check KB318491 issue -->
						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key4="OneLevel">
							<Setting Key1="cn" Substitution="AGCN"/>
							<Setting Key1="distinguishedName" Substitution="DN">
								<Rule Name="fServersContainerMissing" Query="not($fDirectoryServersError) and count($szServersContainerDN) &lt;1" Error="Error" Sev="2" ReportIssue="Issue" Title="Missing 'Servers' container in directory" Text="The 'Servers' container cannot be found for administrative group '{3}'. This may be causing backups in the queue. Check the results from link state analysis steps and follow the instructions outlined in Microsoft Knowledge Base article 318491." S3="%AGCN%" AlwaysEvaluate="True">
									<Variable Name="varServersContainerMissing" Scope="Global"/>
								</Rule>
							</Setting>
							<Object Type="Directory" Key1="LDAP://%varDCName%" Key2="CN=Servers,%DN%">
								<Rule Name="fDirectoryServersError" Query="../Exception/@Message"/>
								<Setting Key1="distinguishedName">
									<Rule Name="szServersContainerDN" Query="$."/>
								</Setting>
							</Object>
						</Object>
						<Rule Name="szPRInitialCheck" Query="'PRInitialCheck'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fPRInitialIssueFound,string(@Title),$szExNoErrorStateText)" Title="At least one potential issue related to the 'Messages waiting to be routed' queue was identified" AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No issues related to the 'Messages waiting to be routed' queue were identified"/>
						<Rule Name="szPRInitialCheckResult" Query="string(@Title)" Title="'Messages Waiting to Be Routed' Queue Analysis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fPRInitialIssueFound" Query="$fServersContainerMissing" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayPRInitialCheckStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="GQServerLoadCheck" Title="Server Utilization Analysis" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varRemoteDeliveryBackedUp%" Substitution="varRemoteDeliveryBackedUp" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Server Utilization" Text="Please wait while the tool checks the utilization of the server." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Server Utilization" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Steps to check whether the server is generally overloaded will go here-->
						<Object Type="Pdh" Name="ServerOverloadCheck" Key1="%varExName%" Key2="10" Key3="3" Level="1" SecurityContext="EXLOGON">
							<Rule Name="fGeneralErrorAccessPerf" Query="../Exception" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. Error message: {1}." S0="SMTP Server" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fBDBErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bdb')" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. This may be due to insufficient permissions. Error message: {1}." S0="SMTP Server" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fContactErrorAccessPerf" Query="contains(../Exception/@Message, '0x800007d0')" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Error accessing performance counters on server {2}. The server may be unavailable, or the remote registry service may not be running on that server. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fNonEngErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bb8') and @S1='1'" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Cannot access performance monitor counters. This tool must run on a U.S. English operating system." S1="%varNonEnglishOS%"/>

							<Setting Key1="SMTP Server" Key2="Messages Received/sec" Key3="_Total">
								<Rule Name="iAvgMsgReceivedSec" Query="round(10 * list-average($.)) div 10" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9}." P0="localize-path('SMTP Server(_Total)\Messages Received/sec')" P9="round(10 * list-average($.)) div 10"/>
								<Rule Name="fReceiveManyMsg" Query="$iAvgMsgReceivedSec &gt; 10" Error="Warning" Sev="2" ReportIssue="Summary" Title="Potential server overload" Text="It appears that server {2} is receiving a large number of messages. Please check if this is an expected load. The measured {0} value is {9}." P0="localize-path('SMTP Server(_Total)\Messages Received/sec')" S2="%varExName%" P9="$iAvgMsgReceivedSec"/>
							</Setting>
							<Setting Key1="SMTP Server" Key2="Messages Delivered/sec" Key3="_Total">
								<Rule Name="iAvgMsgDeliveredSec" Query="round(10 * list-average($.)) div 10" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9}." P0="localize-path('SMTP Server(_Total)\Messages Delivered/sec')" P9="round(10 * list-average($.)) div 10"/>
							</Setting>
							<Setting Key1="SMTP Server" Key2="Messages Sent/sec" Key3="_Total">
								<Rule Name="iAvgMsgSentSec" Query="round(10 * list-average($.)) div 10" Error="None" Title="Average '{0}'" Text="Average '{0}' = {9}." P0="localize-path('SMTP Server(_Total)\Messages Sent/sec')" P9="round(10 * list-average($.)) div 10"/>
								<Rule Name="fMsgNotProcessed" Query="$iAvgMsgReceivedSec &gt;0 and ($iAvgMsgDeliveredSec + $iAvgMsgSentSec) = 0" Error="Error" Sev="1" ReportIssue="Summary" Title="Messages not processed" Text="Messages are received by server {2} but they are not delivered locally or transferred to another server." S2="%varExName%"/>
								<Rule Name="fMsgSlowProcessed" Query="$iAvgMsgReceivedSec &gt;0 and ($iAvgMsgDeliveredSec + $iAvgMsgSentSec) &lt; $iAvgMsgReceivedSec * 0.75" Error="Error" Sev="2" ReportIssue="Summary" Title="Slow message processing" Text="The number of messages processed by server {2} for local or remote delivery is less than 75% of the messages it receives. This can cause messages to queue." S2="%varExName%"/>
							</Setting>
						</Object>

						<Rule Name="szGQServerLoadCheck" Query="'GQServerLoadCheck'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fServerOverLoadFound,string(@Title),$szExNoErrorStateText)" Title="A potential server overload was identified" AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No signs of server overload were identified"/>
						<Rule Name="szGQServerLoadCheckResult" Query="string(@Title)" Title="Server Utilization Check Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fServerOverLoadFound" Query="$fReceiveManyMsg and $fMsgSlowProcessed" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayServerOverLoadStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckRegtrace" Name="fGotoCheckRegtrace" Query="not($fServerOverLoadFound)" Priority="2" Text="- Check whether regtrace is left enabled" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckSMTPDisk" Name="fGotoCheckSMTPDisk" Query="not($fServerOverLoadFound)" Priority="3" Text="- Check the performance of disks used by the SMTP instance" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="MADLDLCheck" Name="fGotoCMADLDLCheck" Query="not($fServerOverLoadFound)" Priority="4" Text="- Check if distribution group expansions are related to the mail flow issue" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckAV" Name="fGotoCheckAV" Query="not($fServerOverLoadFound)" Priority="5" Text="- Check antivirus settings that may have impacts on mail flows" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckMetabase" Name="fGotoCheckMetabase" Query="not($fServerOverLoadFound) and @S1!='1'" Priority="6" Text="- Check SMTP event sink settings in metabase" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckDCGCAvailability" Name="fGotoCheckDCGCAvailability" Query="not($fServerOverLoadFound)" Priority="7" Text="- Check Active Directory availability" Display="Hide" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckDNSAvailability" Name="fGotoCheckDNSAvailability" Query="not($fServerOverLoadFound) and @S1!='1'" Priority="8" Text="- Check DNS availability" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckDomainRouting" Name="fGotoCheckDomainRouting" Query="not($fServerOverLoadFound) and @S1!='1'" Priority="9" Text="- Check the domain routing information stored in recipient policies, connectors and the metabase" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckLinkState" Name="fGotoCheckLinkState" Query="not($fServerOverLoadFound) and @S1!='1'" Priority="10" Text="- Check link state information for possible routing issues" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
						<Rule NextStep="CheckLinkStateChurn" Name="fGotoCheckLinkStateChurn" Query="not($fServerOverLoadFound) and @S1!='1'" Priority="11" Text="- Check link state version changes" Display="Hide" S1="%varRemoteDeliveryBackedUp%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckLinkState" Title="Check Link State Information" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Link State" Text="Please wait while the tool checks the link state information of server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Link State Information" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<!-- Get the datetime when we first check link state -->
					<Object Type="WMI" Key1="" Key3="Win32_OperatingSystem">
						<Setting Key1="LocalDateTime" Format="CIMDateTime">
							<Rule Name="dFirstLinkStateDateTime" Query="$.">
								<Variable Name="varFirstLinkStateDateTime" Scope="Global"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="LinkState" Name="LinkState" Key1="%varExName%">
						<Setting Key1="NodeInfo" Format="RoutingInfo"/>
						<Setting Key1="OrgInfo" Format="RoutingInfo"/>
						<Object Type="RoutingInfo" Key1="NodeInfo">
							<Setting Key1="Response"/>
						</Object>
						<Object Type="RoutingInfo" Key1="OrgInfo">
							<Setting Key1="Guid"/>
							<Setting Key1="Digest"/>
							<Object Type="RoutingInfo" Key1="Children" Key2="RoutingGroups" Class="Routing Group" GroupingClass="True">
								<Setting Key1="Guid" Substitution="RGGUID">
									<Rule Name="szRGGUID" Query="$."/>
									<Rule Name="fRGFoundInDS" Query="count($szRGDN) &gt;0" Error="None" Title="Routing group found in directory" Text="The routing group (GUID: {1}) found in the link state information maintained by server {2} was successfully resolved to the routing group object '{3}' in Active Directory." P1="$szRGGUID" S2="%varExName%" P3="$szRGDN"/>
									<Rule Name="fRGNotFoundInDS" Query="not($fDirectoryErrorRG) and count($szRGDN) &lt;1" Error="Error" Sev="3" ReportIssue="Issue" Title="Routing group not found in directory" Text="The routing group (GUID: {1}) found in the link state information maintained by server {2} cannot be resolved to an object in Active Directory. This may cause mail flow issues such as delayed non-delivery reports after staying in the 'Messages with an unreachable destination' queue." P1="$szRGGUID" S2="%varExName%" AlwaysEvaluate="True"/>
									<Rule Name="fRGNoMember" Query="$fRGFoundInDS and count ($szRGMemberGUID) &lt;1" Error="Warning" Sev="3" Title="Routing group has no member" Text="No member for routing group '{3}' was found in the link state information maintained by server {2}. This may cause mail flow issues to this routing group." S2="%varExName%" P3="$szRGCN" AlwaysEvaluate="True"/>
									<Rule Name="fRGNoConnector" Query="$fRGFoundInDS and count ($szConnectorGUID) &lt;1" Error="Warning" Sev="3" Title="Routing group has no connector" Text="No connector for routing group '{3}' was found in the link state information maintained by server {2}. This may cause mail flow issues to this routing group." S2="%varExName%" P3="$szRGCN" AlwaysEvaluate="True"/>
								</Setting>
								<Setting Key1="MasterGuid" Substitution="RGMASTERGUID">
									<Rule Name="fRGMasterFoundInDS" Query="$fRGFoundInDS and count($szRGMasterDN) &gt;0" Error="None" Title="Routing group master found in directory" Text="The routing group master (GUID: {1}) found in the link state information maintained by server {2} was successfully resolved to the Exchange server object '{4}' in Active Directory. Routing group: {3}." P1="$." S2="%varExName%" P3="$szRGCN" P4="$szRGMasterDN"/>
									<Rule Name="fRGMasterNotSpecified" Query="$fRGFoundInDS and $.='00000000-0000-0000-0000-000000000000'" Error="Warning" Sev="3" Title="Routing master not specified" Text="No routing group master has been specified for routing group '{3}'. This routing group may be isolated from other routing groups." P3="$szRGCN"/>
									<Rule Name="fRGMasterNotFoundInDS" Query="$fRGFoundInDS and not($fRGMasterNotSpecified) and (not($fDirectoryErrorRGMaster) and count($szRGMasterDN) &lt;1)" Error="Warning" Sev="2" Title="Routing group master not found in directory" Text="The routing group master (GUID: {1}) found in the link state information maintained by server {2} cannot be resolved to an object in Active Directory. Routing group: {3}. This may cause mail flow issues destined to this routing group." P1="$." S2="%varExName%" P3="$szRGCN" AlwaysEvaluate="True"/>
									<Rule Name="fRGMasterFoundForRGNotInDS" Query="$fRGNotFoundInDS and count($szRGMasterDN) &gt;0" Error="Warning" Sev="3" Title="Routing group master in deleted routing group" Text="The routing group (GUID: {1}) does not exist in Active Directory. However, the link state information maintained by server {2} displays server {4} as its routing group master." P1="$szRGGUID" S2="%varExName%" P4="$szRGMasterCN"/>
								</Setting>
								<Setting Key1="MajorVersion">
									<Rule Name="fMajorVersionZero" Query="$fRGFoundInDS and $.=0" Error="Warning" Sev="3" Title="Routing group with a major version of zero" Text="A major version of zero is shown for routing group '{3}' according to the link state information maintained by server {2}. This routing group may be isolated from others unless this site contains only Microsoft Exchange 5.5 servers." S2="%varExName%" P3="$szRGCN"/>
									<Rule Name="szRGMajorVersion" Query="$.">
										<Variable Name="varFirstRG[MajorVersion][%RGGUID%]" Scope="Global"/>
									</Rule>
								</Setting>
								<Setting Key1="MinorVersion">
									<Rule Name="szRGMinorVersion" Query="$.">
										<Variable Name="varFirstRG[MinorVersion][%RGGUID%]" Scope="Global"/>
									</Rule>
								</Setting>
								<Setting Key1="UserVersion">
									<Rule Name="szRGUserVersion" Query="$.">
										<Variable Name="varFirstRG[UserVersion][%RGGUID%]" Scope="Global"/>
									</Rule>
								</Setting>
								<Setting Key1="BootGuid"/>
								<Setting Key1="SMTPAddress"/>
								<Setting Key1="X400Address"/>
								<Setting Key1="X500Address"/>
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%RGGUID%&gt;">
									<Rule Name="fDirectoryErrorRG" Query="../Exception/@Message"/>
									<Setting Key1="cn">
										<Rule Name="szRGCN" Query="$."/>
									</Setting>
									<Setting Key1="distinguishedName">
										<Rule Name="szRGDN" Query="$."/>
									</Setting>
								</Object>
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%RGMASTERGUID%&gt;">
									<Rule Name="fDirectoryErrorRGMaster" Query="../Exception/@Message"/>
									<Setting Key1="cn">
										<Rule Name="szRGMasterCN" Query="$."/>
									</Setting>
									<Setting Key1="distinguishedName">
										<Rule Name="szRGMasterDN" Query="$."/>
									</Setting>
								</Object>
								<Object Type="RoutingInfo" Key1="Children" Key2="Members">
									<Setting Key1="Guid" Substitution="RGMEMBERGUID">
										<Rule Name="szRGMemberGUID" Query="$."/>
										<Rule Name="fRGMemberFoundInDS" Query="$fRGFoundInDS and $.!='' and count($szRGMemberDN) &gt;0" Error="None" Title="Routing group member found in directory" Text="The routing group member (GUID: {1}) found in the link state information maintained by server {2} was successfully resolved to the Exchange server object '{4}' in Active Directory. Routing group: {3}." P1="$szRGMemberGUID" S2="%varExName%" P3="$szRGCN" P4="$szRGMemberDN"/>
										<Rule Name="fRGMemberNotFoundInDS" Query="$fRGFoundInDS and $.!='' and (not($fDirectoryErrorRGMember) and count($szRGMemberDN) &lt;1)" Error="Warning" Sev="2" Title="Routing group member not found in directory" Text="The routing group member (GUID: {1}) found in the link state information maintained by server {2} cannot be resolved to an object in Active Directory. Routing group: {3}. This may cause mail flow issues destined to this routing group." P1="$szRGMemberGUID" S2="%varExName%" P3="$szRGCN" AlwaysEvaluate="True"/>
										<Rule Name="fRGMemberFoundForRGNotInDS" Query="$fRGNotFoundInDS and $.!='' and count($szRGMemberDN) &gt;0" Error="Warning" Sev="3" Title="Routing group member in deleted routing group" Text="The routing group (GUID: {1}) does not exist in Active Directory. However, the link state information maintained by server {2} displays server {4} as its member." P1="$szRGGUID" S2="%varExName%" P4="$szRGMemberCN"/>
									</Setting>
									<Setting Key1="ConnectToMaster">
										<Rule Name="fRGMemberConnectedToMaster" Query="$fRGFoundInDS and upper-case($.) = 'YES'" Error="None" Title="Routing group member node connected to master" Text="Routing group member {4} for routing group '{3}' is connected to routing group master {2}." P2="$szRGMasterCN" P3="$szRGCN" P4="$szRGMemberCN"/>
										<Rule Name="fRGMemberNotConnectedtoMaster" Query="$fRGFoundInDS and upper-case($.) = 'NO' and not(contains($szRGCN,'Exchange Routing Group (DWBGZMFD01QNBJR)'))" Error="Error" Sev="2" ReportIssue="Issue" Title="Routing group member node not connected to master" Text="Routing group member {4} for routing group '{3}' is not connected to routing group master {2}. This may cause routing failures." P2="$szRGMasterCN" P3="$szRGCN" P4="$szRGMemberCN"/>
									</Setting>
									<Setting Key1="ServerVersion"/>
									<Setting Key1="BuildVersion"/>
									<Setting Key1="Type"/>
									<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%RGMEMBERGUID%&gt;">
										<Rule Name="fDirectoryErrorRGMember" Query="../Exception/@Message"/>
										<Setting Key1="cn">
											<Rule Name="szRGMemberCN" Query="$."/>
										</Setting>
										<Setting Key1="distinguishedName">
											<Rule Name="szRGMemberDN" Query="$."/>
										</Setting>
									</Object>
								</Object>
								<Object Type="RoutingInfo" Key1="Children" Key2="Connectors">
									<Setting Key1="Guid" Substitution="CONNECTORGUID">
										<Rule Name="szConnectorGUID" Query="$."/>
										<Rule Name="fConnectorFoundInDS" Query="$fRGFoundInDS and $.!='' and count($szConnectorDN) &gt;0" Error="None" Title="Connector found in directory" Text="The connector (GUID: {1}) found in the link state information maintained by server {2} was successfully resolved to the connector object '{4}' in Active Directory. Routing group: {3}." P1="$szConnectorGUID" S2="%varExName%" P3="$szRGCN" P4="$szConnectorDN"/>
										<Rule Name="fConnectorNotFoundInDS" Query="$fRGFoundInDS and $.!='' and (not($fDirectoryErrorConnector) and count($szConnectorDN) &lt;1)" Error="Warning" Sev="2" Title="Connector contained in link state information not found in directory" Text="The connector (GUID: {1}) found in the link state information maintained by server {2} cannot be resolved to an object in Active Directory. Routing group: {3}. This may cause mail flow issues destined to this routing group." P1="$szConnectorGUID" S2="%varExName%" P3="$szRGCN" AlwaysEvaluate="True"/>
										<Rule Name="fConnectorForRGNotInDS" Query="$fRGNotFoundInDS and $.!=''" Error="Error" Sev="3" ReportIssue="Issue" Title="Possible orphaned connector" Text="The routing group (GUID: {1}) does not exist in Active Directory. However, the link state information maintained by server {2} displays a connector for this routing group. This may cause orphaned routes." P1="$szRGGUID" S2="%varExName%"/>
									</Setting>
									<Setting Key1="Type"/>
									<Setting Key1="Source"/>
									<Setting Key1="Destination"/>
									<Setting Key1="LegacyDN"/>
									<Setting Key1="SchedId"/>
									<Setting Key1="Scope"/>
									<Setting Key1="Triggered"/>
									<Setting Key1="DisallowedPriorities"/>
									<Setting Key1="MaxMessageSize"/>
									<Setting Key1="OversizedSize"/>
									<Setting Key1="PfReferral"/>
									<Setting Key1="AcceptUserByDefault">
										<Rule Name="fDeniedByDefault" Query="$fConnectorFoundInDS and $.!=1" Error="Warning" Sev="3" Title="Connector set to reject messages from everyone by default" Text="Connector '{4}' for routing group '{3}' is configured to reject messages from everyone by default. This may cause messages to queue unless restrictions are properly configured." P3="$szRGCN" P4="$szConnectorCN"/>
									</Setting>
									<Setting Key1="AuthOrig">
										<Rule Name="fAuthOrigExists" Query="$fConnectorFoundInDS and $.!=''" Error="None" Title="Connector explicitly set to accept messages from certain mailboxes" Text="Connector '{4}' for routing group '{3}' is explicitly configured to accept messages from certain mailboxes." P3="$szRGCN" P4="$szConnectorCN"/>
									</Setting>
									<Setting Key1="DenyOrig">
										<Rule Name="fDenyOrigExists" Query="$fConnectorFoundInDS and $.!=''" Error="None" Title="Connector explicitly set to reject messages from certain mailboxes" Text="Connector '{4}' for routing group '{3}' is explicitly configured to reject messages from certain mailboxes." P3="$szRGCN" P4="$szConnectorCN"/>
									</Setting>
									<Setting Key1="AuthDL">
										<Rule Name="fAuthDLExists" Query="$fConnectorFoundInDS and $.!=''" Error="Warning" Sev="3" Title="Connector explicitly set to accept messages from certain distribution groups" Text="Connector '{4}' for routing group '{3}' is explicitly configured to accept messages from certain distribution groups. This may cause messages to queue unless restrictions are properly configured." P3="$szRGCN" P4="$szConnectorCN"/>
									</Setting>
									<Setting Key1="DenyDL">
										<Rule Name="fDenyDLExists" Query="$fConnectorFoundInDS and $.!=''" Error="Warning" Sev="3" Title="Connector explicitly set to reject messages from certain distribution groups" Text="Connector '{4}' for routing group '{3}' is explicitly configured to reject messages from certain distribution groups. This may cause messages to queue unless restrictions are properly configured." P3="$szRGCN" P4="$szConnectorCN"/>
									</Setting>
									<Setting Key1="State">
										<Rule Name="fConnectorUp" Query="$fConnectorFoundInDS and upper-case($.)='UP'" Error="None" Title="Connector marked as 'UP'" Text="The status of connector '{4}' for routing group '{3}' is 'UP'." P3="$szRGCN" P4="$szConnectorCN"/>
										<Rule Name="fConnectorDown" Query="$fConnectorFoundInDS and upper-case($.)='DOWN'" Error="Warning" Sev="2" Title="Connector marked as 'DOWN'" Text="The status of connector '{4}' for routing group '{3}' is 'DOWN'. Messages cannot be routed through this connector now." P3="$szRGCN" P4="$szConnectorCN"/>
									</Setting>
									<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%CONNECTORGUID%&gt;">
										<Rule Name="fDirectoryErrorConnector" Query="../Exception/@Message"/>
										<Setting Key1="cn">
											<Rule Name="szConnectorCN" Query="$."/>
										</Setting>
										<Setting Key1="distinguishedName">
											<Rule Name="szConnectorDN" Query="$."/>
										</Setting>
									</Object>
									<Object Type="RoutingInfo" Key1="Children" Key2="Arrows">
										<Setting Key1="Type"/>
										<Setting Key1="AddressSpace">
											<Rule Name="fAddressSpaceForRGNotInDS" Query="$fRGNotFoundInDS and $.!=''" Error="Error" Sev="3" ReportIssue="Issue" Title="Possible orphaned address space" Text="The routing group (GUID: {1}) does not exist in Active Directory. However, the link state information maintained by server {2} contains address space '{3}' as a connector destination of the routing group. This may cause orphaned address space issues." P1="$szRGGUID" S2="%varExName%" P3="$."/>
										</Setting>
										<Setting Key1="Weight"/>
									</Object>
									<Object Type="RoutingInfo" Key1="Children" Key2="LocalBHs">
										<Setting Key1="Guid" Substitution="LOCALBHGUID">
											<Rule Name="fLocalBHFoundInDS" Query="$fConnectorFoundInDS and $.!='' and count($szLocalBHDN) &gt;0" Error="None" Title="Local bridgehead server found in directory" Text="The local bridgehead server (GUID: {1}) found in the link state information maintained by server {2} was successfully resolved to the SMTP virtual server object '{4}' in Active Directory. Routing group: {3}. Connector: {5}." P1="$." S2="%varExName%" P3="$szRGCN" P4="$szLocalBHDN" P5="$szConnectorCN"/>
											<Rule Name="fLocalBHNotFoundInDS" Query="$fConnectorFoundInDS and $.!='' and (not($fDirectoryErrorLocalBH) and count($szLocalBHDN) &lt;1)" Error="Warning" Sev="2" Title="Local bridgehead server not found in directory" Text="The local bridgehead server (GUID: {1}) found in the link state information maintained by server {2} cannot be resolved to an object in Active Directory. Routing group: {3}. Connector: {5}. This may cause mail flow issues destined to this connector." P1="$." S2="%varExName%" P3="$szRGCN" P5="$szConnectorCN" AlwaysEvaluate="True"/>
										</Setting>
										<Setting Key1="Available">
											<Rule Name="fLocalBHAvailable" Query="$fLocalBHFoundInDS and upper-case($.)='CONN_AVAIL'" Error="None" Title="Local bridgehead server available" Text="Local bridgehead server {4} for connector {5} (routing group: {3}) is currently available. Status: {1}." P1="$." P3="$szRGCN" P4="$szLocalBHFQDN" P5="$szConnectorCN"/>
											<Rule Name="fLocalBHNotAvailable" Query="$fLocalBHFoundInDS and upper-case($.)!='CONN_AVAIL'" Error="Warning" Sev="3" Title="Local bridgehead server not available" Text="Local bridgehead server {4} for connector {5} (routing group: {3}) is not currently available. Status: {1}. Mail flows involving this routing group may be affected." P1="$." P3="$szRGCN" P4="$szLocalBHFQDN" P5="$szConnectorCN"/>
										</Setting>
										<Setting Key1="FQDN">
											<Rule Name="szLocalBHFQDN" Query="$."/>
										</Setting>
										<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%LOCALBHGUID%&gt;">
											<Rule Name="fDirectoryErrorLocalBH" Query="../Exception/@Message"/>
											<Setting Key1="distinguishedName">
												<Rule Name="szLocalBHDN" Query="$."/>
											</Setting>
										</Object>
									</Object>
									<Object Type="RoutingInfo" Key1="Children" Key2="RemoteBHs">
										<Setting Key1="Guid" Substitution="REMOTEBHGUID">
											<Rule Name="fRemoteBHFoundInDS" Query="$fConnectorFoundInDS and $.!='' and count($szRemoteBHDN) &gt;0" Error="None" Title="Remote bridgehead server found in directory" Text="The remote bridgehead server (GUID: {1}) found in the link state information maintained by server {2} was successfully resolved to the SMTP virtual server object '{4}' in Active Directory. Routing group: {3}. Connector: {5}." P1="$." S2="%varExName%" P3="$szRGCN" P4="$szRemoteBHDN" P5="$szConnectorCN"/>
											<Rule Name="fRemoteBHNotFoundInDS" Query="$fConnectorFoundInDS and $.!='' and (not($fDirectoryErrorRemoteBH) and count($szRemoteBHDN) &lt;1)" Error="Warning" Sev="2" Title="Remote bridgehead server not found in directory" Text="The remote bridgehead server (GUID: {1}) found in the link state information maintained by server {2} cannot be resolved to an object in Active Directory. Routing group: {3}. Connector: {5}. This may cause mail flow issues destined to this connector." P1="$." S2="%varExName%" P3="$szRGCN" P5="$szConnectorCN" AlwaysEvaluate="True"/>
										</Setting>
										<Setting Key1="Available">
											<Rule Name="fRemoteBHAvailable" Query="$fRemoteBHFoundInDS and upper-case($.)='CONN_AVAIL'" Error="None" Title="Remote bridgehead server available" Text="Remote bridgehead server {4} for connector {5} (routing group: {3}) is currently available. Status: {1}." P1="$." P3="$szRGCN" P4="$szRemoteBHFQDN" P5="$szConnectorCN"/>
											<Rule Name="fRemoteBHNotAvailable" Query="$fRemoteBHFoundInDS and upper-case($.)!='CONN_AVAIL'" Error="Warning" Sev="3" Title="Remote bridgehead server not available" Text="Remote bridgehead server {4} for connector {5} (routing group: {3}) is not currently available. Status: {1}. Mail flows involving this routing group may be affected." P1="$." P3="$szRGCN" P4="$szRemoteBHFQDN" P5="$szConnectorCN"/>
										</Setting>
										<Setting Key1="FQDN">
											<Rule Name="szRemoteBHFQDN" Query="$."/>
										</Setting>
										<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%REMOTEBHGUID%&gt;">
											<Rule Name="fDirectoryErrorRemoteBH" Query="../Exception/@Message"/>
											<Setting Key1="cn">
												<Rule Name="szRemoteBHCN" Query="$."/>
											</Setting>
											<Setting Key1="distinguishedName">
												<Rule Name="szRemoteBHDN" Query="$."/>
											</Setting>
										</Object>
									</Object>
								</Object>
							</Object>
						</Object>
						<Rule Name="fDirectoryError" Query="$fDirectoryErrorRG or $fDirectoryErrorRGMaster or $fDirectoryErrorRGMember or $fDirectoryErrorConnector or $fDirectoryErrorLocalBH or $fDirectoryErrorRemoteBH" Error="Error" Sev="2" Title="Directory data cannot be accessed" Text="Cannot collect directory data from server {2}. This could be the result of an unexpected connectivity problem. The link state analysis in this step may be incomplete." S2="%varDCName%" AlwaysEvaluate="True"/>
					</Object>

					<Rule Name="szCheckLinkState" Query="'CheckLinkState'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fLinkStateIssueFound,string(@Title),$szExNoErrorStateText)" Title="At least one potential link state issue was identified" AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No link state issues were identified"/>
					<Rule Name="szCheckLinkStateResult" Query="string(@Title)" Title="Link State Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="fLinkStateIssueFound" Query="$fRGNotFoundInDS or $fRGNoMember or $fRGNoConnector or $fRGMasterNotSpecified or $fRGMasterNotFoundInDS or $fRGMasterFoundForRGNotInDS or $fMajorVersionZero or $fRGMemberNotFoundInDS or $fRGMemberFoundForRGNotInDS or $fRGMemberNotConnectedtoMaster or $fConnectorNotFoundInDS or $fConnectorForRGNotInDS or $fAuthDLExists or $fDenyDLExists or $fConnectorDown or $fAddressSpaceForRGNotInDS or $fLocalBHNotFoundInDS or $fLocalBHNotAvailable or $fRemoteBHNotFoundInDS or $fRemoteBHNotAvailable" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckLinkStateStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckLinkStateChurn" Title="Check Link State Version Changes" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varFirstLinkStateDateTime%" Substitution="varFirstLinkStateDateTime" Display="Hide"/>
			<Setting Key1="%varServersContainerMissing%" Substitution="varServersContainerMissing" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking Link State Version Changes" Text="Please wait while the tool checks for any rapid link state version changes on server {2}." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="Link State Information" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<!-- First we check whether we need to 'sleep' so that the second access happens at least 1 minute after the first -->
					<Object Type="WMI" Key1="" Key3="Win32_OperatingSystem">
						<Setting Key1="LocalDateTime" Substitution="SECONDLINKSTATEDATETIME" Format="CIMDateTime">
							<Rule Name="iRawAccessIntervalSeconds" Query="get-seconds(date-difference($., '%varFirstLinkStateDateTime%'))"/>
							<Rule Name="iAdjAccessIntervalSeconds" Query="if($iRawAccessIntervalSeconds &gt; 60, $iRawAccessIntervalSeconds, 60)"/>
						</Setting>
						<Object Type="If" Name="Sleep" Key1="get-seconds(date-difference('%SECONDLINKSTATEDATETIME%', '%varFirstLinkStateDateTime%')) &lt; 60" Display="Hide">
							<Setting Key1="60 - number(get-seconds(date-difference('%SECONDLINKSTATEDATETIME%', '%varFirstLinkStateDateTime%')))" Substitution="SLEEPSECONDS" Display="Hide"/>
							<Object Type="Sleep" Name="LinkStateChurnSleep" Key1="%SLEEPSECONDS%"/>
						</Object>
					</Object>
					<!-- Now we collect the link state data second time -->
					<Object Type="LinkState" Name="LinkState" Key1="%varExName%">
						<Setting Key1="NodeInfo" Format="RoutingInfo"/>
						<Setting Key1="OrgInfo" Format="RoutingInfo"/>
						<Object Type="RoutingInfo" Key1="NodeInfo">
							<Setting Key1="Response"/>
						</Object>
						<Object Type="RoutingInfo" Key1="OrgInfo">
							<Setting Key1="Guid"/>
							<Setting Key1="Digest"/>
							<Object Type="RoutingInfo" Key1="Children" Key2="RoutingGroups" Class="Routing Group" GroupingClass="True">
								<Setting Key1="Guid" Substitution="RGGUID">
									<Rule Name="szRGDisplay" Query="if(count($szRGCN) &gt;0, $szRGCN, '%RGGUID%')"/>
								</Setting>
								<Setting Key1="MajorVersion">
									<Rule Name="fRGMajorVersionZero" Query="$.='0'"/>
									<Rule Name="fRGMajorVersionChangeError" Query="(hex($.) - hex($szFirstRGMajorVersion)) div $iAdjAccessIntervalSeconds &gt; 0.06666" Error="Error" Sev="2" ReportIssue="Issue" Title="Link state major version change" Text="The major version for routing group '{3}' appears to be changing very rapidly on server {2} ({9} version change(s) detected over {8} seconds). Excessive version changes may cause mail flow issues. Latest major version number: {6}." S2="%varExName%" P3="$szRGDisplay" P6="$." P8="$iAdjAccessIntervalSeconds" P9="hex($.) - hex($szFirstRGMajorVersion)"/>
									<Rule Name="fRGMajorVersionChangeWarning" Query="not($fRGMajorVersionChangeError) and (hex($.) - hex($szFirstRGMajorVersion)) div $iAdjAccessIntervalSeconds &gt; 0.03333" Error="Warning" Sev="2" Title="Link state major version change" Text="The major version for routing group '{3}' may be changing rapidly on server {2} ({9} version change(s) detected over {8} seconds). Please verify that this is an intentional behavior. Latest major version number: {6}." S2="%varExName%" P3="$szRGDisplay" P6="$." P8="$iAdjAccessIntervalSeconds" P9="hex($.) - hex($szFirstRGMajorVersion)"/>
									<Rule Name="fRGMajorVersionChange" Query="not($fRGMajorVersionChangeError or $fRGMajorVersionChangeWarning) and hex($.) &gt; hex($szFirstRGMajorVersion)" Error="None" Title="Link state major version change" Text="The major version for routing group '{3}' has been changed on server {2} while the tool was running. Latest major version number: {6}. First detected major version number: {1}." P1="$szFirstRGMajorVersion" S2="%varExName%" P3="$szRGDisplay" P6="$."/>
									<Rule Name="fServersContainerPotentialRootCause" Query="$fRGMajorVersionChangeError and '%varServersContainerMissing%'='1'" Error="Error" Sev="2" ReportIssue="RootCause" Title="Potential missing 'Servers' container problem" Text="The missing 'Servers' container problem in Active Directory may be causing the 'Messages waiting to be routed' queue issue on server {2}." S2="%varExName%"/>
								</Setting>
								<Setting Key1="MinorVersion">
									<Rule Name="fRGMinorVersionChangeError" Query="not($fRGMajorVersionZero) and (hex($.) - hex($szFirstRGMinorVersion)) div $iAdjAccessIntervalSeconds &gt; 0.06666" Error="Error" Sev="2" ReportIssue="Issue" Title="Link state minor version change" Text="The minor version for routing group '{3}' appears to be changing very rapidly on server {2} ({9} version change(s) detected over {8} seconds). This may be caused by link state oscillations where connectors are repeatedly marked as 'UP' and then as 'DOWN'. Latest minor version number: {6}." S2="%varExName%" P3="$szRGDisplay" P6="$." P8="$iAdjAccessIntervalSeconds" P9="hex($.) - hex($szFirstRGMinorVersion)"/>
									<Rule Name="fRGMinorVersionChangeWarning" Query="not($fRGMajorVersionZero or $fRGMinorVersionChangeError) and (hex($.) - hex($szFirstRGMinorVersion)) div $iAdjAccessIntervalSeconds &gt; 0.03333" Error="Warning" Sev="2" Title="Link state minor version change" Text="The minor version for routing group '{3}' may be changing rapidly on server {2} ({9} version change(s) detected over {8} seconds). This may be caused by link state oscillations where connectors are repeatedly marked as 'UP' and then as 'DOWN'. Latest minor version number: {6}." S2="%varExName%" P3="$szRGDisplay" P6="$." P8="$iAdjAccessIntervalSeconds" P9="hex($.) - hex($szFirstRGMinorVersion)"/>
									<Rule Name="fRGMinorVersionChange" Query="not($fRGMinorVersionChangeError or $fRGMinorVersionChangeWarning) and hex($.) &gt; hex($szFirstRGMinorVersion)" Error="None" Title="Link state minor version change" Text="The minor version for routing group '{3}' has been changed on server {2} while the tool was running. Latest minor version number: {6}. First detected minor version number: {1}." P1="$szFirstRGMinorVersion" S2="%varExName%" P3="$szRGDisplay" P6="$."/>
								</Setting>
								<Setting Key1="UserVersion">
									<Rule Name="fRGUserVersionChangeError" Query="(hex($.) - hex($szFirstRGUserVersion)) div $iAdjAccessIntervalSeconds &gt; 0.06666" Error="Error" Sev="2" ReportIssue="Issue" Title="Link state user version change" Text="The user version for routing group '{3}' appears to be changing very rapidly on server {2} ({9} version change(s) detected over {8} seconds). Excessive version changes may cause mail flow issues. Latest user version number: {6}." S2="%varExName%" P3="$szRGDisplay" P6="$." P8="$iAdjAccessIntervalSeconds" P9="hex($.) - hex($szFirstRGUserVersion)"/>
									<Rule Name="fRGUserVersionChangeWarning" Query="not($fRGUserVersionChangeError) and (hex($.) - hex($szFirstRGUserVersion)) div $iAdjAccessIntervalSeconds &gt; 0.03333" Error="Warning" Sev="2" Title="Link state user version change" Text="The user version for routing group '{3}' may be changing rapidly on server {2} ({9} version change(s) detected over {8} seconds). Please verify that this is an intentional behavior. Latest user version number: {6}." S2="%varExName%" P3="$szRGDisplay" P6="$." P8="$iAdjAccessIntervalSeconds" P9="hex($.) - hex($szFirstRGUserVersion)"/>
									<Rule Name="fRGUserVersionChange" Query="not($fRGUserVersionChangeError or $fRGUserVersionChangeWarning) and hex($.) &gt; hex($szFirstRGUserVersion)" Error="None" Title="Link state major version change" Text="The user version for routing group '{3}' has been changed on server {2} while the tool was running. Latest user version number: {6}. First detected user version number: {1}." P1="$szFirstRGUserVersion" S2="%varExName%" P3="$szRGDisplay" P6="$."/>
								</Setting>
								<Object Type="Variable" Key1="Scalar" Display="Hide">
									<Setting Key1="%varFirstRG[MajorVersion][%RGGUID%]%" Substitution="varFirstRG[MajorVersion]" Display="Hide"/>
									<Setting Key1="%varFirstRG[MinorVersion][%RGGUID%]%" Substitution="varFirstRG[MinorVersion]" Display="Hide"/>
									<Setting Key1="%varFirstRG[UserVersion][%RGGUID%]%" Substitution="varFirstRG[UserVersion]" Display="Hide"/>
									<Object Type="Group" Name="First Access Version Numbers" Display="Hide">
										<Setting Display="Hide">
											<Rule Name="szFirstRGMajorVersion" Query="'%varFirstRG[MajorVersion]%'"/>
											<Rule Name="szFirstRGMinorVersion" Query="'%varFirstRG[MinorVersion]%'"/>
											<Rule Name="szFirstRGUserVersion" Query="'%varFirstRG[UserVersion]%'"/>
										</Setting>
									</Object>
								</Object>
								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%RGGUID%&gt;">
									<Rule Name="fDirectoryErrorRG" Query="../Exception/@Message"/>
									<Setting Key1="cn">
										<Rule Name="szRGCN" Query="$."/>
									</Setting>
									<Setting Key1="distinguishedName">
										<Rule Name="szRGDN" Query="$."/>
									</Setting>
								</Object>
							</Object>
						</Object>
						<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
							<Setting>
								<Rule Name="fNoVersionChangeDetected" Query="not($fRGMajorVersionChangeError or $fRGMajorVersionChangeWarning or $fRGMajorVersionChange or $fRGMinorVersionChangeError or $fRGMinorVersionChangeWarning or $fRGMinorVersionChange or $fRGUserVersionChangeError or $fRGUserVersionChangeWarning or $fRGUserVersionChange)" Error="None" Title="No link state version changes detected" Text="No link state version changes were detected on server {2} while the tool was running." S2="%varExName%" AlwaysEvaluate="True"/>
							</Setting>
						</Object>
					</Object>

					<Rule Name="szCheckLinkStateChurn" Query="'CheckLinkStateChurn'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fPossibleLinkStateChurnFound,string(@Title),$szExNoErrorStateText)" Title="At least one potential link state version change issue was identified" AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No link state version change issues were identified"/>
					<Rule Name="szCheckLinkStateResult" Query="string(@Title)" Title="Link State Version Change Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule Name="fPossibleLinkStateChurnFound" Query="$fRGMajorVersionChangeError or $fRGMajorVersionChangeWarning or $fRGMinorVersionChangeError or $fRGMinorVersionChangeWarning or $fRGUserVersionChangeError or $fRGUserVersionChangeWarning" AlwaysEvaluate="True"/>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckLinkChurnStateStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>

				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckDNSRecords" Title="Check DNS Records of Local Server" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstanceName%" Substitution="varAllSMTPInstanceName" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstanceFQDN%" Substitution="varAllSMTPInstanceFQDN" Display="Hide"/>
			<Setting Key1="%varAllDNSAddress%" Substitution="varAllDNSAddress" Display="Hide"/>
			<Setting Key1="%varAllExIPAddress%" Substitution="varAllExIPAddress" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking DNS Records" Text="Please wait while the tool checks whether the DNS servers used by server {2} can return valid records." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Group" Name="DNS Records" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<!-- Let's check whether each DNS contains the records of each destination server -->
						<Object Type="If" Name="DNSAvailableServer" Key1="'%varAllDNSAddress%'!=';'">
							<Object Type="Variable" Name="SMTP Instance List" Key1="Unpack" Key2="%varAllSMTPInstanceFQDN%">
								<Setting Key1="__KEY" Substitution="SORTKEY"/>
								<Setting Key1="__VALUE" Substitution="SMTPVSFQDN">
									<Rule Name="szSMTPVSFQDN" Query="lower-case($.)"/>
								</Setting>
								<Object Type="DNS" Name="SMTP Virtual Server Host Record" Key1="%varAllDNSAddress%" Key2="%SMTPVSFQDN%" Async="100">
									<Setting Key1="A">
										<Rule Name="szSMTPVSResolvedHost" Query="if ($.[4] != 'DNS Query Result = ', substring-after($.[4],'DNS Query Result = '))"/>
									</Setting>
									<Rule Name="fSMTPVSNoHostRecords" Query="count ($szSMTPVSResolvedHost) &lt;1" Error="Error" Sev="2" ReportIssue="Issue" Title="No 'Host' record(s) found for SMTP instance '{3}'" Text="No Host (A) records of SMTP instance '{3}' (fully-qualified domain name: {1}) can be obtained from any DNS servers server {2} uses. This may cause mail routing issues." S1="%SMTPVSFQDN%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" GUID="4fcf5a4f-0180-4af5-a60e-e1d9da1d50bf" AlwaysEvaluate="True"/>
									<Rule Name="fSMTPVSHostRecordsFound" Query="count ($szSMTPVSResolvedHost) &gt;0" Error="None" Title="'Host' record(s) found for SMTP instance '{3}'" Text="The resolved IP address of SMTP instance {3} (fully-qualified domain name: {1}) is {4}" S1="%SMTPVSFQDN%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="join(',', $szSMTPVSResolvedHost)"/>
								</Object>
							</Object>
							<Object Type="Cache" Name="IP Address Cache" Key1="Add" Key2="ExIPAddress" Key3="%varAllExIPAddress%" Key4=";" Display="Hide">
								<Setting Key1="IPAddress" Substitution="EXIPADDRESS"/>
								<Object Type="DNS" Name="Server Pointer Record" Key1="%varAllDNSAddress%" Key2="%varExName%" Async="100">
									<Setting Key1="PTR" Key2="%EXIPADDRESS%">
										<Rule Name="szServerResolvedPointer" Query="if ($.[4] != 'DNS Query Result = ', substring-after($.[4],'DNS Query Result = '))"/>
										<Rule Name="fServerResolvedPointerNoMatch" Query="string-length($szServerResolvedPointer) &gt;0 and count($szSMTPVSFQDN[.=lower-case($szServerResolvedPointer)]) &lt;1" Error="Warning" Sev="3" Title="'Pointer' record does not match SMTP instance" Text="The Pointer (PTR) record {1} does not match any fully-qualified domain name of the SMTP instances on server {2}. This may cause routing problems when remote servers have a filter to map an IP address to a server name." P1="$szServerResolvedPointer" S2="%varExName%" AlwaysEvaluate="True"/>
									</Setting>
									<Rule Name="fServerNoPointerRecords" Query="count ($szServerResolvedPointer) &lt;1" Error="Error" Sev="2" ReportIssue="Issue" Title="No 'Pointer' record(s) found for IP address {4}" Text="No Pointer (PTR) record for IP address {4} can be obtained from any DNS servers server {2} uses. This may cause routing problems when server {2} sends messages to remote servers performing reverse DNS lookups." S2="%varExName%" S4="%EXIPADDRESS%" AlwaysEvaluate="True"/>
									<Rule Name="fServerPointerRecordsFound" Query="count ($szServerResolvedPointer) &gt;0" Error="None" Title="'Pointer' record(s) found for IP address {4}" Text="The Pointer (PTR) record of IP address {4} is {1}" P1="join(',', $szServerResolvedPointer)" S4="%EXIPADDRESS%"/>
								</Object>
							</Object>
						</Object>
						<Rule Name="szCheckDNSRecords" Query="'CheckDNSRecords'">
							<Variable Name="varPreviousName" Scope="Children"/>
						</Rule>
						<Rule Name="szExErrorStateText" Query="if($fDNSRecordIssueFound,string(@Title),$szExNoErrorStateText)" Title="At least one potential DNS record issue was identified." AlwaysEvaluate="True">
							<Variable Name="varErrorStateText" Scope="Global"/>
						</Rule>
						<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No DNS record issues were identified."/>
						<Rule Name="szCheckLinkStateResult" Query="string(@Title)" Title="DNS Record Analysis Results">
							<Variable Name="varDisplayTitle" Scope="Global"/>
						</Rule>

						<Rule Name="fDNSRecordIssueFound" Query="$fSMTPVSNoHostRecords or $fServerResolvedPointerNoMatch or $fServerNoPointerRecords" AlwaysEvaluate="True"/>

						<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckLinkStateStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="CheckDomainRouting" Title="Check Domain Routing Information" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstance%" Substitution="varAllSMTPInstance" Display="Hide"/>
			<Setting Key1="%varAllSMTPInstanceName%" Substitution="varAllSMTPInstanceName" Display="Hide"/>
			<Setting Key1="%varAllConcatRCPTAddressServerBindingList%" Substitution="varAllConcatRCPTAddressServerBindingList" Display="Hide"/>
			<Setting Key1="%varExOrgDN%" Substitution="varExOrgDN" Display="Hide"/>
			<Setting Key1="%varExDN%" Substitution="varExDN" Display="Hide"/>
			<Setting Key1="%varSelSymptom%" Substitution="varSelSymptom" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varIsExchange2000or2003%" Substitution="varIsExchange2000or2003" Display="Hide"/>

			<Object Type="Progress" Title="Checking Domain Routing Information" Text="Please wait while the tool checks whether the stored domain routing information is consistent among sources." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="If" Name="Exchange 2000/2003 Domain Routing" Key1="'%varIsExchange2000or2003%'='1'" Display="Hide">
					<Object Type="Group" Name="Domain Routing" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">
						<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
							<!-- Let's first look at Recipient policies -->
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Recipient Policies,%varExOrgDN%" Key4="OneLevel">
								<Setting Key1="cn">
									<Rule Name="szRecipPolicyCN" Query="$."/>
								</Setting>
								<Setting Key1="disabledGatewayProxy"/>
								<Setting Key1="gatewayProxy" Substitution="POLICYADDRESSLIST" SubstitutionFormat="$----::">
									<Rule Name="szDomain" Query="$."/>
									<Rule Name="szPrimarySMTPDomain" Query="substring-after($.[contains(., 'SMTP:')], '@')"/>
									<Rule Name="fDoubleDotRecipPolicy" Query="count($.[(contains(., 'SMTP:') or contains(., 'smtp:')) and contains(., '..')]) &gt;0" Error="Error" Sev="3" ReportIssue="Issue" Title="Possible 'double dot' SMTP address in recipient policy" Text="Recipient policy '{3}' appears to contain at least one SMTP address with two consecutive periods (e.g. @domain..com). This is known to cause mail flow issues. Configured SMTP address(es): {1}" P1="join('; ', $.[(contains(., 'SMTP:') or contains(., 'smtp:')) and contains(., '..')])" P3="$szRecipPolicyCN"/>
								</Setting>
								<Setting Key1="msExchNonAuthoritativeDomains">
									<Rule Name="szNonAuthDomain" Query="$."/>
									<Rule Name="fDefaultPrimarySMTPNonAuth" Query="$fDefaultRecipPolicy and count($.[.=concat('SMTP:@', $szPrimarySMTPDomain)]) &gt;0" Error="Error" Sev="3" ReportIssue="Issue" Title="Primary SMTP address not authoritative for default recipient policy" Text="SMTP domain '{1}' is set as the primary SMTP address of the default recipient policy but Exchange is not authoritative for it. Local mail flow problems may occur." P1="$szPrimarySMTPDomain"/>
								</Setting>
								<Setting Key1="msExchPolicyOrder">
									<Rule Name="fDefaultRecipPolicy" Query="$.=2147483647"/>
								</Setting>

								<!-- Let's check SMTP connectors and the metabase to see if they are consitent with recipient policies -->
								<Object Type="Cache" Name="Gateway Proxy" Key1="Add" Key2="PolicyAddress" Key3="%POLICYADDRESSLIST%" Key4="::" Display="Hide">
									<Setting Key1="Address" Substitution="POLICYADDRESS"/>
									<Object Type="If" Key1="contains(upper-case('%POLICYADDRESS%'), 'SMTP:')">
										<Setting Key1="'%POLICYADDRESS%'" Substitution="SMTPADDRESS" SubstitutionFormat="^.*@(.*?)$----$1">
											<Rule Name="fAuthDomain" Query="count($szNonAuthDomain[.='%POLICYADDRESS%']) &lt;1" AlwaysEvaluate="True"/>
										</Setting>
										<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectClass=msExchRoutingSMTPConnector)(routingList=SMTP:%SMTPADDRESS%;*))">
											<Rule Name="fDirectoryConnectException" Query="../Exception/@Message" Error="Error" Sev="2" Title="Error accessing Active Directory" Text="Cannot collect directory data from server {2}. This could be the result of a network or permissions problem. Error: {1}" P1="../Exception/@Message" S2="%varDCName%" GUID="b15f87cc-938a-48f8-a14e-24ce1aef5b61"/>
											<Rule Name="fSMTPConnectorForNonAuthNotFound" Query="not($fAuthDomain) and not($fDirectoryConnectException) and count($szRecipSMTPConnDN) &lt;1" Error="Warning" Sev="3" Title="No SMTP connector for non-authoritative domain" Text="No SMTP connector was found for non-authoritative SMTP address space '{1}'. Exchange cannot forward messages to an external SMTP server when the recipient cannot be resolved." S1="%SMTPADDRESS%" AlwaysEvaluate="True"/>
											<Setting Key1="cn">
												<Rule Name="szRecipSMTPConnCN" Query="$."/>
												<Rule Name="fSMTPConnectorForAuthFound" Query="$fAuthDomain and $.!=''" Error="Warning" Sev="2" Title="SMTP connector to authoritative SMTP domain" Text="SMTP connector '{4}' is configured to route messages to SMTP domain '{1}', which this Exchange organization is authoritative for. Please verify this configuration is correct." S1="%SMTPADDRESS%" P4="$."/>
											</Setting>
											<Setting Key1="distinguishedName">
												<Rule Name="szRecipSMTPConnDN" Query="$."/>
											</Setting>
											<Setting Key1="msExchSmtpOutboundSecurityFlag">
												<Rule Name="fRelayNotAllowedNonAuth" Query="not($fAuthDomain) and bitwise-and($.,4096)=0" Error="Warning" Sev="2" Title="Relay not allowed to non-authoritative SMTP domain" Text="SMTP connector '{4}' is not configured to allow messages to be relayed to non-authoritative SMTP address space '{1}'. This needs to be enabled to forward unresolved messages to an external SMTP server." S1="%SMTPADDRESS%" P4="$szRecipSMTPConnCN"/>
											</Setting>
											<Setting Key1="msExchSourceBridgeheadServersDN">
												<Rule Name="szSMTPConnectorSourceBH" Query="$."/>
												<Rule Name="fSMTPConnectorBHNotIncluded" Query="not($fAuthDomain) and count($fSMTPConnectorBHIncluded) &lt;1" Error="Warning" Sev="2" Title="Bridgehead server to non-authoritative SMTP domain" Text="No SMTP instances on server {2} are set to accept and forward messages addressed to non-authoritative SMTP address space '{1}' through SMTP connector '{4}'. Server {2} cannot receive messages addressed to '{1}' from the Internet." S1="%SMTPADDRESS%" S2="%varExName%" P4="$szRecipSMTPConnCN" AlwaysEvaluate="True"/>
											</Setting>
											<Object Type="Variable" Name="SMTP Instances" Key1="Unpack" Key2="%varAllSMTPInstance%">
												<Setting Key1="__KEY" Substitution="SORTKEY"/>
												<Setting Key1="__VALUE" Substitution="SMTPINSTANCE">
													<Rule Name="fSMTPConnectorBHIncluded" Query="not($fAuthDomain) and count($szSMTPConnectorSourceBH[upper-case(.)=upper-case('CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%')]) &gt;0" Error="None" Title="Bridgehead server to non-authoritative SMTP domain" Text="SMTP instance '{3}' on server {2} is set to accept and forward messages addressed to non-authoritative SMTP address space '{1}' through SMTP connector '{4}'." S1="%SMTPADDRESS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szRecipSMTPConnCN"/>
												</Setting>
											</Object>
										</Object>
										<Object Type="Variable" Name="SMTP Instances" Key1="Unpack" Key2="%varAllSMTPInstance%">
											<Setting Key1="__KEY" Substitution="SORTKEY"/>
											<Setting Key1="__VALUE" Substitution="SMTPINSTANCE"/>
											<Object Type="Metabase" Key1="%varExName%" Key2="LM/SmtpSvc/%SMTPINSTANCE%/Domain/%SMTPADDRESS%" Timeout="%300">
												<Rule Name="fAuthDomainMetabaseException" Query="$fAuthDomain and ../Exception/@Message" Error="Error" Sev="2" ReportIssue="Issue" Title="Authoritative SMTP domain not found in metabase" Text="SMTP domain '{1}' is set as an authoritative address space in recipient policy '{3}', but a corresponding record cannot be retrieved from the metabase for SMTP instance '{4}' on server {2}. Please check whether this is a temporary metabase access issue or a record does not really exist. Error: {0}" P0="../Exception/@Message" S1="%SMTPADDRESS%" S2="%varExName%" P3="$szRecipPolicyCN" P4="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" AlwaysEvaluate="True"/>
												<Rule Name="fAuthDomainEntryNotFound" Query="$fAuthDomain and not($fAuthDomainMetabaseException) and count ($szAuthDomainGUID) &lt;1" Error="Error" Sev="2" ReportIssue="Issue" Title="Authoritative SMTP domain not found in metabase" Text="SMTP domain '{1}' is set as an authoritative address space in recipient policy '{3}', but no corresponding record was found in the metabase for SMTP instance '{4}' on server {2}. Messages addressed to domain '{1}' may experience problems." S1="%SMTPADDRESS%" S2="%varExName%" P3="$szRecipPolicyCN" P4="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" AlwaysEvaluate="True"/>
												<Setting Key1="36946" Key2="RouteAction">
													<Rule Name="fAuthDomainNotLocal" Query="$fAuthDomain and $.!=32" Error="Error" Sev="2" ReportIssue="RootCause" Title="Authoritative SMTP domain not set as local in metabase" Text="SMTP domain '{1}' is set as an authoritative address space in recipient policy '{3}', but the '{5}' property in the metabase for SMTP instance '{4}' on server {2} does not indicate that this is a local domain. Messages addressed to domain '{1}' may not be delivered. Current '{5}' value: {8} (Expected value: {9})" S1="%SMTPADDRESS%" S2="%varExName%" P3="$szRecipPolicyCN" P4="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P5="../@Key2" P8="$." S9="32"/>
													<Rule Name="fNonAuthDomainLocal" Query="not($fAuthDomain) and $.=32" Error="Error" Sev="2" ReportIssue="Issue" Title="Non-authoritative SMTP domain set as local in metabase" Text="SMTP domain '{1}' is set as a non-authoritative address space in recipient policy '{3}', but the '{5}' property in the metabase for SMTP instance '{4}' on server {2} indicates that this is a local domain. Exchange may not be able to forward messages to an external SMTP server when the recipient cannot be resolved. Current '{5}' value: {8}" S1="%SMTPADDRESS%" S2="%varExName%" P3="$szRecipPolicyCN" P4="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P5="../@Key2" P8="$."/>
												</Setting>
												<Setting Key1="61536">
													<Rule Name="szAuthDomainGUID" Query="$."/>
												</Setting>
											</Object>
										</Object>
									</Object>
								</Object>
								<Rule Name="fNoRecipPolicyIssueFound" Query="count($szRecipPolicyCN) &gt;0 and count($fDoubleDotRecipPolicy) &lt;1 and count($fDefaultPrimarySMTPNonAuth) &lt;1 and count($fDirectoryConnectException) &lt;1 and count($fSMTPConnectorForNonAuthNotFound) &lt;1 and count($fSMTPConnectorForAuthFound) &lt;1 and count($fRelayNotAllowedNonAuth) &lt;1 and count($fSMTPConnectorBHNotIncluded) &lt;1 and count($fAuthDomainMetabaseException) &lt;1 and count($fAuthDomainEntryNotFound) &lt;1 and count($fAuthDomainNotLocal) &lt;1 and count($fNonAuthDomainLocal) &lt;1" AlwaysEvaluate="True"/>
							</Object>
							<!-- Second, let's check SMTP connectors -->
							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Administrative Groups,%varExOrgDN%" Key3="(&amp;(objectClass=msExchRoutingSMTPConnector)(routingList=SMTP:*))">
								<Setting Key1="cn">
									<Rule Name="szSMTPConnectorCN" Query="$."/>
								</Setting>
								<Setting Key1="msExchSmtpOutboundSecurityFlag">
									<Rule Name="fSMTPConnectorRelayAllowed" Query="bitwise-and($.,4096)!=0"/>
								</Setting>
								<Setting Key1="msExchSmtpSmartHost" Substitution="SMARTHOST" SubstitutionFormat=",----;">
									<Rule Name="szSMTPConnectorSmartHost" Query="$."/>
								</Setting>
								<Setting Key1="routingList" Substitution="ROUTINGLIST" SubstitutionFormat="$----::">
									<Rule Name="fDoubleDotSMTPConnector" Query="count($.[contains(., 'SMTP:') and contains(., '..')]) &gt;0" Error="Error" Sev="3" ReportIssue="Issue" Title="Possible 'double dot' SMTP address in SMTP connector address space" Text="SMTP connector '{3}' appears to contain at least one SMTP address space with two consecutive periods (e.g. domain..com). This is known to cause mail flow issues. Configured SMTP address(es): {1}" P1="join('; ', $.[contains(., 'SMTP:') and contains(., '..')])" P3="$szSMTPConnectorCN"/>
								</Setting>
								<Setting Key1="msExchSourceBridgeheadServersDN" Substitution="SMTPCONNECTORBH" SubstitutionFormat="$----;"/>
								<!-- Address space entries in metabase are checked -->
								<Object Type="Cache" Name="Routing List" Key1="Add" Key2="AddressSpace" Key3="%ROUTINGLIST%" Key4="::" Display="Hide">
									<Setting Key1="Address" Substitution="ADDRESSSPACE"/>
									<Object Type="If" Key1="contains(upper-case('%ADDRESSSPACE%'), 'SMTP:')">
										<Setting Key1="'%ADDRESSSPACE%'" Substitution="SMTPADDRESS" SubstitutionFormat="^.*:(.*?);.*$----$1"/>
										<Object Type="Variable" Name="SMTP Instances" Key1="Unpack" Key2="%varAllSMTPInstance%">
											<Setting Key1="__KEY" Substitution="SORTKEY"/>
											<Setting Key1="__VALUE" Substitution="SMTPINSTANCE"/>
											<Object Type="If" Key1="contains(upper-case('%SMTPCONNECTORBH%'), upper-case('CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%'))">
												<Object Type="Metabase" Key1="%varExName%" Key2="LM/SmtpSvc/%SMTPINSTANCE%/Domain/%SMTPADDRESS%" Timeout="%300">
													<Rule Name="fAddressSpaceMetabaseException" Query="../Exception/@Message" Error="Error" Sev="2" ReportIssue="Issue" Title="SMTP connector address space not found in metabase" Text="SMTP domain '{1}' is set as an address space for SMTP connector '{4}' but a corresponding record cannot be retrieved from the metabase for SMTP instance '{3}' on server {2}. Please check whether this is a temporary metabase access issue or a record does not really exist. Error: {0}" P0="../Exception/@Message" S1="%SMTPADDRESS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" AlwaysEvaluate="True"/>
													<Rule Name="fAddressSpaceEntryNotFound" Query="not($fAddressSpaceMetabaseException) and count ($szAddressSpaceGUID) &lt;1" Error="Error" Sev="2" ReportIssue="Issue" Title="SMTP connector address space not found in metabase" Text="SMTP domain '{1}' is set as an address space for SMTP connector '{4}' but no corresponding record was found in the metabase for SMTP instance '{3}' on server {2}. Messages addressed to domain '{1}' may experience problems." S1="%SMTPADDRESS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" AlwaysEvaluate="True"/>
													<Setting Key1="36946" Key2="RouteAction">
														<Rule Name="fAddressSpaceLocal" Query="$.=32" Error="Error" Sev="2" ReportIssue="Issue" Title="SMTP connector address space set as local domain in metabase" Text="SMTP domain '{1}' is set as an address space for SMTP connector '{4}' but the '{5}' property in the metabase for SMTP instance '{3}' on server {2} indicates that this is a local domain. Messages addressed to domain '{1}' may not be delivered. Current '{5}' value: {8}" S1="%SMTPADDRESS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" P5="../@Key2" P8="$."/>
														<Rule Name="fSmartHostNotAllowed" Query="count($szSMTPConnectorSmartHost) &gt;0 and bitwise-and($.,2)=0" Error="Warning" Sev="2" Title="Smart host not allowed in metabase" Text="SMTP connector '{4}' is configured to forward messages addressed to domain '{1}' to smart host '{0}' but the '{5}' property in the metabase for SMTP instance '{3}' on server {2} indicates that a smart host is not allowed. This SMTP connector may not be able to route messages correctly. Current '{5}' value: {8}" P0="$szSMTPConnectorSmartHost" S1="%SMTPADDRESS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" P5="../@Key2" P8="$." AlwaysEvaluate="True"/>
														<Rule Name="fSmartHostNotSet" Query="count($szSMTPConnectorSmartHost) &gt;0 and count($szRouteActionString) &lt;1" Error="Warning" Sev="2" Title="Smart host not set in metabase" Text="SMTP connector '{4}' is configured to forward messages addressed to domain '{1}' to smart host '{0}' but the '{5}' property in the metabase for SMTP instance '{3}' on server {2} cannot be found. This SMTP connector may not be able to route messages correctly." P0="$szSMTPConnectorSmartHost" S1="%SMTPADDRESS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" S5="RouteActionString" AlwaysEvaluate="True"/>
														<Rule Name="fRelayNotAllowed" Query="$fSMTPConnectorRelayAllowed and bitwise-and($.,4096)=0" Error="Warning" Sev="2" Title="Relay not allowed in metabase" Text="SMTP connector '{4}' is configured to allow messages to be relayed to domain '{1}' but the '{5}' property in the metabase for SMTP instance '{3}' on server {2} indicates that no relay is allowed. Exchange may not be able to forward messages to an external SMTP server. Current '{5}' value: {8}" S1="%SMTPADDRESS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" P5="../@Key2" P8="$."/>
													</Setting>
													<Setting Key1="36947" Key2="RouteActionString">
														<Rule Name="szRouteActionString" Query="$."/>
														<Rule Name="fSmartHostDifferent" Query="count($szSMTPConnectorSmartHost) &gt;0 and upper-case($.)!=upper-case($szSMTPConnectorSmartHost)" Error="Warning" Title="Different smart host set in metabase" Text="SMTP connector '{4}' is configured to forward messages addressed to domain '{1}' to smart host '{0}' but the '{5}' property in the metabase for SMTP instance '{3}' on server {2} indicates a different smart host. This SMTP connector may not be able to route messages correctly. Current '{5}' value: {8} (Expected value: {9})" P0="$szSMTPConnectorSmartHost" S1="%SMTPADDRESS%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" P5="../@Key2" P8="$." P9="$szSMTPConnectorSmartHost" AlwaysEvaluate="True"/>
													</Setting>
													<Setting Key1="61536">
														<Rule Name="szAddressSpaceGUID" Query="$."/>
													</Setting>
												</Object>
											</Object>
										</Object>
									</Object>
								</Object>
								<!-- Then, smart host entries are checked -->
								<Object Type="If" Key1="string-length('%SMARTHOST%') &gt;0">
									<Object Type="Variable" Name="SMTP Instances" Key1="Unpack" Key2="%varAllSMTPInstance%">
										<Setting Key1="__KEY" Substitution="SORTKEY"/>
										<Setting Key1="__VALUE" Substitution="SMTPINSTANCE"/>
										<Object Type="If" Key1="contains(upper-case('%SMTPCONNECTORBH%'), upper-case('CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%'))">
											<Object Type="Metabase" Key1="%varExName%" Key2="LM/SmtpSvc/%SMTPINSTANCE%/Domain/%SMARTHOST%" Timeout="%300">
												<Rule Name="fSmartHostMetabaseException" Query="../Exception/@Message" Error="Error" Sev="2" ReportIssue="Issue" Title="SMTP connector smart host not found in metabase" Text="Server {1} is specified as the smart host for SMTP connector '{4}' but a corresponding record cannot be retrieved from the metabase for SMTP instance '{3}' on server {2}. Please check whether this is a temporary metabase access issue or a record does not really exist. Error: {0}" P0="../Exception/@Message" S1="%SMARTHOST%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" AlwaysEvaluate="True"/>
												<Rule Name="fSmartHostEntryNotFound" Query="not($fSmartHostMetabaseException) and count ($szSmartHostGUID) &lt;1" Error="Error" Sev="2" ReportIssue="Issue" Title="SMTP connector smart host not found in metabase" Text="Server {1} is specified as the smart host for SMTP connector '{4}' but no corresponding record was found in the metabase for SMTP instance '{3}' on server {2}. Exchange may not be able to forward messages to '{1}'." S1="%SMARTHOST%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" AlwaysEvaluate="True"/>
												<Setting Key1="36946" Key2="RouteAction">
													<Rule Name="fSmartHostLocal" Query="$.=32" Error="Error" Sev="2" ReportIssue="Issue" Title="SMTP connector smart host set as local domain in metabase" Text="Server {1} is specified as the smart host for SMTP connector '{4}' but the '{5}' property in the metabase for SMTP instance '{3}' on server {2} indicates that this is a local domain. Messages addressed to smart host '{1}' may not be delivered. Current '{5}' value: {8} (Expected value: {9})" S1="%SMARTHOST%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" P5="../@Key2" P8="$." S9="0"/>
													<Rule Name="fSmartHostMissing" Query="count($szSMTPConnectorSmartHost) &gt;0 and count($szSmartHostRouteActionString) &lt;1" Error="Warning" Sev="2" Title="Smart host not set in metabase" Text="Server {1} is specified as the smart host for SMTP connector '{4}' but the '{5}' property in the metabase for SMTP instance '{3}' on server {2} cannot be found. This SMTP connector may not be able to route messages correctly." S1="%SMARTHOST%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" S5="RouteActionString" AlwaysEvaluate="True"/>
												</Setting>
												<Setting Key1="36947" Key2="RouteActionString">
													<Rule Name="szSmartHostRouteActionString" Query="$."/>
													<Rule Name="fSmartHostNotSelf" Query="count($szSMTPConnectorSmartHost) &gt;0 and upper-case($.)!=upper-case('%SMARTHOST%')" Error="Warning" Title="Different smart host set in metabase" Text="Server {1} is specified as the smart host for SMTP connector '{4}' but the '{5}' property in the metabase for SMTP instance '{3}' on server {2} indicates a different smart host. This SMTP connector may not be able to route messages correctly. Current '{5}' value: {8}" S1="%SMARTHOST%" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szSMTPConnectorCN" P5="../@Key2" P8="$." AlwaysEvaluate="True"/>
												</Setting>
												<Setting Key1="61536">
													<Rule Name="szSmartHostGUID" Query="$."/>
												</Setting>
											</Object>
										</Object>
									</Object>
								</Object>
								<Rule Name="fNoSMTPConnectorIssueFound" Query="not(../Exception/@Message or ../Instance/Object/Exception/@Message) and count($fDoubleDotSMTPConnector) &lt;1 and count($fAddressSpaceMetabaseException) &lt;1 and count($fAddressSpaceEntryNotFound) &lt;1 and count($fAddressSpaceLocal) &lt;1 and count($fSmartHostNotAllowed) &lt;1 and count($fSmartHostNotSet) &lt;1 and count($fRelayNotAllowed) &lt;1 and count($fSmartHostDifferent) &lt;1 and count($fSmartHostMetabaseException) &lt;1 and count($fSmartHostEntryNotFound) &lt;1 and count($fSmartHostLocal) &lt;1 and count($fSmartHostMissing) &lt;1 and count($fSmartHostNotSelf) &lt;1" AlwaysEvaluate="True"/>
								<Rule Name="fNoRecipPolicySMTPConnectorIssueFound" Query="$fNoRecipPolicyIssueFound and $fNoSMTPConnectorIssueFound" Error="None" Title="Consistent domain routing information between recipient policies and SMTP connectors" Text="The domain routing information stored in recipient policies and SMTP connectors is consistent. The corresponding entries were also identified in the metabase on server {2}." S2="%varExName%"/>
							</Object>

							<!-- Third, let's check metabase to see if it contains orphaned data -->
							<Object Type="Variable" Name="SMTP Instances" Key1="Unpack" Key2="%varAllSMTPInstance%">
								<Setting Key1="__KEY" Substitution="SORTKEY"/>
								<Setting Key1="__VALUE" Substitution="SMTPINSTANCE"/>
								<Object Type="Metabase" Key1="%varExName%" Key2="LM/SmtpSvc/%SMTPINSTANCE%/Domain" Key3=".*" Key4="OneLevel" Timeout="%300">
									<Rule Name="fMetabaseException" Query="../Exception/@Message" Error="Error" Sev="2" Title="Error accessing metabase" Text="Cannot connect to the metabase on server {2}. This could be the result of a network or permissions problem. Also, ensure that IIS Common component is installed on workstation. Error: {1}" P1="../Exception/@Message" S2="%varExName%" GUID="4f64e3b8-b1ba-4353-af48-cbf396a026ee"/>
									<Setting Key1="61536" Substitution="GUID" SubstitutionFormat="^{(.*?)}$----$1">
										<Rule Name="szDomainName" Query="replace(../../@Name, '^.*/(?i:domain)/(.*)$', '$1')"/>
										<Rule Name="fMultipleGUID" Query="count($.) &gt;1" Error="Warning" Sev="2" Title="Metabase entry with multiple corresponding GUIDs" Text="Key '{1}' was found in the metabase on server {2} but multiple corresponding GUIDs are found for this entry. Unless multiple recipient policies have same SMTP addresses, this could be the result of conflicting entries in recipient policies and SMTP connectors such as an SMTP connector addressed to an authoritative SMTP domain." P1="../../@Name" S2="%varExName%"/>
										<Rule Name="fDomainNotFoundinDS" Query="$.!='' and not($fDirectoryErrorMetabaseGUID) and count($szMetabaseGUIDDN) &lt;1" Error="Warning" Sev="2" Title="Possible orphaned metabase entry" Text="Key '{1}' was found in the metabase on server {2} but it cannot be resolved to an object in Active Directory. Please verify this metabase entry is valid." P1="../../@Name" S2="%varExName%" AlwaysEvaluate="True"/>
										<Rule Name="fDomainForOtherSMTPVSFoundinDS" Query="$.!='' and count($szLocalBHDN) &gt;0 and not($fLocalBHIncluded)" Error="Warning" Sev="2" Title="Possible orphaned metabase entry" Text="Domain '{1}' was found in the metabase for SMTP instance '{3}' on server {2} but this SMTP instance is not designated as a local bridgehead server for the corresponding SMTP connector '{4}'. Please verify this metabase entry is valid." P1="$szDomainName" S2="%varExName%" P3="unpack('%varAllSMTPInstanceName%', '%SORTKEY%')" P4="$szMetabaseGUIDCN" AlwaysEvaluate="True"/>
									</Setting>
									<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="&lt;GUID=%GUID%&gt;">
										<Rule Name="fDirectoryErrorMetabaseGUID" Query="../Exception/@Message"/>
										<Setting Key1="cn">
											<Rule Name="szMetabaseGUIDCN" Query="$."/>
										</Setting>
										<Setting Key1="distinguishedName">
											<Rule Name="szMetabaseGUIDDN" Query="$."/>
										</Setting>
										<Setting Key1="msExchSourceBridgeheadServersDN">
											<Rule Name="szLocalBHDN" Query="$."/>
											<Rule Name="fLocalBHIncluded" Query="count($.[upper-case(.)=upper-case('CN=%SMTPINSTANCE%,CN=SMTP,CN=Protocols,%varExDN%')]) &gt;0"/>
										</Setting>
									</Object>
								</Object>
								<Rule Name="fNoMetabaseIssueFound" Query="count($fMetabaseException) &lt;1 and count($fMultipleGUID) &lt;1 and count($fDomainNotFoundinDS) &lt;1 and count($fDomainForOtherSMTPVSFoundinDS) &lt;1" Error="None" Title="All domain routing metabase entries identified" Text="The domain routing entries in the metabase on server {2} have corresponding objects in Active Directory." S2="%varExName%" AlwaysEvaluate="True"/>
							</Object>

							<!-- For inbound, let's check if a recipient policy matches the domain -->
							<Object Type="If" Key1="'%varSelSymptom%'='Inbound'">
								<Object Type="Variable" Name="InboundDomain" Key1="Unpack" Key2="%varAllConcatRCPTAddressServerBindingList%">
									<Setting Key1="__VALUE" Substitution="RCPTDOMAIN" SubstitutionFormat="^.*@(.*?),.*,.*$----$1"/>
									<!-- Use cache to remove duplicates -->
									<Object Type="Cache" Name="Recipient Domain" Key1="Add" Key2="Domain" Key3="%RCPTDOMAIN%" Display="Hide">
										<Setting Key1="Domain">
											<Rule Name="fNoRecipPolicy" Query="count($szDomain[upper-case(.)=concat('SMTP:@', upper-case($.))]) &lt;1" Error="Error" Sev="1" ReportIssue="RootCause" Title="No recipient policy found for the destined address" Text="A test message was addressed to SMTP domain '{1}', but no recipient policy matches this address. Please ensure that this domain is local. Create a recipient policy if necessary to accept messages addressed to this domain." P1="$."/>
										</Setting>
									</Object>
								</Object>
							</Object>
							<Rule Name="szCheckDomainRouting" Query="'CheckDomainRouting'">
								<Variable Name="varPreviousName" Scope="Children"/>
							</Rule>
							<Rule Name="szExErrorStateText" Query="if($fDomainRoutingIssueFound,string(@Title),$szExNoErrorStateText)" Title="At least one potential domain routing issue was identified." AlwaysEvaluate="True">
								<Variable Name="varErrorStateText" Scope="Global"/>
							</Rule>
							<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No domain routing issues were identified."/>
							<Rule Name="szCheckDomainRoutingResult" Query="string(@Title)" Title="Domain Routing Analysis Results">
								<Variable Name="varDisplayTitle" Scope="Global"/>
							</Rule>

							<Rule Name="fDomainRoutingIssueFound" Query="not($fNoRecipPolicySMTPConnectorIssueFound and $fNoMetabaseIssueFound) or $fNoRecipPolicy" AlwaysEvaluate="True"/>

							<Rule NextStep="DisplayResultsStep" Name="fDisplayDomainRoutingStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
						</Object>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="DisplayResultsStep" Title="Test Results" Display="HideAll">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varDisplayTitle%" Substitution="varDisplayTitle" Display="Hide"/>
			<Setting Key1="%varErrorStateText%" Substitution="varErrorStateText" Display="Hide"/>
			<Setting Key1="%varPreviousName%" Substitution="varPreviousName" Display="Hide"/>

			<Object Type="Information" HelpId="html\b669b0b8-7dc2-42f2-a0cd-a60f543f5bb1.htm">
				<Object Type="Control" SubType="Title" Position="Top" Text="%varDisplayTitle%"/>
				<Object Type="Control" SubType="Label" Position="Below" Text="%varErrorStateText%" Width="FullWidth"/>
				<Object Type="Control" SubType="Reports" Name="InterimReports" Position="LeftBelow" Width="FullWidth" Height="400">
					<Report Title="Exchange Server State" ArrangeByText="Area,Server" Query="//Object[@Name='%STEPNAMEPREFIX%%varPreviousName%' and not(@StepStatus='Deactivated')]//Message[@ReportIssue='Summary']"/>
					<Report Title="Possible Root Causes Found" ArrangeByText="Area,Server" Query="//Object[@Name='%STEPNAMEPREFIX%%varPreviousName%' and not(@StepStatus='Deactivated')]//Message[@Error='Error' and @ReportIssue='RootCause']"/>
					<Report Title="Mail Flow Issues Found" ArrangeByText="Area,Server" Query="//Object[@Name='%STEPNAMEPREFIX%%varPreviousName%' and not(@StepStatus='Deactivated')]//Message[@Error='Error' and @ReportIssue='Issue']"/>
					<Report Title="Other Errors" ArrangeByText="Area,Server" Query="//Object[@Name='%STEPNAMEPREFIX%%varPreviousName%' and not(@StepStatus='Deactivated')]//Message[@Error='Error' and not(@ReportIssue)]"/>
					<Report Title="Other Warnings" ArrangeByText="Area,Server" Query="//Object[@Name='%STEPNAMEPREFIX%%varPreviousName%' and not(@StepStatus='Deactivated')]//Message[@Error='Warning' and not(@ReportIssue='Summary') and not(@ReportIssue='Recommendation')]"/>
					<Report Title="Informational Items" ArrangeByText="Area,Server" Query="//Object[@Name='%STEPNAMEPREFIX%%varPreviousName%' and not(@StepStatus='Deactivated')]//Message[not(@Error='Warning') and not(@Error='Error')and not(@NextStep) and not(@Display='Hide') and not(@ReportIssue='Summary') and not(@ReportIssue='Recommendation')]"/>
				</Object>

				<Object Type="IfResults" Name="DoNext" Key1="count(//Object[@Name='%STEPNAMEPREFIX%%varPreviousName%' and not(@StepStatus='Deactivated')]//Rule[@NextStep and @Pass='True' and not(string-length(@Text)=0)]) &gt; 0">
					<Object Type="Control" SubType="Label" Position="Below" Text="The tool will now do the following: " LineSpace="2" Width="FullWidth" BackColor="AliceBlue" FontStyle="Bold" FontFamily="Arial"/>
					<Object Type="Control" SubType="Labels" Position="Below" LineSpace="0" Width="FullWidth" FontFamily="Arial" Query="//Object[@Name='%STEPNAMEPREFIX%%varPreviousName%' and not(@StepStatus='Deactivated')]//Message[@NextStep]"/>
				</Object>

				<Object Type="Control" SubType="Link" Name="Previous" Position="Below" LineSpace="2" Text="Previous"/>
				<Object Type="Control" SubType="Link" Name="Next" Position="NextTo" Percent="20" Text="Next"/>

			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<!-- ****************************************************************************************************************** -->
	<!-- The Error Steps (as in, an error occurred... can't continue troubleshooting)										-->
	<!-- ****************************************************************************************************************** -->
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="InputErrors" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varPreviousName%" Substitution="varPreviousName" Display="Hide"/>

			<Object Type="Panel" Display="Hide" HelpId="html\1c4b9eca-4714-4a61-ba7c-91f1bf4e53fc.htm">
				<Object Type="Control" SubType="Title" Name="title" Position="Top" Text="Errors with input data"/>
				<Object Type="Control" SubType="Reports" Name="ErrorReports" Position="LeftBelow" Width="FullWidth" Height="400">
					<Report Title="Errors" Query="//Object[@Name='%STEPNAMEPREFIX%%varPreviousName%' and not(@StepStatus='Deactivated')]//Message[@Error='Error']"/>
				</Object>
				<Object Type="Control" SubType="Link" Name="Previous" Position="LeftBelow" Text="Go Back"/>
			</Object>
		</Object>
	</Object>

	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="InitializeMessageTracking" Display="Left">
		<Object Type="Action" Display="Hide">
			<Object Type="If" Key1="true()" Display="HideAll">
				<Setting Key1="'1'" SQM="92;Set"/>
			</Object>
			<Object Type="Group" Name="InitializeMessageTracking">
				<Rule Name="szToInitializeMessageTracking" Query="string('')">
					<Variable Name="szServerHostname" Scope="Children"/>
					<Variable Name="szEventID" Scope="Children"/>
					<Variable Name="szSenderAddress" Scope="Children"/>
					<Variable Name="szRecipientAddress" Scope="Children"/>
					<Variable Name="szMessageID" Scope="Children"/>
					<Variable Name="szInternalMessageID" Scope="Children"/>
					<Variable Name="szMessageSubject" Scope="Children"/>
					<Variable Name="szReference" Scope="Children"/>
				</Rule>
				<Rule Name="szTrue" Query="string('1')">
					<Variable Name="fCheckBoxEventID" Scope="Children"/>
					<Variable Name="fCheckBoxStart" Scope="Children"/>
					<Variable Name="fCheckBoxEnd" Scope="Children"/>
				</Rule>
				<Rule Name="szFalse" Query="string('0')">
					<Variable Name="fCheckBoxRecipient" Scope="Children"/>
					<Variable Name="fCheckBoxSender" Scope="Children"/>
					<Variable Name="fCheckBoxServer" Scope="Children"/>
					<Variable Name="fCheckBoxMessageID" Scope="Children"/>
					<Variable Name="fCheckBoxInternalMessageID" Scope="Children"/>
					<Variable Name="fCheckBoxMessageSubject" Scope="Children"/>
					<Variable Name="fCheckBoxReference" Scope="Children"/>
				</Rule>
				<Rule NextStep="MessageTracking" Name="fGotoMessageTracking" Query="true()"/>
			</Object>
			<Object Type="WMI" Key1="" Key3="Win32_OperatingSystem">
				<Setting Key1="LocalDateTime" Format="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})\d{2}\.\d{6}[\+|\-]\d{3}----$1/$2/$3 $4:$5:00">
					<Rule Name="szEnd" Query="$.">
						<Variable Name="szEnd" Scope="Children"/>
					</Rule>
					<Rule Name="szStart" Query="date-add($., get-timespan(-600))">
						<Variable Name="szStart" Scope="Children"/>
					</Rule>
				</Setting>
			</Object>
		</Object>
	</Object>

	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MessageTracking" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%szServerHostname%" Substitution="szServerHostname" Display="Hide"/>
			<Setting Key1="%szEventID%" Substitution="szEventID" Display="Hide"/>
			<Setting Key1="%szSenderAddress%" Substitution="szSenderAddress" Display="Hide"/>
			<Setting Key1="%szRecipientAddress%" Substitution="szRecipientAddress" Display="Hide"/>
			<Setting Key1="%szMessageID%" Substitution="szMessageID" Display="Hide"/>
			<Setting Key1="%szInternalMessageID%" Substitution="szInternalMessageID" Display="Hide"/>
			<Setting Key1="%szMessageSubject%" Substitution="szMessageSubject" Display="Hide"/>
			<Setting Key1="%szReference%" Substitution="szReference" Display="Hide"/>
			<Setting Key1="%szStart%" Substitution="szStart" Display="Hide"/>
			<Setting Key1="%szEnd%" Substitution="szEnd" Display="Hide"/>
			<Setting Key1="%fCheckBoxServer%" Substitution="fCheckBoxServer" Display="Hide"/>
			<Setting Key1="%fCheckBoxEventID%" Substitution="fCheckBoxEventID" Display="Hide"/>
			<Setting Key1="%fCheckBoxRecipient%" Substitution="fCheckBoxRecipient" Display="Hide"/>
			<Setting Key1="%fCheckBoxSender%" Substitution="fCheckBoxSender" Display="Hide"/>
			<Setting Key1="%fCheckBoxMessageID%" Substitution="fCheckBoxMessageID" Display="Hide"/>
			<Setting Key1="%fCheckBoxInternalMessageID%" Substitution="fCheckBoxInternalMessageID" Display="Hide"/>
			<Setting Key1="%fCheckBoxMessageSubject%" Substitution="fCheckBoxMessageSubject" Display="Hide"/>
			<Setting Key1="%fCheckBoxReference%" Substitution="fCheckBoxReference" Display="Hide"/>
			<Setting Key1="%fCheckBoxStart%" Substitution="fCheckBoxStart" Display="Hide"/>
			<Setting Key1="%fCheckBoxEnd%" Substitution="fCheckBoxEnd" Display="Hide"/>
			<Object Type="If" Key1="true()" Display="Hide">
				<Setting Key1="if('%szSenderAddress%'='','False','True')" Substitution="HASSENDER"/>
				<Setting Key1="if('%szRecipientAddress%'='','False','True')" Substitution="HASRECIP"/>

				<Setting Key1="if('%fCheckBoxMessageID%'='0','False','True')" Substitution="MESSAGEIDSET"/>
				<Setting Key1="if('%fCheckBoxMessageSubject%'='0','False','True')" Substitution="MESSAGESUBJECTSET"/>
				<Setting Key1="if('%fCheckBoxReference%'='0','False','True')" Substitution="REFERENCESET"/>
				<Setting Key1="if('%fCheckBoxInternalMessageID%'='0','False','True')" Substitution="INTERNALMESSAGEIDSET"/>
				<Setting Key1="if('%fCheckBoxServer%'='0','False','True')" Substitution="SERVERSET"/>
				<Setting Key1="if('%fCheckBoxSender%'='0','False','True')" Substitution="SENDERSET"/>
				<Setting Key1="if('%fCheckBoxRecipient%'='0','False','True')" Substitution="RECIPIENTSET"/>
				<Setting Key1="if('%fCheckBoxEventID%'='0','False','True')" Substitution="EVENTIDSET"/>
				<Setting Key1="if('%fCheckBoxStart%'='0','False','True')" Substitution="STARTSET"/>
				<Setting Key1="if('%fCheckBoxEnd%'='0','False','True')" Substitution="ENDSET"/>

				<Object Type="Panel" Display="Hide" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
					<Object Type="Control" SubType="Title" Name="title" Position="Top" Text="Message Tracking Parameters"/>
					<Object Type="Control" SubType="Label" Name="label0" Position="Below" Text="Select check boxes to include criteria in the message tracking search."/>

					<Object Type="Control" SubType="Label" Name="Recipient0" Position="LeftBelow" Width="200" Text="Recipients"/>
					<Object Type="Control" SubType="CheckBox" Name="Recipient1" Position="220," Width="20" Text="" Default="%fCheckBoxRecipient%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="Recipients:" Query="control-value('Recipient1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="Recipient1" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxRecipient" Query="$.">
								<Variable Name="fCheckBoxRecipient" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="TextBox" Name="Recipients:" Position="245," Width="300" Default="%szRecipientAddress%" Display="Hide" Flags="Enabled=%RECIPIENTSET%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="Recipient3" Query="control-value('Recipients:')!=''"/>
							<Action Type="ExecuteQuery" ControlName="Recipients" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="Recipient">
							<Rule Name="szRecipientAddress" Query="$.">
								<Variable Name="szRecipientAddress" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Button" Name="Recipient3" Width="160" Position="NextTo" Text="Resolve Recipient" Flags="Enabled=%HASRECIP%">
						<Event Type="Click">
							<Action Type="ExecuteQuery" ControlName="Recipient3" Query="control-value('Recipients:', directory-lookup('GC:', concat('(&amp;(anr=', control-value('Recipients:'), ')(mail=*))'), 'Subtree', 'mail'))"/>
						</Event>
					</Object>

					<Object Type="Control" SubType="Label" Name="Sender0" Position="At(Recipient0),After(Recipient0)" Width="200" Text="Sender"/>
					<Object Type="Control" SubType="CheckBox" Name="Sender1" Position="At(Recipient1)," Width="20" Text="" Default="%fCheckBoxSender%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="Sender" Query="control-value('Sender1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="Sender1" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxSender" Query="$.">
								<Variable Name="fCheckBoxSender" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="TextBox" Name="Sender" Position="At(Recipients:)," Width="300" Default="%szSenderAddress%" Display="Hide" Flags="Enabled=%SENDERSET%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="Sender3" Query="control-value('Sender')!=''"/>
							<Action Type="Enable" ControlName="Server3" Query="control-value('Sender')!=''"/>
							<Action Type="ExecuteQuery" ControlName="Sender" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="Sender">
							<Rule Name="szSenderAddress" Query="$.">
								<Variable Name="szSenderAddress" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Button" Name="Sender3" Width="160" Position="NextTo" Text="Resolve Sender" Flags="Enabled=%HASSENDER%">
						<Event Type="Click">
							<Action Type="ExecuteQuery" ControlName="Sender3" Query="control-value('Sender', directory-lookup('GC:', concat('(&amp;(anr=', control-value('Sender'), ')(mail=*))'), 'Subtree', 'mail'))"/>
						</Event>
					</Object>

					<Object Type="Control" SubType="Label" Name="Server0" Position="At(Sender0),After(Sender0)" Width="200" Text="Server"/>
					<Object Type="Control" SubType="CheckBox" Name="Server1" Position="At(Recipient1)," Width="20" Text="" Default="%fCheckBoxServer%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="Server" Query="control-value('Server1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="Server1" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxServer" Query="$.">
								<Variable Name="fCheckBoxServer" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="TextBox" Name="Server" Position="At(Recipients:)," Width="300" Default="%szServerHostname%" Display="Hide" Flags="Enabled=%SERVERSET%">
						<Event Type="Changed">
							<Action Type="ExecuteQuery" ControlName="Server" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="Server">
							<Rule Name="szServerHostname" Query="$.">
								<Variable Name="szServerHostname" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Button" Name="Server3" Width="160" Position="NextTo" Text="Server from Sender" Flags="Enabled=%HASSENDER%">
						<Event Type="Click">
							<Action Type="ExecuteQuery" ControlName="Server3" Query="control-value('Server', replace(directory-lookup('GC:', concat('(&amp;(anr=', control-value('Sender'), ')(mail=*))'), 'Subtree', 'msExchHomeServerName'), '^.*[cC][nN]=', ''))"/>
						</Event>
					</Object>

					<Object Type="Control" SubType="Label" Name="EventID0" Position="At(Server0),After(Server0)" Width="200" Text="EventID"/>
					<Object Type="Control" SubType="CheckBox" Name="EventID1" Position="At(Recipient1)," Width="20" Text="" Default="%fCheckBoxEventID%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="EventID" Query="control-value('EventID1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="EventID1" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxEventID" Query="$.">
								<Variable Name="fCheckBoxEventID" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="ComboBox" Name="EventID" Position="At(Recipients:)," Width="300" SelectedValue="%szEventID%" Default="{7}RECEIVE{4}SEND{4}FAIL{3}DSN{7}DELIVER{7}BADMAIL{7}RESOLVE{6}EXPAND{8}REDIRECT{8}TRANSFER{6}SUBMIT{13}POISONMESSAGE{5}DEFER" Display="Hide" Flags="Enabled=%EVENTIDSET%">
						<Event Type="Changed">
							<Action Type="ExecuteQuery" ControlName="EventID" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="EventID">
							<Rule Name="szEventID" Query="$.">
								<Variable Name="szEventID" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>

					<Object Type="Control" SubType="Label" Name="MessageID0" Position="At(EventID0),After(EventID0)" Width="200" Text="MessageID"/>
					<Object Type="Control" SubType="CheckBox" Name="MessageID1" Position="At(Recipient1)," Width="20" Text="" Default="%fCheckBoxMessageID%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="MessageID" Query="control-value('MessageID1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="MessageID1" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxMessageID" Query="$.">
								<Variable Name="fCheckBoxMessageID" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="TextBox" Name="MessageID" Position="At(Recipients:)," Width="300" Default="%szMessageID%" Display="Hide" Flags="Enabled=%MESSAGEIDSET%">
						<Event Type="Changed">
							<Action Type="ExecuteQuery" ControlName="MessageID" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="MessageID">
							<Rule Name="szMessageID" Query="$.">
								<Variable Name="szMessageID" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>

					<Object Type="Control" SubType="Label" Name="InternalMessageID0" Position="At(MessageID0),After(MessageID0)" Width="200" Text="InternalMessageID"/>
					<Object Type="Control" SubType="CheckBox" Name="InternalMessageID1" Position="At(Recipient1)," Width="20" Text="" Default="%fCheckBoxInternalMessageID%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="InternalMessageID" Query="control-value('InternalMessageID1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="InternalMessageID1" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxInternalMessageID" Query="$.">
								<Variable Name="fCheckBoxInternalMessageID" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="TextBox" Name="InternalMessageID" Position="At(Recipients:)," Width="300" Default="%szInternalMessageID%" Display="Hide" Flags="Enabled=%INTERNALMESSAGEIDSET%">
						<Event Type="Changed">
							<Action Type="ExecuteQuery" ControlName="InternalMessageID" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="InternalMessageID">
							<Rule Name="szInternalMessageID" Query="$.">
								<Variable Name="szInternalMessageID" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>

					<Object Type="Control" SubType="Label" Name="MessageSubject0" Position="At(InternalMessageID0),After(InternalMessageID0)" Width="200" Text="Subject"/>
					<Object Type="Control" SubType="CheckBox" Name="MessageSubject1" Position="At(Recipient1)," Width="20" Text="" Default="%fCheckBoxMessageSubject%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="MessageSubject" Query="control-value('MessageSubject1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="MessageSubject1" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxMessageSubject" Query="$.">
								<Variable Name="fCheckBoxMessageSubject" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="TextBox" Name="MessageSubject" Position="At(Recipients:)," Width="300" Default="%szMessageSubject%" Display="Hide" Flags="Enabled=%MESSAGESUBJECTSET%">
						<Event Type="Changed">
							<Action Type="ExecuteQuery" ControlName="MessageSubject" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="MessageSubject">
							<Rule Name="szMessageSubject" Query="$.">
								<Variable Name="szMessageSubject" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>

					<Object Type="Control" SubType="Label" Name="Reference0" Position="At(MessageSubject0),After(MessageSubject0)" Width="200" Text="Reference"/>
					<Object Type="Control" SubType="CheckBox" Name="Reference1" Position="At(Recipient1)," Width="20" Text="" Default="%fCheckBoxReference%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="Reference" Query="control-value('Reference1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="Reference1" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxReference" Query="$.">
								<Variable Name="fCheckBoxReference" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="TextBox" Name="Reference" Position="At(Recipients:)," Width="300" Default="%szReference%" Display="Hide" Flags="Enabled=%REFERENCESET%">
						<Event Type="Changed">
							<Action Type="ExecuteQuery" ControlName="Reference" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="Reference">
							<Rule Name="szReference" Query="$.">
								<Variable Name="szReference" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>

					<Object Type="Control" SubType="Label" Name="Start0" Position="At(Reference0),After(Reference0)" Width="200" Text="Start"/>
					<Object Type="Control" SubType="CheckBox" Name="Start1" Position="At(Recipient1)," Width="20" Text="" Default="%fCheckBoxStart%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="Start" Query="control-value('Start1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="Start1" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxStart" Query="$.">
								<Variable Name="fCheckBoxStart" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="DateTimePicker" Name="Start" Position="At(Recipients:)," Default="%szStart%" Display="Hide" Flags="Enabled=%STARTSET%">
						<Event Type="Changed">
							<Action Type="ExecuteQuery" ControlName="Start" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="DateTime">
							<Rule Name="szStart" Query="$.">
								<Variable Name="szStart" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Label" Name="Start3" Position="Below" Text="" LineSpace="0.2"/>

					<Object Type="Control" SubType="Label" Name="End0" Position="At(Start0),After(Start0)" Width="200" Text="End"/>
					<Object Type="Control" SubType="CheckBox" Name="End1" Position="At(Recipient1)," Width="20" Text="" Default="%fCheckBoxEnd%">
						<Event Type="Changed">
							<Action Type="Enable" ControlName="End" Query="control-value('End1')='1'"/>
							<Action Type="ExecuteQuery" ControlName="End" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="CheckBox">
							<Rule Name="fCheckBoxEnd" Query="$.">
								<Variable Name="fCheckBoxEnd" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="DateTimePicker" Name="End" Position="At(Recipients:)," Default="%szEnd%" Display="Hide" Flags="Enabled=%ENDSET%">
						<Event Type="Changed">
							<Action Type="ExecuteQuery" ControlName="End" Query="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))"/>
						</Event>
						<Setting Key1="DateTime">
							<Rule Name="szEnd" Query="$.">
								<Variable Name="szEnd" Scope="Local"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Label" Name="End3" Position="Below" Text=""/>

					<Object Type="Control" SubType="Label" Name="Cmd0" Position="At(End0),After(End0)" LineSpace="2" Text="Exchange Management Shell command"/>
					<Object Type="RichTextBox" Name="Cmd1" Position="At(Cmd0),After(Cmd0)" Width="FullWidth" Height="50" Display="Hide">
					</Object>
					<Object Type="If" Key1="true()">
						<Setting Key1="control-value('Cmd1', concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End')))">
							<Rule Name="szCommand" Query="concat('get-messagetrackinglog', command-switches('Recipients:', 'Sender', 'Server', 'EventID', 'MessageID', 'InternalMessageID', 'MessageSubject', 'Reference', 'Start', 'End'))">
								<Variable Name="szCommand" Scope="Children"/>
							</Rule>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Link" Name="Previous" Position="LeftBelow" Text="Go Back"/>
					<Object Type="Control" SubType="Link" Name="Next" NextStep="MessageTrackingResults" Position="NextTo" Percent="20" Text="Next"/>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MessageTrackingResults" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%szCommand%" Substitution="szCommand" Display="Hide"/>

			<Object Type="Progress" Title="Executing Message Tracking Request" Text="Please wait while the tool collects the data for the message tracking request." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="MonadData" Name="Message Tracking" Key1="%szCommand%">
					<Rule Name="szMonadDataErrors" Query="string(../Exception/@Message)" AlwaysEvaluate="True">
						<Variable Name="szMonadDataErrors" Scope="Children"/>
					</Rule>
					<Rule Name="fMonadDataErrors" Query="if(count(../Exception/@Message) &gt; 0,'1','0')" AlwaysEvaluate="True">
						<Variable Name="fMonadDataErrors" Scope="Children"/>
					</Rule>
					<Setting Key1="Timestamp" Format="SortableDateTime"/>
					<Setting Key1="EventId"/>
					<Setting Key1="Source"/>
					<Setting Key1="SourceContext"/>
					<Setting Key1="MessageId"/>
					<Setting Key1="MessageSubject"/>
					<Setting Key1="Sender"/>
					<Setting Key1="Recipients"/>
					<Setting Key1="InternalMessageId"/>
					<Setting Key1="ClientIp"/>
					<Setting Key1="ClientHostname"/>
					<Setting Key1="ServerIp"/>
					<Setting Key1="ServerHostname"/>
					<Setting Key1="ConnectorId"/>
					<Setting Key1="RecipientStatus"/>
					<Setting Key1="TotalBytes"/>
					<Setting Key1="RecipientCount"/>
					<Setting Key1="RelatedRecipientAddress"/>
					<Setting Key1="Reference"/>
					<Setting Key1="ReturnPath"/>
					<Setting Key1="MessageInfo"/>
					<Object Type="DataGrid" Name="DataGrid1" Key1="Save" Key2="Results"/>
				</Object>
			</Object>
			<Rule NextStep="MessageTrackingGrid" Name="fMessageTrackingResults" Query="true()"/>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="MessageTrackingGrid">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%szMonadDataErrors%" Substitution="szMonadDataErrors" Display="Hide"/>
			<Setting Key1="%fMonadDataErrors%" Substitution="fMonadDataErrors" Display="Hide"/>
			<Object Type="Panel" Display="Hide" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<Object Type="Control" SubType="Title" Name="title" Position="Top" Text="Message Tracking Results"/>
				<Object Type="If" Key1="'%fMonadDataErrors%'='1'">
					<Object Type="Control" SubType="Label" Name="label0" Position="Below" Text="{0}" S0="%szMonadDataErrors%"/>
				</Object>
				<Object Type="DataGrid" Name="DataGrid0" Key1="Rows" Key2="Results">
					<Setting Key1="Rows" Substitution="ROWS"/>
					<Object Type="If" Key1="%ROWS% &gt; 0">
						<Object Type="Control" SubType="Label" Name="label" Position="Below" Text="Selected row will populate parameters for next message tracking search."/>
					</Object>
					<Object Type="If" Key1="%ROWS% = 0">
						<Object Type="Control" SubType="Label" Name="label2" Position="Below" Text="No results."/>
					</Object>
					<Object Type="DataGrid" Name="DataGrid1" Key1="Load" Key2="Results" Position="Below" Height="480">
						<Setting Key1="TimeStamp">
							<Rule Name="szNow" Query="date-parse($., 'yyyy/MM/dd HH:mm:ss')"/>
							<Rule Name="szStart" Query="date-add($szNow, get-timespan(-600))">
								<Variable Name="szStart" Scope="Children"/>
							</Rule>
							<Rule Name="szEnd" Query="date-add($szNow, get-timespan(600))">
								<Variable Name="szEnd" Scope="Children"/>
							</Rule>
							<Rule Name="fCheckBoxStartEnd" Query="string('1')">
								<Variable Name="fCheckBoxStart" Scope="Children"/>
								<Variable Name="fCheckBoxEnd" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="ServerHostname">
							<Rule Name="szNextHopServerHostname" Query="if ($fSend and $fRelay and $fServerIpName, $szServerIpName, $.)">
								<Variable Name="szServerHostname" Scope="Children"/>
							</Rule>
							<Rule Name="fCheckBoxServer" Query="$szNextHopServerHostname!=''">
								<Variable Name="fCheckBoxServer" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="EventID">
							<Rule Name="szEventID" Query="$.">
								<Variable Name="szEventID" Scope="Children"/>
							</Rule>
							<Rule Name="fCheckBox0" Query="string('0')">
								<Variable Name="fCheckBoxEventID" Scope="Children"/>
								<Variable Name="fCheckBoxReference" Scope="Children"/>
								<Variable Name="fCheckBoxSender" Scope="Children"/>
								<Variable Name="fCheckBoxRecipient" Scope="Children"/>
								<Variable Name="fCheckBoxInternalMessageID" Scope="Children"/>
								<Variable Name="fCheckBoxMessageSubject" Scope="Children"/>
							</Rule>
							<Rule Name="fSend" Query="$.='SEND'"/>
						</Setting>
						<Setting Key1="Sender">
							<Rule Name="szSenderAddress" Query="$.">
								<Variable Name="szSenderAddress" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="Recipients">
							<Rule Name="szRecipientAddress" Query="$.">
								<Variable Name="szRecipientAddress" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="Reference">
							<Rule Name="szReference" Query="$.">
								<Variable Name="szReference" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="InternalMessageId">
							<Rule Name="szInternalMessageId" Query="$.">
								<Variable Name="szInternalMessageID" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="MessageId">
							<Rule Name="szMessageId" Query="$.">
								<Variable Name="szMessageID" Scope="Children"/>
							</Rule>
							<Rule Name="fCheckBoxMessageID" Query="$.!=''">
								<Variable Name="fCheckBoxMessageID" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="MessageSubject">
							<Rule Name="szMessageSubject" Query="$.">
								<Variable Name="szMessageSubject" Scope="Children"/>
							</Rule>
						</Setting>
						<Setting Key1="ServerIp">
							<Rule Name="szServerIpName" Query="resolve($.)"/>
							<Rule Name="fServerIpName" Query="$.!=''"/>
						</Setting>
						<Setting Key1="ClientIp"/>
						<Setting Key1="ConnectorId">
							<Rule Name="fRelay" Query="contains(upper-case($.), 'INTRAORG SMTP SEND CONNECTOR')"/>
						</Setting>
					</Object>
					<Object Type="Control" SubType="Link" Name="Previous" Position="LeftBelow" Text="Go Back"/>
					<Object Type="If" Key1="%ROWS% &gt; 0">
						<Object Type="Control" SubType="Link" Name="Next" NextStep="MessageTracking" Position="NextTo" Percent="20" Text="Next"/>
					</Object>
				</Object>
			</Object>
		</Object>
	</Object>
	<!-- ****************************************************************************************************************** -->
	<!-- Check health of the Mailbox server role to determine if there are issues with client submission and hints about transport submission -->
	<Object Type="Step" Name="CheckMailboxRoleHealth" Title="Check Mailbox Server Role Health" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varSiteGuid%" Substitution="varSiteGuid" Display="Hide"/>
			<Setting Key1="%varIsMemberOfCluster%" Substitution="varIsMemberOfCluster" Display="Hide"/>
			<Setting Key1="%varMonadDCParameter%" Substitution="varMonadDCParameter" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>

			<Object Type="Progress" Title="Checking Mailbox Server Role Health" Text="Please wait while the tool checks the health of server {2}. This includes verification that necessary services are in a proper state, the server is accepting logons on all databases, performance data collection to determine if local submission is progressing, and identification of servers in the same Active Directory site with Hub Transport server role installed." S2="%varExName%" HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<!-- Begin 'Server' Group -->
				<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True">

					<!-- Begin Mailbox Server Role Health Group-->
					<Object Type="Group" Name="Mailbox Server Role Health" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">

						<!-- Check whether the MSExchangeADTopology service is up and running -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='MSExchangeADTopology'">
							<Setting Key1="Started">
								<Rule Name="fMSExchangeADTopologyStarted" Query="$.='True'"/>
								<Rule Name="fMSExchangeADTopologyNotStarted" Query="$.='False'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not started" Text="'{0}' service on server {2} is not started. It is important for this service to be started for Exchange to operate properly." S0="MSExchangeADTopology" S2="%varExName%"/>
							</Setting>
							<Setting Key1="State">
								<Rule Name="fMSExchangeADTopologyRunning" Query="$fMSExchangeADTopologyStarted and $.='Running'" Error="None" Title="'{0}' service is started and running" Text="'{0}' service on server {2} is started and running." S0="MSExchangeADTopology" S2="%varExName%"/>
								<Rule Name="fMSExchangeADTopologyNotRunning" Query="not($.='Running') and not($fMSExchangeADTopologyNotStarted)" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service state on server {2} is '{1}'. Messages will remain on the user's mailbox server." S0="MSExchangeADTopology" P1="$." S2="%varExName%"/>
							</Setting>
							<Setting Key1="StartMode">
								<Rule Name="fMSExchangeADTopologyDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service disabled" Text="SMTP service on server {2} is disabled. It is important for this service to be running for Exchange to operate properly." S0="MSExchangeADTopology" S2="%varExName%"/>
								<Rule Name="fMSExchangeADTopologyManual" Query="$.='Manual'" Error="Warning" Sev="2" Title="'{0}' service manual startup" Text="'{0}' service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="MSExchangeADTopology" S2="%varExName%"/>
							</Setting>
						</Object>

						<!-- Check whether the MSExchangeIS service is up and running -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='MSExchangeIS'">
							<Setting Key1="Started">
								<Rule Name="fMSExchangeISStarted" Query="$.='True'"/>
								<Rule Name="fMSExchangeISNotStarted" Query="$.='False'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not started" Text="'{0}' service on server {2} is not started. Users will be unable to send or receive mail." S0="MSExchangeIS" S2="%varExName%"/>
							</Setting>
							<Setting Key1="State">
								<Rule Name="fMSExchangeISRunning" Query="$fMSExchangeISStarted and $.='Running'" Error="None" Title="'{0}' service started and running" Text="'{0}' service on server {2} is started and running." S0="MSExchangeIS" S2="%varExName%"/>
								<Rule Name="fMSExchangeISNotRunning" Query="not($.='Running') and not($fMSExchangeISNotStarted)" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service state on server {2} is '{1}'. Users may be unable to send or receive mail." S0="MSExchangeIS" P1="$." S2="%varExName%"/>
							</Setting>
							<Setting Key1="StartMode">
								<Rule Name="fMSExchangeISDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service disabled" Text="'{0}' service on server {2} is disabled. Users will be unable to send or receive mail." S0="MSExchangeIS" S2="%varExName%"/>
								<Rule Name="fMSExchangeISManual" Query="$.='Manual' and not('%varIsMemberOfCluster%'='1')" Error="Warning" Sev="2" Title="'{0}' service manual startup" Text="'{0}' service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="MSExchangeIS" S2="%varExName%"/>
							</Setting>
						</Object>

						<!-- Check whether the MSExchangeMailSubmission service is up and running -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='MSExchangeMailSubmission'">
							<Rule Name="fWmiException" Query="../Exception/@Message" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fMSExchangeMailSubmissionNotFound" Query="count(../Instance)=0" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not found" Text="'{0}' service on server {2} was not found to be installed. This service is required for messages submitted by clients to be submitted to the Hub Transport server for subsequent routing." S0="MSExchangeMailSubmission" S2="%varExName%"/>
							<Setting Key1="Started">
								<Rule Name="fMSExchangeMailSubmissionStarted" Query="$.='True'"/>
								<Rule Name="fMSExchangeMailSubmissionNotStarted" Query="$.='False'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not started" Text="'{0}' service on server {2} is not started. It is important for this service to be started for the Mailbox server role computer to submit messages to the Hub Transport server role computers." S0="MSExchangeMailSubmission" S2="%varExName%"/>
							</Setting>
							<Setting Key1="State">
								<Rule Name="fMSExchangeMailSubmissionRunning" Query="$fMSExchangeMailSubmissionStarted and $.='Running'" Error="None" Title="'{0}' service started and running" Text="'{0}' service on server {2} is started and running." S0="MSExchangeMailSubmission" S2="%varExName%"/>
								<Rule Name="fMSExchangeMailSubmissionNotRunning" Query="not($.='Running') and not($fMSExchangeMailSubmissionNotStarted)" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service state on server {2} is '{1}'. Messages will remain on the user's mailbox server." S0="MSExchangeMailSubmission" P1="$." S2="%varExName%"/>
							</Setting>
							<Setting Key1="StartMode">
								<Rule Name="fMSExchangeMailSubmissionDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service disabled" Text="'{0}' service on server {2} is disabled. It is important for this service to be running for the Mailbox server to submit messages to the Hub Transport servers." S0="MSExchangeMailSubmission" S2="%varExName%"/>
								<Rule Name="fMSExchangeMailSubmissionManual" Query="$.='Manual'" Error="Warning" Sev="2" Title="'{0}' service manual startup" Text="'{0}' service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="MSExchangeMailSubmission" S2="%varExName%"/>
							</Setting>
						</Object>

						<Object Type="Registry" Key1="%varExName%" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\Setup">
							<Setting Key1="Services" Substitution="EXCHBINPATHD" SubstitutionFormat="\\----\\"/>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\MSExchangeADTopologyService.exe'">
								<Setting Key1="LastModified"/>
								<Setting Key1="Version"/>
							</Object>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\store.exe'">
								<Setting Key1="LastModified"/>
								<Setting Key1="Version"/>
							</Object>
							<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\MSExchangeMailSubmission.exe'">
								<Setting Key1="LastModified"/>
								<Setting Key1="Version"/>
							</Object>
						</Object>

						<Object Type="MonadCommand" Name="Server" Key1="test-MapiConnectivity -Server %varExName% -PerConnectionTimeout 120 %varMonadDCParameter%" GroupingClass="True">
							<Rule Name="fTestMapiConnException" Query="../Exception" Error="Error" Sev="1" Title="Error executing 'test-MapiConnectivity'" Text="Error executing 'test-MapiConnectivity -Server {2} -PerConnectionTimeout 120'. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
							<Setting Key1="StorageGroup" Substitution="SG"/>
							<Setting Key1="Database" Substitution="DB"/>
							<Setting Key1="Error" Substitution="ERROR"/>
							<Setting Key1="Result" Substitution="RESULT"/>
							<Setting Key1="Result.Value" Format="Enum">
								<Rule Name="fMapiConnectivityResultUnknown" Query="$.='0'" Error="None" Title="Test-MapiConnectivity unknown for mailbox database '{3}\{4}'" Text="Result of Test-MapiConnectivity for mailbox database {3}\{4} on server {2} was '{6}' with Error='{5}'." S2="%varExName%" S3="%SG%" S4="%DB%" S5="%ERROR%" S6="%RESULT%"/>
								<Rule Name="fMapiConnectivityResultSuccess" Query="$.='1'" Error="None" Title="Test-MapiConnectivity success for mailbox database '{3}\{4}'" Text="Result of Test-MapiConnectivity for mailbox database {3}\{4} on server {2} was '{6}'." S2="%varExName%" S3="%SG%" S4="%DB%" S6="%RESULT%"/>
								<Rule Name="fMapiConnectivityResultFailure" Query="$.='2'" Error="Error" Sev="1" ReportIssue="Issue" Title="Test-MapiConnectivity failure for mailbox database '{3}\{4}'" Text="Result of Test-MapiConnectivity for mailbox database {3}\{4} on server {2} was '{6}' with Error='{5}'." S2="%varExName%" S3="%SG%" S4="%DB%" S5="%ERROR%" S6="%RESULT%"/>
							</Setting>
						</Object>

						<Object Type="Pdh" Name="MailboxRolePerfData" Key1="%varExName%" Key2="5" Key3="6" Level="1" GroupingClass="True">
							<Rule Name="fGeneralErrorAccessPerf" Query="../Exception" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. Error message: {1}." S0="MSExchangeIS Mailbox" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fBDBErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bdb')" Error="Error" Sev="1" Title="Error accessing Mailbox performance counters" Text="Error accessing performance counters on server {2}. This may be due to insufficient permissions. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fContactErrorAccessPerf" Query="contains(../Exception/@Message, '0x800007d0')" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Error accessing performance counters on server {2}. The server may be unavailable, or the remote registry service may not be running on that server. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fNonEngErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bb8') and @S1='1'" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Cannot access performance monitor counters. This tool must run on a U.S. English operating system." S1="%varNonEnglishOS%"/>

							<!-- Check for client and transport submission health -->

							<Setting Key1="MSExchangeIS Mailbox" Key2="Messages Submitted" Key3="_Total">
								<Rule Name="fMailboxSubmissionProgress" Query="not (list-min($.)=list-max($.))"/>
							</Setting>

							<Setting Key1="MSExchangeIS Mailbox" Key2="Messages Submitted/sec" Key3="_Total">
								<Rule Name="iAvgClientSubmissionRate" Query="list-average($.)"/>
							</Setting>

							<Setting Key1="MSExchangeIS Mailbox" Key2="Messages Queued For Submission" Key3="_Total">
								<Rule Name="iAvgMailboxSubmissionQueueSize" Query="list-average($.)" Error="None" Title="Messages Queued For Submission" Text="The average value for the '{0}' counter on server {2} is {9}." P0="localize-path('MSExchangeIS Mailbox\Messages Queued For Submission')" S2="%varExName%" P9="list-average($.)"/>
								<Rule Name="iAvgMailboxSubmissionQueueSizeHigh" Query="list-average($.) &gt; 250" Error="Warning" Sev="1" ReportIssue="Issue" Title="'Messages Queued For Submission' is backing up" Text="The average value for the '{0}' counter on server {2} exceeds {8}. Number of messages in the queue: {9}" P0="localize-path('MSExchangeIS Mailbox\Messages Queued For Submission')" S2="%varExName%" S8="250" P9="list-average($.)"/>
							</Setting>

							<Setting Key1="MSExchangeMailSubmission" Key2="Successful Submissions" Key3="MSExchangeMailSubmission">
								<Rule Name="fTransportSubmissionProgress" Query="not(list-min($.)=list-max($.))"/>
							</Setting>

							<Setting Key1="MSExchangeMailSubmission" Key2="Successful Submissions Per Second" Key3="MSExchangeMailSubmission">
								<Rule Name="iAvgTransportSubmissionRate" Query="list-average($.)"/>
								<Rule Name="fBadPerfmonInstanceMailSubmission" Query="$iAvgTransportSubmissionRate = 'NaN'" Error="Warning" Title="Error gathering performance counter data from '{4}' object" Text="Missing performance data for object '{4}' instance '{5}' on server {2}." S2="%varExName%" P4="../@Key1" P5="../@Key3"/>
								<Rule Name="fMailboxSubmissionQueueSlow" Query="$fTransportSubmissionProgress and not($iAvgTransportSubmissionRate = 'NaN') and ($iAvgClientSubmissionRate &gt; $iAvgTransportSubmissionRate) and ($iAvgMailboxSubmissionQueueSize &gt; 0)" Error="Warning" Sev="1" ReportIssue="Issue" Title="Mailbox Submission Queue Slow" Text="It appears that the rate of client submissions is exceeding the rate of local submissions to transport and 'Messages Queued For Submission' is greater than 0 on server {2}." S2="%varExName%"/>
							</Setting>

							<!-- "MSExchangeMailSubmission\Temporary Submission Failures" indicates that at least one hub transport service paused -->
							<Setting Key1="MSExchangeMailSubmission" Key2="Temporary Submission Failures" Key3="MSExchangeMailSubmission">
								<Rule Name="fTransportTempSubmissionFailures" Query="not (list-min($.)=list-max($.))"/>
							</Setting>

							<!-- "MSExchangeMailSubmission\Failed Submissions" indicates that at least one Hub Transport server role service is unreachable -->
							<Setting Key1="MSExchangeMailSubmission" Key2="Failed Submissions" Key3="MSExchangeMailSubmission">
								<Rule Name="fTransportSubmissionFailures" Query="not (list-min($.)=list-max($.))"/>
							</Setting>

							<!-- "MSExchangeMailSubmission\Hub Servers" is count of local Hub Transport server role computers found in AD by MSExchangeMailSubmission -->
							<Setting Key1="MSExchangeMailSubmission" Key2="Hub Servers" Key3="MSExchangeMailSubmission">
								<Rule Name="iLocalTransportServerCount" Query="list-max($.)"/>
								<Rule Name="fNoLocalTransportFound" Query="$iLocalTransportServerCount=0" Error="Warning" Sev="1" ReportIssue="Issue" Title="No local Hub Transport server role computers detected" Text="It appears that the 'MSExchangeMailSubmission' service on server {2} has not yet discovered any servers with the Hub Transport server role installed in the local Active Directory site with GUID '{3}'. This condition exists after the service is restarted and before a local mailbox submission is processed. This can also indicate that there is a problem with the service successfully completing 'MSExchangeADTopology' discovery." S2="%varExName%" S3="%varSiteGuid%"/>
							</Setting>

							<!-- "MSExchangeMailSubmission\Hub Servers In Retry" is count of local Hub Transport servers that MSExchangeMailSubmission has in Retry state -->
							<Setting Key1="MSExchangeMailSubmission" Key2="Hub Servers In Retry" Key3="MSExchangeMailSubmission">
								<Rule Name="fLocalTransportInRetryFound" Query="list-max($.) &gt; 0" Error="Warning" Sev="1" ReportIssue="Issue" Title="Local Hub Transport server in retry" Text="The '{0}' service on server {2} is unable to submit messages to one or more of the Hub Transport servers in the local Active Directory site with GUID '{3}'. This condition exists when a Hub Transport server is unreachable or has insufficient system resources and has enabled back pressure." S0="MSExchangeMailSubmission" S2="%varExName%" S3="%varSiteGuid%"/>
							</Setting>

							<Rule Name="fMailboxSubmissionQueueStuck" Query="(not($fTransportSubmissionProgress) or $fMSExchangeMailSubmissionNotStarted) and ($iAvgMailboxSubmissionQueueSize &gt; 0)" AlwaysEvaluate="True" Error="Error" Sev="1" ReportIssue="Issue" Title="'{0}' is not making progress" Text="The value for the '{0}' counter on server {2} is greater than zero (average value is {3}) and it appears that '{4}' is failing to submit messages to at least one computer with the Hub Transport server role installed over the last minute." P0="localize-path('MSExchangeIS Mailbox\Messages Queued For Submission')" S2="%varExName%" P3="$iAvgMailboxSubmissionQueueSize" S4="MSExchangeMailSubmission"/>
							<Rule Name="fPotentialTransportSubmissionDegradation" Query="$fTransportSubmissionProgress and not($iAvgTransportSubmissionRate = 'NaN') and ($fTransportSubmissionFailures or $fTransportTempSubmissionFailures)" AlwaysEvaluate="True" Error="Warning" Sev="2" ReportIssue="Issue" Title="Possible local transport submission degradation" Text="It appears that 'MSExchangeMailSubmission' on server {2} is successfully submitting messages to at least one Hub Transport server role computer, but there have been one or more submission failures." S2="%varExName%"/>

						</Object>

						<Object Type="MonadCommand" Name="Identity" Key1="get-ExchangeServer %varMonadDCParameter% | where {$_.IsHubTransportServer -and $_.Site.ObjectGuid -eq '%varSiteGuid%'}" GroupingClass="True">
							<Rule Name="fGetExServerException" Query="../Exception" Error="Error" Sev="1" Title="Error executing 'get-ExchangeServer'" Text="Error executing 'get-ExchangeServer' on server {2}. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
							<Setting Key1="Name">
								<Rule Name="szLocalAdSiteBHServer" Query="$."/>
							</Setting>
							<Setting Key1="AdminDisplayVersion"/>
							<Rule Name="iLocalHubs" Query="count($szLocalAdSiteBHServer)" AlwaysEvaluate="True" Error="None" Title="Found {1} local Hub Transport server role computers" Text="Found {1} computers with the Hub Transport server role installed in the same Active Directory site as server {2} using local Active Directory site GUID '{3}'." P1="count($szLocalAdSiteBHServer)" S2="%varExName%" S3="%varSiteGuid%"/>
							<Rule Name="fNoLocalHubsFound" Query="$iLocalHubs = 0 and not($fGetExServerException)" AlwaysEvaluate="True" Error="Error" Sev="1" ReportIssue="RootCause" Title="No local Hub Transport Server Role computers found" Text="Unable to find any servers with Hub Transport server role installed in same Active Directory site as server {2} using local Active Directory site GUID '{3}'." S2="%varExName%" S3="%varSiteGuid%"/>
							<Rule Name="fPossibleTopoDiscoveryIssue" Query="$fMailboxSubmissionProgress and not($iLocalTransportServerCount = $iLocalHubs) and not($fGetExServerException) and not($fBadPerfmonInstanceMailSubmission)" AlwaysEvaluate="True" Error="Error" Sev="1" ReportIssue="RootCause" Title="'MSExchangeADTopology' discovery issue in '{0}'" Text="'{0}' service on server {2} is not discovering all servers with Hub Transport server role installed in the local Active Directory site with GUID '{3}'. This can be an indication that 'MSExchangeADTopology' discovery is failing to discover these servers due to object validation errors." S0="MSExchangeMailSubmission" S2="%varExName%" S3="%varSiteGuid%"/>
						</Object>

						<Rule Name="szAllLocalBHServers" Query="upper-case(join('', pack($szLocalAdSiteBHServer)))" AlwaysEvaluate="True" Display="HideAll">
							<Variable Name="varAllLocalBHServers" Scope="Children"/>
						</Rule>

						<Rule Name="fMailboxRoleServiceIssue" Query="($fMSExchangeADTopologyNotStarted or $fMSExchangeISNotStarted or $fMSExchangeMailSubmissionNotStarted or $fMSExchangeMailSubmissionNotFound)" Error="Error" ReportIssue="Summary" Sev="1" Title="Mailbox server role service issues found" Text="At least one critical service on server {2} required for message submission is not operating and will result in messages backing up in the outbox folder of each user's mailbox. Please resolve these service issues and check whether messages can flow." S2="%varExName%" AlwaysEvaluate="True"/>

					</Object>
					<!-- End Mailbox server role Health Group-->
				</Object>
				<!-- End 'Server' Group -->

				<Rule Name="szCheckMailboxRoleHealth" Query="'CheckMailboxRoleHealth'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fMailboxRoleServiceIssue or $fNoLocalHubsFound or $fLocalTransportInRetryFound, string(@Title),$szExNoErrorStateText)" Title="A potential Mailbox server role issue was identified" AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No Mailbox server role issues that affect local transport submission were identified"/>
				<Rule Name="szCheckMailboxRoleHealthResult" Query="string(@Title)" Title="Check Mailbox Server Role Health Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>
				<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckMailboxRoleHealthStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				<Rule NextStep="CheckLocalBhHealth" Name="fGotoCheckLocalBhHealth" Query="$iLocalHubs &gt; 0" Priority="2" Text="- Start investigation of Hub Transport server role health" Display="Hide" AlwaysEvaluate="True"/>
			</Object>
		</Object>
	</Object>

	<!-- Check Hub Transport server role for health problems that prevent submission from Mailbox server role -->
	<Object Type="Step" Name="CheckLocalBhHealth" Title="Check Local Active Directory Site Hub Transport Server Role Health" Display="Left">

		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>			
			<Setting Key1="%varExName%" Substitution="varExMBRoleName" Display="Hide"/>
			<Setting Key1="%varAllLocalBHServers%" Substitution="varAllLocalBHServers" Display="Hide"/>

			<Object Type="Progress" Title="Checking Hub Transport Server Role Health" Text="Please wait while the tool checks the health of all Hub Transport server role computers in the same Active Directory site as this Mailbox server role computer. This includes verification that necessary services are in a proper state and performance data collection to determine if submissions to transport are progressing." HelpId="html\c37f4514-a529-4315-bb42-b2438e277d1a.htm">
				<!-- Let's check the health of the services on the Hub Servers in that site -->
				<!-- Begin 'Server' Group -->
				<Object Type="Variable" Name="LocalHubServerList" Key1="Unpack" Key2="%varAllLocalBHServers%" Display="Hide">
					<Setting Key1="__VALUE" Substitution="varExName"/>

					<!-- Begin 'Server' Group -->
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" SecurityContext="EXLOGON" Display="Hide">

						<!-- Begin Hub Transport Server Role Health Group -->
						<Object Type="Group" Name="Hub Transport Server Role Health" Class="Area" GroupingClass="True" Display="Hide">

							<Object Type="Registry" Key1="%varExName%" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\Setup">
								<Setting Key1="Services" Substitution="EXCHBINPATHD" SubstitutionFormat="\\----\\"/>
								<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\MSExchangeTransport.exe'">
									<Setting Key1="LastModified"/>
									<Setting Key1="Version">
										<!--Need to check version and condition fMSExchangeTransportAccountIncorrect on this value-->
										<Rule Name="szFileVersionTransportSvc" Query="$."/>
									</Setting>
								</Object>
								<Object Type="WMI" Key1="%varExName%" Key3="CIM_Datafile" Key4="name = '%EXCHBINPATHD%\\bin\\EdgeTransport.exe'">
									<Setting Key1="LastModified"/>
									<Setting Key1="Version"/>
								</Object>
							</Object>

							<!-- Check whether the MSExchangeTransport service is up and running on each hub server -->
							<Object Type="WMI" Key1="%varExName%" Key3="Win32_Service" Key4="Name='MSExchangeTransport'">
								<Rule Name="fWmiException" Query="../Exception/@Message" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
								<Rule Name="fMSExchangeTransportNotFound" Query="count(../Instance)=0" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not found" Text="'{0}' service on server {2} is not installed but the '{4}' attribute indicates that the Hub Transport server role is installed. This service is required for messages submitted by clients on server {3} to be routed to the target recipient(s)." S0="MSExchangeTransport" S2="%varExName%" S3="%varExMBRoleName%" S4="msExchCurrentServerRoles"/>
								<Setting Key1="Started" Substitution="STARTED">
									<Rule Name="fMSExchangeTransportStarted" Query="$.='True'"/>
									<Rule Name="fMSExchangeTransportNotStarted" Query="$.='False'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service on server {2} is not running. It is important for this service to be running for the Mailbox server role on {3} to submit messages to the Hub Transport server role on this computer." S0="MSExchangeTransport" S2="%varExName%" S3="%varExMBRoleName%"/>
								</Setting>
								<Setting Key1="State">
									<Rule Name="fMSExchangeTransportRunning" Query="$fMSExchangeTransportStarted and $.='Running'" Error="None" Title="'{0}' service started and running" Text="'{0}' service on server {2} is started and running." S0="MSExchangeTransport" S2="%varExName%"/>
									<Rule Name="fMSExchangeTransportNotRunning" Query="not($.='Running' and not($fMSExchangeTransportNotStarted))" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service state on server {2} is '{1}'. It is important for this service to be running for the Mailbox server role on {3} to submit messages to the Hub Transport server role on this computer." S0="MSExchangeTransport" P1="$." S2="%varExName%" S3="%varExMBRoleName%"/>
								</Setting>
								<Setting Key1="StartMode">
									<Rule Name="fMSExchangeTransportDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service is disabled" Text="'{0}' service on server {2} is disabled. It is important for this service to be running for the Mailbox server role on {3} to submit messages to the Hub Transport server role on this computer." S0="MSExchangeTransport" S2="%varExName%" S3="%varExMBRoleName%"/>
									<Rule Name="fMSExchangeTransportSvcManual" Query="$.='Manual'" Error="Warning" Sev="2" Title="'{0}' service manual startup" Text="'{0}' service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="MSExchangeTransport" S2="%varExName%"/>
								</Setting>
								<Setting Key1="StartName">
									<Rule Name="fMSExchangeTransportAccountIncorrect" Query="substring($szFileVersionTransportSvc, 7, 4) &gt; 556 and not($.='NT AUTHORITY\NetworkService')" Error="Error" ReportIssue="RootCause" Title="'{0}' service account has been changed from default setting" Text="'{0}' service account has been changed from default setting of 'NT AUTHORITY\NetworkService' to '{1}'. This can lead to additional problems because of insufficient access to resources that this service requires." S0="MSExchangeTransport" P1="$."/>
								</Setting>

								<!--If MSExchangeTransport service not running, check event log-->
								<Object Type="If" Key1="'%STARTED%' = 'False'">
									<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(48 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>

									<!--Check for 'MSExchange TransportService' event 1000 (logged when transport service attempts to start)-->
									<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchange TransportService' AND EventCode='1000' AND TimeWritten &gt; '%STARTTIME%'" Range="1" Sort="TimeWritten DESC">
										<Rule Name="szTransportSvcStartupEventException" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%varExName%"/>
										<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
										<Setting Key1="Message">
											<Rule Name="szTransportSvcStartupEventMsg" Query="$." Error="None" Title="Hub Transport server attempted to start the '{3}' service" Text="The '{3}' service on Hub Transport server {0} last attempted to start was at {5} and the following event description was logged: {4}" S0="'%varExName%'" S3="MSExchangeTransport" P4="$." S5="%TIMEWRITTEN%"/>
										</Setting>
									</Object>

									<!--Check for significant 'MSExchange TransportService' and 'MSExchangeTransport' error events -->
									<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND EventType='1' AND (SourceName='MSExchange TransportService' OR (SourceName='MSExchangeTransport' AND (EventCode=5022 OR EventCode=5024 OR EventCode=7002 OR EventCode=7003 OR EventCode=9207 OR EventCode=12008 OR EventCode=12009 OR EventCode=14001 OR EventCode=16001 OR EventCode=16023 OR EventCode=17003 OR EventCode=17004 OR EventCode=17005 OR EventCode=17006 OR EventCode=17007 OR EventCode=17011))) AND TimeWritten &gt; '%STARTTIME%'" Range="10" Sort="TimeWritten DESC">
										<Rule Name="szTransportSvcFailureEventException" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%varExName%"/>
										<Rule Name="fTransportSvcFailureEventFound" Query="count(../Instance) &gt; 0" AlwaysEvaluate="True"/>
										<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
										<Setting Key1="EventCode" Substitution="EVENTCODE"/>
										<Setting Key1="Category"/>
										<Setting Key1="CategoryString" Substitution="CATEGORYSTRING"/>
										<Setting Key1="SourceName" Substitution="SOURCENAME"/>
										<Setting Key1="Message">
											<Rule Name="szTransportSvcFailureEventMsg" Query="$." Error="Error" Sev="1" ReportIssue="RootCause" Title="'{3}' service has encountered a '{6}' error" Text="The '{3}' service on Hub Transport server {0} has encountered a '{6}' error ('{3}' Event ID {7}) at {5}. This error may be preventing the service from starting. The following event description was logged: {4}" S0="%varExName%" S2="%SOURCENAME%" S3="MSExchangeTransport" P4="$." S5="%TIMEWRITTEN%" S6="%CATEGORYSTRING%" S7="%EVENTCODE%"/>
										</Setting>
									</Object>
								</Object>							
							</Object>

							<Object Type="Pdh" Name="HubRolePerfData" Key1="%varExName%" Key2="5" Key3="6" Level="1" Async="0">
								<Rule Name="fGeneralErrorAccessPerf" Query="../Exception" Error="Error" Sev="1" Title="Error accessing Hub Transport server role performance counters" Text="Error accessing performance counters on server {2}. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
								<Rule Name="fBDBErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bdb')" Error="Error" Sev="1" Title="Error accessing Hub Transport server role performance counters" Text="Error accessing performance counters on server {2}. This may be due to insufficient permissions. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
								<Rule Name="fContactErrorAccessPerf" Query="contains(../Exception/@Message, '0x800007d0')" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Error accessing performance counters on server {2}. The server may be unavailable, or the remote registry service may not be running on that server. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
								<Rule Name="fNonEngErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bb8') and @S1='1'" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Cannot access performance monitor counters. This tool must run on a U.S. English operating system." S1="%varNonEnglishOS%"/>

								<!--Test for Transport Submission Progress (includes submissions through all paths including MAPI, SMTP, and PICKUP-->
								<Setting Key1="MSExchangeTransport Database" Key2="MailItem new total" Key3="_Total">
									<Rule Name="fTransportDatabaseSubmissionProgress" Query="not (list-min($.)=list-max($.))"/>
									<Rule Name="fTransportDatabaseSubmissionProgressDisplay" Query="not($fTransportDatabaseSubmissionProgress)" Error="None" Title="No submissions to Transport were detected" Text="No submissions to Transport were detected on server {2} during the prior 60 second sample." S2="%varExName%"/>
								</Setting>

								<Setting Key1="MSExchangeTransport Database" Key2="MailItem new/sec" Key3="_Total">
									<Rule Name="iAvgTransportDatabaseSubmissionRate" Query="list-average($.)" Error="None" Title="Transport Database Submission rate" Text="The rate of transport database submissions on server {2} was {1} messages/sec during the prior 60 second sample." P1="list-average($.)" S2="%varExName%"/>
									<Rule Name="fBadPerfmonInstanceTransportDB" Query="$iAvgTransportDatabaseSubmissionRate = 'NaN'" Error="Warning" Title="Error gathering performance counter data for object '{4}'" Text="Missing performance data for object '{4}' instance '{5}' on server {2}." S2="%varExName%" P4="../@Key1" P5="../@Key3"/>
								</Setting>

								<Setting Key1="MSExchange Store Driver" Key2="Outbound: Mapi Events Without Message" Key3="_total">
									<Rule Name="fBadPerfmonInstanceTransportStoreDriver" Query="list-average($.) = 'NaN'" Error="Warning" Title="Error gathering performance counter data for object '{4}'" Text="Missing performance data for object '{4}' instance '{5}' on server {2}." S2="%varExName%" P4="../@Key1" P5="../@Key3"/>
									<Rule Name="fStoreDriverNotificationErrors" Query="not (list-min($.)=list-max($.))" Error="Error" Sev="1" ReportIssue="RootCause" Title="Transport '{1}' is failing local submissions" Text="Transport '{1}' is failing local submissions on server {2}." S1="StoreDriver" S2="%varExName%"/>
								</Setting>

								<Setting Key1="MSExchange Store Driver" Key2="Outbound: Submitted Mail Items" Key3="_total">
									<Rule Name="fBadPerfmonInstanceStoreDriverSubmission" Query="list-average($.) = 'NaN'" Error="Warning" Title="Error gathering performance counter data for object '{4}'" Text="Missing performance data for object '{4}' instance '{5}' on server {2}." S2="%varExName%" P4="../@Key1" P5="../@Key3"/>
									<Rule Name="fStoreDriverSubmissionProgress" Query="not (list-min($.)=list-max($.))"/>
									<Rule Name="fStoreDriverSubmissionProgressDisplay" Query="not($fStoreDriverSubmissionProgress)" Error="None" Title="No submissions to '{1}' were detected" Text="No submissions to '{1}' were detected on server {2} during the prior 60 second sample." S1="StoreDriver" S2="%varExName%"/>
								</Setting>
							</Object>

							<!--Check for backpressure in hub transport service-->
							<Object Type="Protocol" Name="SMTP Command Test" Key1="%varExName%" Key2="TCP" Key3="25" Key4="60000" Timeout="%300">
								<Setting Key1="Connect">
									<Rule Name="fSMTPSocketAliveRemoteServerOkay" Query="not ($.[2]='Respond = Remote socket is not available' or $.[2]='Respond = ')"/>
									<Rule Name="fSMTPSocketAliveRemoteServerError" Query="not ($fSMTPSocketAliveRemoteServerOkay)" Error="Error" Sev="2" ReportIssue="Issue" Title="Mail acceptance failure" Text="Remote server {2} failed the mail acceptance test when trying to open the remote socket: {1}." P1="$.[2]" S2="%varExName%" GUID="a4259991-7fec-4a17-887a-9edc38df6d45"/>
									<Rule Name="fSMTPInsufficientSystemResources" Query="contains($.[2],'452 4.3.1')" Error="Error" Sev="2" ReportIssue="Issue" Title="Server Reports Insufficient System Resources" Text="Server {2} reports insufficient system resources. If the remote server is running Exchange Server 2007, this could be an indication that the transport service on that server has enabled back pressure. {5}" S2="%varExName%" P5="$.[2]"/>
									<Rule Name="szHostReporting452" Query="if($fSMTPInsufficientSystemResources,'%varExName%')" Display="Hide" AlwaysEvaluate="True"/>
								</Setting>
								<Setting Key1="Disconnect"/>
							</Object>

							<Rule Name="fLocalBhServiceHealthIssue" Query="($fSMTPInsufficientSystemResources or $fMSExchangeTransportNotStarted or $fMSExchangeTransportNotRunning or $fMSExchangeTransportDisabled)" AlwaysEvaluate="True" Error="Error" ReportIssue="Summary" Sev="1" Title="'{0}' service issues found" Text="An issue with the '{0}' service on {2} was found. This service is required for local transport submission from the Mailbox server role on {3} and is currently not running or is experiencing backpressure. When this service is not running or is experiencing backpressure, it may result in messages backing up in the outbox folder of each user's mailbox on {3}. Please resolve these service issues and check whether messages can flow." S0="MSExchangeTransport" S2="%varExName%" S3="%varExMBRoleName%"/>
						</Object>
						<!--End Hub Transport server role Health Group-->
					</Object>
					<!--End 'Server' Group-->
					<Rule Name="szAllHostReporting452" Query="join(',', $szHostReporting452)" AlwaysEvaluate="True">
						<Variable Name="varAllHostReporting452" Scope="Children"/>
					</Rule>

				</Object>
				<!-- End 'LocalHubServerList' Variable Object -->

				<Rule Name="szCheckLocalBhHealth" Query="'CheckLocalBhHealth'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fLocalBhServiceHealthIssue ,string(@Title),$szExNoErrorStateText)" Title="One or more potential Hub Transport server role issues were identified" AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No Hub Transport server role issues that affect local transport submission were identified"/>
				<Rule Name="szCheckLocalBhHealthResult" Query="string(@Title)" Title="Check Hub Transport Server Role Health Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>

				<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckLocalBhHealthStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				<Rule NextStep="E12BackPressureCheck" Name="fGotoE12BackPressureCheck" Query="$fSMTPInsufficientSystemResources" Priority="2" Text="- Determine why remote server is reporting insufficient system resources" Display="Hide" AlwaysEvaluate="True"/>

			</Object>
		</Object>
	</Object>

	<!-- Find E12 Edge Subscriptions(s) -->
	<Object Type="Step" Name="FindEdgeSubscriptions" Title="Find Active Directory Edge Subscriptions" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>

			<Object Type="Progress" Title="Finding Active Directory Edge Subscriptions" Text="Please wait while the tool attempts to find all Edge Subscriptions and Accepted Domain information in the Active Directory.">
				<Object Type="MonadCommand" Name="Name" Key1="get-exchangeserver -DomainController %varDCName% | where {$_.IsEdgeServer}" Class="Server" GroupingClass="True">
					<Rule Name="fGetExServerException" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error executing 'get-ExchangeServer'" Text="Error executing 'get-ExchangeServer' with DomainController parameter {3}. Error message: {1}." P1="../Exception/@Message" S3="%varDCName%"/>
					<Rule Name="fEdgeServersNotFound" Query="count(../Instance) = 0" AlwaysEvaluate="True" Error="Warning" Sev="1" ReportIssue="RootCause" Title="No Edge Subscriptions found in Active Directory" Text="Unable to find any Edge Transport server role computer subscriptions in Active Directory. This indicates that no Edge subscriptions have been created and EdgeSync is not being used."/>
					<Setting Key1="Site.Name" Substitution="SITENAME"/>
					<Setting Key1="Site.ObjectGuid" Substitution="SITEGUID" Display="Hide"/>
					<Setting Key1="Name" Substitution="EDGECN">
						<Rule Name="szEdgeServerCn" Query="$."/>
					</Setting>
					<Setting Key1="Fqdn" Substitution="EDGEFQDN">
						<Rule Name="szEdgeServerFqdn" Query="$." Error="None" Title="Edge Subscription for {1} found in Active Directory" Text="Edge Subscription for {1} found in Active Directory site {2}." P1="$." S2="%SITENAME%"/>
					</Setting>
					<Setting Key1="AdminDisplayVersion"/>
					<Setting Key1="WhenCreated"/>
					<Object Type="MonadCommand" Name="Name" Key1="get-exchangeserver -DomainController %varDCName% | where {$_.IsHubTransportServer -and $_.Site.ObjectGuid -eq '%SITEGUID%'}" GroupingClass="True">
						<Rule Name="fGetExServerException2" Query="../Exception" Error="Error" Sev="1" Title="Error executing 'get-ExchangeServer'" Text="Error executing 'get-ExchangeServer'. Error message: {1}." P1="../Exception/@Message"/>
						<Rule Name="iHubServersFound" Query="count(../Instance) &gt; 0" AlwaysEvaluate="True" Error="None" Title="Found {1} Hub Transport server role computers" Text="Found {1} Hub Transport server role computer(s) in same Active Directory Site as Edge subscription for {2}." P1="count(../Instance)" S2="%EDGEFQDN%"/>
						<Rule Name="fHubServersNotFound" Query="count(../Instance)=0" AlwaysEvaluate="True" Error="Error" Sev="1" ReportIssue="RootCause" Title="No Hub Transport server role computers found" Text="Unable to find any servers with Hub Transport server role installed in same Active Directory site as Edge subscription for {2}." S2="%EDGEFQDN%"/>
						<Rule Name="szAllHubInstances" Query="join('', pack($szHubServer))" AlwaysEvaluate="True" Display="HideAll">
							<Variable Name="varEdgeServer[%EDGEFQDN%]" Scope="Children"/>
							<Variable Name="varHubServers[%SITEGUID%]" Scope="Children"/>
						</Rule>
						<Setting Key1="Name">
							<Rule Name="szHubServer" Query="upper-case($.)"/>
						</Setting>
						<Setting Key1="Fqdn"/>
						<Setting Key1="WhenChanged"/>
					</Object>
				</Object>

				<Rule Name="szAllEdgeFqdnInstanceFQDN" Query="join(',',$szEdgeServerFqdn)">
					<Variable Name="varAllRemoteServerFQDN" Scope="Children"/>
				</Rule>

				<Rule Name="fFindEdgeSubscriptionErrors" Query="$fGetExServerException or $fGetExServerException2 or $fHubServersNotFound or $fEdgeServersNotFound" Error="Error" Sev="1" ReportIssue="Summary" Title="Issues Encountered When Retrieving Edge Subscription Information" Text="The tool has encountered one or more errors retrieving Edge subscription information from Active Directory. If the tool was executed on a server with Edge Transport server role installed, please execute the tool on a server that is a member of the forest where the Edge subscription was created." AlwaysEvaluate="True"/>

				<Rule Name="szFindEdgeSubscriptions" Query="'FindEdgeSubscriptions'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fFindEdgeSubscriptionErrors,string(@Title),$szExNoErrorStateText)" Title="One or more errors encountered when finding Edge subscriptions." AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No Active Directory Edge Subscription issues were identified"/>
				<Rule Name="szFindEdgeSubscriptionsResult" Query="string(@Title)" Title="Find Active Directory Edge Subscriptions Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>
				<Rule NextStep="DisplayResultsStep" Name="fDisplayFindEdgeSubscriptionsStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				<Rule NextStep="CheckAdEdgeSyncConfig" Name="fGotoCheckAdEdgeSyncConfig" Query="not($fEdgeServersNotFound) and not($fHubServersNotFound)" Priority="3" Text="- Retrieve EdgeSync Configuration and Accepted Domain information from Active Directory." Display="Hide" AlwaysEvaluate="True"/>
			</Object>
		</Object>
	</Object>

	<Object Type="Step" Name="CheckAdEdgeSyncConfig" Title="Retrieve EdgeSync Configuration from Active Directory" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<!--TODO:Obtain configuration DC from Hub server running EdgeSync to ensure we are checking same replica-->
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>

			<Object Type="Progress" Title="Retrieve EdgeSync Configuration from Active Directory" Text="Please wait while the tool retrieves Accepted Domain configuration and EdgeSync credentials used by each Hub Transport server role computer from Active Directory. These credentials include the name of the account to be used when connecting to an Active Directory Application Mode (ADAM) instance on the Edge Transport server role computer and the encrypted password.">
				<Object Type="Directory" Name="cn" Key1="LDAP://%varDCName%/">
					<Rule Name="szExceptionText" Query="concat(../Exception/@Message,../Instance/Object/Exception/@Message)" AlwaysEvaluate="True"/>
					<Rule Name="fFatalDirectoryError" Query="../Exception/@Message or ../Instance/Object/Exception/@Message" Error="Error" Sev="1" Title="Error accessing Active Directory" Text="Unable to query the directory on server {2}. {1}" P1="$szExceptionText" S2="%varDCName%" AlwaysEvaluate="True"/>

					<Setting Key1="configurationNamingContext" Substitution="CONFIGDN" Display="Hide"/>
					<Setting Key1="currentTime">
						<Rule Name="dCurrentAdDateTime" Query="date-parse(substring($.,1,14), 'yyyyMMddHHmmss')"/>
					</Setting>

					<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%CONFIGDN%">
						<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>

						<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Services,%CONFIGDN%">
							<Rule Name="fDirectoryServicesContainerError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error retrieving '{4}' container from Active Directory" Text="Unable to retrieve '{4}' container from Active Directory on server {2}. {1}" P1="../Exception/@Message" S2="%varDCName%" S4="Services" AlwaysEvaluate="True"/>
							<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>

							<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="cn=Microsoft Exchange,%DN%">
								<Rule Name="fDirectoryExContainerError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error retrieving '{4}' container from ADAM instance" Text="Unable to retrieve '{4}' container from Active Directory on server {2}. {1}" P1="../Exception/@Message" S2="%varDCName%" S4="Microsoft Exchange" AlwaysEvaluate="True"/>
								<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>

								<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%DN%" Key3="objectClass=msExchOrganizationContainer" Key4="OneLevel">
									<Rule Name="fNoExchangeOrgContainer" Query="count(../Instance)=0" Error="Error" Sev="1" Title="Unable to find Exchange Organization within ADAM instance" Text="Unable to find an Exchange Organization in the '{4}' container from Active Directory on server {2}." S2="%varDCName%" S4="Microsoft Exchange" AlwaysEvaluate="True"/>
									<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>

									<!--Retrieve AcceptedDomain Configuration-->
									<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Transport Settings,%DN%">
										<Rule Name="fDirectoryTransportSettingsContainerError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error retrieving '{4}' container information from Active Directory" Text="Unable to retrieve '{4}' container information from Active Directory. {1}" P1="../Exception/@Message" S4="Transport Settings" AlwaysEvaluate="True"/>
										<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>
										<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Accepted Domains,%DN%">
											<Rule Name="fDirectoryAcceptedDomainContainerError" Query="count(../Instance)=0" Error="Error" Sev="1" Title="Error retrieving '{4}' container information from Active Directory" Text="Unable to retrieve '{4}' container information from Active Directory. {1}" P1="../Exception/@Message" S4="Accepted Domains" AlwaysEvaluate="True"/>
											<Setting Key1="distinguishedName" Substitution="DN"/>
											<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%DN%" Key3="(objectClass=msExchAcceptedDomain)" Key4="OneLevel">
												<Rule Name="fNoAcceptedDomainFoundinAD" Query="count(../Instance)=0" Error="Error" ReportIssue="RootCause" Sev="1" Title="No Accepted Domain objects found in Active Directory" Text="No Accepted Domain objects found in Active Directory on server {2}. This may cause issues with the ability for the organization to receive Internet mail." S2="%varDCName%" AlwaysEvaluate="True"/>
												<Setting Key1="cn" Substitution="CN"/>
												<Setting Key1="msExchAcceptedDomainName" Substitution="DOMAINNAME"/>
												<Setting Key1="msExchAcceptedDomainFlags">
													<Rule Name="szAcceptedDomainFlags" Query="$.">
														<Variable Name="varAcceptedDomain[%DOMAINNAME%]" Scope="Children"/>
													</Rule>
													<Rule Name="fAcceptedDomainDefault" Query="bitwise-and($.,4)=4" Error="None" Title="Accepted Domain {1} is '{2}'" Text="Accepted Domain {1} is '{2}'." S1="%DOMAINNAME%" S2="Default"/>
													<Rule Name="fAcceptedDomainAuthoritative" Query="bitwise-and($.,3)=0" Error="None" Title="Accepted Domain {1} is '{2}'" Text="Accepted Domain {1} is '{2}'." S1="%DOMAINNAME%" S2="Authoritative"/>
													<Rule Name="fAcceptedDomainInternalRelay" Query="bitwise-and($.,3)=2" Error="None" Title="Accepted Domain {1} is '{2}'" Text="Accepted Domain {1} is '{2}'." S1="%DOMAINNAME%" S2="InternalRelay"/>
													<Rule Name="fAcceptedDomainExternalRelay" Query="bitwise-and($.,3)=1" Error="None" Title="Accepted Domain {1} is '{2}'" Text="Accepted Domain {1} is '{2}'." S1="%DOMAINNAME%" S2="ExternalRelay"/>
												</Setting>
												<Setting Key1="WhenCreated"/>
												<Setting Key1="WhenChanged"/>
											</Object>
										</Object>
									</Object>

									<!--Retrieve Server Configuration-->
									<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,%DN%">
										<Rule Name="fDirectoryServersContainerError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error retrieving '{4}' container information" Text="Unable to retrieve '{4}' container information from Active Directory on server {2}." S2="%varDCName%" S4="Servers" AlwaysEvaluate="True"/>
										<Setting Key1="distinguishedName" Display="Hide"/>

										<Object Type="Variable" Name="SiteHubServerList" Key1="List" Key2="varHubServers" Display="Hide">
											<Setting Key1="__KEY" Substitution="ADSITEGUID" Display="Hide"/>
											<Setting Key1="__VALUE" Substitution="HUBINSTANCES" Display="Hide"/>

											<!--Retrieve information about Edge Transport server role computer object in Active Directory-->
											<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%DN%" Key3="(&amp;(objectCategory=msExchExchangeServer)((msExchCurrentServerRoles=64)))" Class="Server" GroupingClass="True">
												<Rule Name="fNoSuchEdgeServerFoundinAD" Query="count(../Instance)=0" Error="Error" ReportIssue="RootCause" Sev="1" Title="Error retrieving Edge Transport server role computer information from Active Directory" Text="Error retrieving Edge Transport server role information from Active Directory on server {2}." S2="%varDCName%" AlwaysEvaluate="True"/>
												<Setting Key1="distinguishedName" Substitution="EDGEDN" Display="Hide"/>
												<Setting Key1="CN" Substitution="EDGECN" Display="Hide"/>
												<Setting Key1="WhenCreated" Display="Hide"/>
												<Setting Key1="WhenChanged" Display="Hide"/>
												<Setting Key1="networkAddress" Display="Hide">
													<Rule Name="szAdEdgeFQDN" Query="substring-after($.[contains(.,'ncacn_ip_tcp')],':')" Error="None" Title="Server fully-qualified domain name (FQDN)" Text="The fully-qualified domain name (FQDN) of server {2} is {1}." P1="substring-after($.[contains(.,'ncacn_ip_tcp')],':')" S2="%EDGECN%"/>
												</Setting>
												<Setting Key1="msExchEdgeSyncCredential" Format="Ascii" Display="Hide">
													<Rule Name="szAdEdgeSyncCredentials" Query="pack($.)">
														<Variable Name="varAdEdgeSyncCredentials[%EDGECN%]" Scope="Children"/>
													</Rule>
													<Rule Name="fAdEdgeEdgeSyncCredentialFound" Query="count($.) &gt; 0" Error="None" Title="EdgeSync credential(s) were found in Active Directory for Edge Transport server role computer {2}" Text="{1} EdgeSync credential(s) were found in Active Directory for Edge Transport server role computer {2}." P1="count($.)" S2="%EDGECN%" AlwaysEvaluate="True"/>
												</Setting>
												<Rule Name="fNoAdEdgeEdgeSyncCredentialFound" Query="not($fAdEdgeEdgeSyncCredentialFound)" Error="Error" ReportIssue="RootCause" Sev="1" Title="No EdgeSync credentials found in Active Directory for Edge Transport server role computer {2}" Text="No EdgeSync credentials were found in Active Directory for Edge Transport server role computer {2}. This occurs when the tool is unable to retrieve one or more values for the '{4}' attribute on the server object '{3}' in Active Directory." S2="%EDGECN%" S3="%EDGEDN%" S4="msExchEdgeSyncCredential" AlwaysEvaluate="True"/>
											</Object>

											<!--Retrieve information about each Hub Transport server role computer object in Active Directory-->
											<Object Type="Variable" Name="HubServers" Key1="Unpack" Key2="%HUBINSTANCES%" Display="Hide">
												<Setting Key1="__VALUE" Substitution="varHubName" Display="Hide"/>

												<Object Type="Group" Name="%varHubName%" Class="Server" GroupingClass="True">

													<Object Type="Directory" Key1="LDAP://%varDCName%/" Key2="%DN%" Key3="(&amp;(objectCategory=msExchExchangeServer)((cn=%varHubName%)))">
														<Rule Name="fNoSuchHubServerFoundinAD" Query="count(../Instance)=0" Error="Error" ReportIssue="RootCause" Sev="1" Title="Error retrieving Hub Transport server role information from Edge ADAM instance" Text="Unable to retrieve Hub Transport server role computer {3} from Active Directory Application Mode (ADAM) instance on server {2}." S2="%varDCName%" S3="%varHubName%" AlwaysEvaluate="True"/>
														<Setting Key1="distinguishedName" Substitution="HUBDN" Display="Hide"/>
														<Setting Key1="CN" Substitution="HUBCN" Display="Hide"/>
														<Setting Key1="WhenCreated" Display="Hide"/>
														<Setting Key1="WhenChanged" Display="Hide"/>
														<Setting Key1="networkAddress" Display="Hide">
															<Rule Name="szAdHubFQDN" Query="substring-after($.[contains(.,'ncacn_ip_tcp')],':')" Error="None" Title="Server fully-qualified domain name (FQDN)" Text="The fully-qualified domain name (FQDN) of server {2} is {1}." P1="substring-after($.[contains(.,'ncacn_ip_tcp')],':')" S2="%HUBCN%">
																<Variable Name="varAdFQDN[%HUBCN%]" Scope="Children"/>
															</Rule>
														</Setting>
														<Setting Key1="msExchEdgeSyncCredential" Format="Ascii" Display="Hide">
															<Rule Name="fAdHubEdgeSyncCredentialFound" Query="count($.) &gt; 0" Error="None" Title="EdgeSync credential(s) were found in Active Directory for Hub Transport server role computer {2}" Text="{1} EdgeSync credential(s) were found in Active Directory for Hub Transport server role computer {2}." P1="count($.)" S2="%varHubName%" AlwaysEvaluate="True"/>
														</Setting>
														<Rule Name="fNoAdHubEdgeSyncCredentialFound" Query="not($fAdHubEdgeSyncCredentialFound)" Error="Error" ReportIssue="RootCause" Sev="1" Title="No EdgeSync credentials found in Active Directory for Hub Transport server role computer {2}" Text="No EdgeSync credentials were found in Active Directory for Hub Transport server role computer {2}. This occurs when the EdgeSync service on server {2} fails to update the '{4}' attribute of server object {2} in Active Directory." S2="%varHubName%" S4="msExchEdgeSyncCredential" AlwaysEvaluate="True"/>
													</Object>
												</Object>
												<!--End Hub Server Group-->

											</Object>

										</Object>
									</Object>
								</Object>
							</Object>
						</Object>
					</Object>
				</Object>
				<Rule Name="szCheckAdEdgeSyncConfig" Query="'CheckAdEdgeSyncConfig'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fFatalDirectoryError or $fNoAcceptedDomainFoundinAD or $fNoAdEdgeEdgeSyncCredentialFound or $fNoAdHubEdgeSyncCredentialFound or $fDirectoryAcceptedDomainContainerError,string(@Title),$szExNoErrorStateText)" Title="One or more issues were identified when retrieving EdgeSync and Accepted Domain Configuration from Active Directory" AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No Active Directory EdgeSync Configuration or Accepted Domain issues were identified"/>
				<Rule Name="szCheckAdEdgeSyncConfigResult" Query="string(@Title)" Title="EdgeSync Configuration and Accepted Domain Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>
				<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckAdEdgeSyncConfigStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				<Rule NextStep="CheckEdgeSyncDnsConfig" Name="fGotoCheckEdgeSyncDnsConfig" Query="not($fFatalDirectoryError)" Priority="3" Text="- Verify EdgeSync DNS Configuration" Display="Hide" AlwaysEvaluate="True"/>
				<Rule NextStep="CheckEdgeAdamInstances" Name="fGotoCheckEdgeAdamInstances" Query="not($fFatalDirectoryError)" Priority="4" Text="- Test Connections to Edge Active Directory Application Mode (ADAM) Instances" Display="Hide" AlwaysEvaluate="True"/>
			</Object>
		</Object>
	</Object>

	<Object Type="Step" Name="CheckEdgeSyncDnsConfig" Title="Verify EdgeSync DNS configuration" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Verify EdgeSync DNS configuration" Text="Please wait while the tool verifies the EdgeSync DNS configuration.">
				<Object Type="Variable" Name="HubServerList" Key1="List" Key2="varAdFQDN" Display="Hide">
					<Setting Key1="__KEY" Substitution="SERVERNAME" Display="Hide">
						<Rule Name="szEdgeSyncDnsServerName" Query="$.">
							<Variable Name="varExName" Scope="Children"/>
						</Rule>
					</Setting>
					<Setting Key1="__VALUE" Substitution="SERVERFQDN" Display="Hide">
						<Rule Name="szEdgeSyncDnsServerFQDN" Query="$.">
							<Variable Name="varExFQDN" Scope="Children"/>
						</Rule>
					</Setting>
				</Object>
			</Object>
			<Rule NextStep="CheckDNSAvailability" Name="fGotoCheckDNSAvailability" Query="true()" Priority="2" Text="- Verify DNS Adapter Settings on Hub Transport server role computer(s)" Display="Hide" AlwaysEvaluate="True"/>
			<Rule NextStep="CheckEdgeDNSRecords" Name="fGotoCheckEdgeDNSRecords" Query="true()" Priority="2" Text="- Verify DNS records for Edge Transport server role computer(s) with Edge subscriptions" Display="Hide" AlwaysEvaluate="True"/>

		</Object>
	</Object>

	<Object Type="Step" Name="CheckEdgeDNSRecords" Title="Check DNS Records for 'Edge Transport' Servers" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varAllRemoteServerFQDN%" Substitution="varAllRemoteServerFQDN" Display="Hide"/>
			<Setting Key1="%varAllRemoteServerDomain%" Substitution="varAllRemoteServerDomain" Display="Hide"/>
			<Setting Key1="%varAllDNSAddress%" Substitution="varAllDNSAddress" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking DNS Records" Text="Please wait while the tool checks whether the DNS servers used by server {2} can return valid records for the servers representing Edge subscriptions." S2="%varExName%">
				<Object Type="Group" Name="Edge Server DNS Records" Class="Area" GroupingClass="True" Display="Hide">
					<!-- Let's check whether each DNS contains the records of each destination server -->
					<Object Type="If" Name="DNSAvailableServer" Key1="'%varAllDNSAddress%'!=';'">
						<Object Type="Cache" Name="RemoteServerList" Key1="Add" Key2="RemoteServer" Key3="%varAllRemoteServerFQDN%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
							<Rule Name="fNoEdgeServerFQDN" Query="count(../Instance)=0"/>
							<Setting Key1="EdgeServerFqdn" Substitution="REMOTESRVNAME"/>
							<Object Type="DNS" Name="ServerARecord" Key1="%varAllDNSAddress%" Key2="%REMOTESRVNAME%" Async="100">
								<Setting Key1="A">
									<Rule Name="szEdgeResolvedHost" Query="if (string-length($.[contains(.,'DNS Query Result')]) &gt; 19, substring-after($.[4],'DNS Query Result = '))" AlwaysEvaluate="True"/>
								</Setting>
								<Rule Name="fEdgeNoHostRecords" Query="count ($szEdgeResolvedHost) &lt;1" Error="Error" Sev="2" ReportIssue="RootCause" Title="No 'Host' record(s) found for server {1}" Text="Server {1} has an Edge subscription in Active Directory but no 'Host' records of server {1} can be obtained from the following DNS servers ({2}). This may be causing EdgeSync failures." S1="%REMOTESRVNAME%" S2="%varAllDNSAddress%"/>
								<Rule Name="fEdgeHostRecordsFound" Query="count ($szEdgeResolvedHost) &gt;0" Error="None" Title="'Host' record(s) found for server {1}" Text="DNS servers ({2}) resolved IP address(es) of server {1}: {4}" S1="%REMOTESRVNAME%" S2="%varAllDNSAddress%" P4="join(',', $szEdgeResolvedHost)"/>
							</Object>
						</Object>
					</Object>

					<Rule Name="szCheckEdgeDNSRecords" Query="'CheckEdgeDNSRecords'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fNoEdgeServerFQDN or $fEdgeNoHostRecords, string(@Title), $szExNoErrorStateText)" Title="Potential DNS issues were identified." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No DNS issues were identified."/>
					<Rule Name="szConnectExTestResult" Query="string(@Title)" Title="Edge DNS Records Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>
					<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckEdgeDNSRecordsStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>


	<Object Type="Step" Name="CheckEdgeAdamInstances" Title="Verify Health of Edge Active Directory Application Mode (ADAM) services" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varAllAdEdgeSyncUsers%" Substitution="varAllAdEdgeSyncUsers" Display="Hide"/>

			<Object Type="Progress" Title="Verify Health of Edge Transport Services and Active Directory Application Mode (ADAM)" Text="Please wait while the tool verifies the state of Edge Transport services and tests connections to each Edge Active Directory Application Mode (ADAM) instance that has an associated Edge subscription.">
				<Object Type="Variable" Name="EdgeServerList" Key1="List" Key2="varEdgeServer" Display="Hide">
					<Setting Key1="__KEY" Substitution="EDGEFQDN" Display="Hide"/>
					<Setting Key1="__VALUE" Substitution="HUBINSTANCES" Display="Hide"/>

					<!-- Begin 'Server' Group -->
					<Object Type="Group" Name="%EDGEFQDN%" Class="Server" GroupingClass="True" SecurityContext="EDGELOGON">

						<Object Type="WMI" Key1="%EDGEFQDN%" Key3="Win32_Service" Key4="Name='ADAM_MsExchange'">
							<Rule Name="fAdamSvcWmiException" Query="../Exception/@Message" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%EDGEFQDN%"/>
							<Rule Name="fAdamSvcNotFound" Query="count(../Instance)=0 and count(../Exception)=0" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not found" Text="'{0}' service on server {2} was not found to be installed but the '{4}' attribute on the Exchange Server object in Active Directory indicates that the Edge Transport server role is installed on this server. This service is required for the Edge Transport server role to operate correctly." S0="ADAM_MsExchange" S2="%EDGEFQDN%" S4="msExchCurrentServerRoles"/>
							<Rule Name="fAdamSvcIssuesFound" Query="$fAdamSvcNotFound or $fAdamSvcNotStarted or $fAdamSvcNotRunning" AlwaysEvaluate="True" Error="Error" ReportIssue="Summary" Sev="1" Title="One or more issues were found with the '{0}' service" Text="One or more issues with the '{0}' service on Edge Transport server role computer {2} were found that may prevent successful EdgeSync operation and lead to mailflow issues." S0="ADAM_MsExchange" S2="%EDGEFQDN%"/>
							<Setting Key1="Started">
								<Rule Name="fAdamSvcStarted" Query="$.='True'"/>
								<Rule Name="fAdamSvcNotStarted" Query="$.='False'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service on server {2} is not running. This service must be running for the Edge Transport server role to operate correctly." S0="ADAM_MsExchange" S2="%EDGEFQDN%"/>
							</Setting>
							<Setting Key1="State">
								<Rule Name="fAdamSvcRunning" Query="$fAdamSvcStarted and $.='Running'" Error="None" Title="'{0}' service started and running" Text="'{0}' service on server {2} is started and running." S0="ADAM_MsExchange" S2="%EDGEFQDN%"/>
								<Rule Name="fAdamSvcNotRunning" Query="not($.='Running') and not($fAdamSvcNotStarted)" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service state on server {2} is '{1}'. This service must be running for the Edge Transport server role to operate correctly." S0="ADAM_MsExchange" P1="$." S2="%EDGEFQDN%"/>
							</Setting>
							<Setting Key1="StartMode">
								<Rule Name="fAdamSvcDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service is disabled" Text="'{0}' service on server {2} is disabled. This service must be running for the Edge Transport server role to operate correctly." S0="ADAM_MsExchange" S2="%EDGEFQDN%"/>
								<Rule Name="fAdamSvcSvcManual" Query="$.='Manual'" Error="Warning" Sev="2" Title="'{0}' service manual startup" Text="'{0}' service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="ADAM_MsExchange" S2="%EDGEFQDN%"/>
							</Setting>
							<Setting Key1="StartName">
								<Rule Name="fAdamSvcAccountIncorrect" Query="not($.='NT AUTHORITY\NetworkService')" Error="Error" ReportIssue="RootCause" Title="'{0}' service account has been changed from default setting" Text="'{0}' service account has been changed from default setting of 'NT AUTHORITY\NetworkService' to '{1}'. This can lead to additional problems because of insufficient access to resources that this service requires." S0="ADAM_MsExchange" P1="$."/>
							</Setting>
						</Object>

						<Object Type="WMI" Key1="%EDGEFQDN%" Key3="Win32_Service" Key4="Name='MSExchangeEdgeCredential'">
							<Rule Name="fEdgeCredentialSvcWmiException" Query="../Exception/@Message" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%EDGEFQDN%"/>
							<Rule Name="fEdgeCredentialSvcNotFound" Query="count(../Instance)=0 and count(../Exception)=0" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not found" Text="'{0}' service on server {2} was not found to be installed but the '{4}' attribute on the Exchange server object in Active Directory indicates that the Edge Transport server role is installed on this server. This service is required for the Edge Transport server role to operate correctly." S0="MSExchangeEdgeCredential" S2="%EDGEFQDN%" S4="msExchCurrentServerRoles"/>
							<Rule Name="fEdgeCredentialSvcIssuesFound" Query="$fEdgeCredentialSvcNotFound or $fEdgeCredentialSvcNotStarted or $fEdgeCredentialSvcNotRunning" AlwaysEvaluate="True" Error="Error" ReportIssue="Summary" Sev="1" Title="One or more issues were found with the '{0}' service on the Edge Transport server role computer" Text="One or more issues with the '{0}' service on server {2} were found that may prevent successful EdgeSync operation and lead to mailflow issues." S0="MSExchangeEdgeCredential" S2="%EDGEFQDN%"/>
							<Setting Key1="Started">
								<Rule Name="fEdgeCredentialSvcStarted" Query="$.='True'"/>
								<Rule Name="fEdgeCredentialSvcNotStarted" Query="$.='False'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service on server {2} is not running. This service must be running for the Edge Transport server role to operate correctly." S0="MSExchangeEdgeCredential" S2="%EDGEFQDN%"/>
							</Setting>
							<Setting Key1="State">
								<Rule Name="fEdgeCredentialSvcRunning" Query="$fEdgeCredentialSvcStarted and $.='Running'" Error="None" Title="'{0}' service started and running" Text="'{0}' service on server {2} is started and running." S0="MSExchangeEdgeCredential" S2="%EDGEFQDN%"/>
								<Rule Name="fEdgeCredentialSvcNotRunning" Query="not($.='Running') and not($fEdgeCredentialSvcNotStarted)" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service state on server {2} is '{1}'. This service must be running for the Edge Transport server role to operate correctly." S0="MSExchangeEdgeCredential" P1="$." S2="%EDGEFQDN%"/>
							</Setting>
							<Setting Key1="StartMode">
								<Rule Name="fEdgeCredentialSvcDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service is disabled" Text="'{0}' service on server {2} is disabled. This service must be running for the Edge Transport server role to operate correctly." S0="MSExchangeEdgeCredential" S2="%EDGEFQDN%"/>
								<Rule Name="fEdgeCredentialSvcManual" Query="$.='Manual'" Error="Warning" Sev="2" Title="'{0}' service manual startup" Text="'{0}' service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="MSExchangeEdgeCredential" S2="%EDGEFQDN%"/>
							</Setting>
						</Object>

						<!--Check for custom ADAM port configuration-->
						<Object Type="If" Name="Edge Transport ADAM Port Configuration" Key1="true()">
							<!--Set default port values to use if registry is not available-->
							<Setting Key1="50389" Substitution="ADAMLDAPPORT" Display="Hide"/>
							<Setting Key1="50636" Substitution="ADAMSSLPORT" Display="Hide"/>
							<!--Connect to registry to read ADAM port configuration-->
							<Object Type="Registry" Key1="%EDGEFQDN%" Key3="SOFTWARE\Microsoft\ExchangeServer\v14\EdgeTransportRole\AdamSettings\MsExchange">
								<Rule Name="fFatalEdgeRegistryError" Query="../Exception/@Message" Error="Error" Title="Error accessing registry" Text="An exception occurred while connecting to the registry on server {2}, Exception message: {1}. All validation of the Active Directory Application Mode (ADAM) instance on this server will utilize default port configurations." P1="../Exception/@Message" S2="%EDGEFQDN%"/>
								<Rule Name="szADAMLDAPPORT" Query="if($fFatalEdgeRegistryError,'%ADAMLDAPPORT%',$szAdamCustomLdapPort)" AlwaysEvaluate="True">
									<Variable Name="varADAMLDAPPORT[%EDGEFQDN%]" Scope="Children"/>
								</Rule>
								<Rule Name="szADAMSSLPORT" Query="if($fFatalEdgeRegistryError,'%ADAMSSLPORT%',$szAdamCustomSslPort)" AlwaysEvaluate="True">
									<Variable Name="varADAMSSLPORT[%EDGEFQDN%]" Scope="Children"/>
								</Rule>
								<Setting Key1="LdapPort">
									<Rule Name="szAdamCustomLdapPort" Query="$."/>
									<Rule Name="fAdamCustomLdapPort" Query="not($.='50389')" Error="None" Title="ADAM LDAP Port is not the default value" Text="The Active Directory Application Mode (ADAM) LDAP Port on server {2} is not the default value and is listening on TCP/{1}." P1="$." S2="%EDGEFQDN%"/>
								</Setting>
								<Setting Key1="SslPort">
									<Rule Name="szAdamCustomSslPort" Query="$."/>
									<Rule Name="fAdamCustomSslPort" Query="not($.='50636')" Error="Warning" Sev="1" ReportIssue="Error" Title="ADAM SSL Port has been customized" Text="The Active Directory Application Mode (ADAM) SSL Port on server {2} has been customized and is listening on TCP/{1}. If this Active Directory Application Mode (ADAM) configuration change was made after the Edge Subscription was created, EdgeSync issues will be encountered." P1="$." S2="%EDGEFQDN%"/>
								</Setting>
							</Object>
						</Object>
					</Object>

					<Rule Name="szCheckEdgeAdamInstances" Query="'CheckEdgeAdamInstances'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fAdamSvcWmiException or $fAdamSvcIssuesFound or $fEdgeCredentialSvcWmiException or $fEdgeCredentialSvcIssuesFound or $fFatalEdgeRegistryError,string(@Title),$szExNoErrorStateText)" Title="One or more issues were identified when retrieving EdgeSync and Accepted Domain Configuration from Edge Active Directory Application Mode (ADAM) instances" AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No EdgeSync Configuration or Accepted Domain issues were identified in any of the Active Directory Application Mode (ADAM) instances"/>
					<Rule Name="szCheckEdgeAdamInstancesResult" Query="string(@Title)" Title="Check Edge Active Directory Application Mode (ADAM) Instance Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>
					<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckEdgeAdamInstancesStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>

					<Rule NextStep="CheckEdgeAdamObjects" Name="fGotoCheckEdgeAdamObjects" Query="true()" Priority="2" Text="- Verify existence of critical configuration in Edge Active Directory Application Mode (ADAM) instances" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckEdgeSyncSvcHealth" Name="fGotoCheckEdgeSyncSvcHealth" Query="true()" Priority="3" Text="- Verify health of EdgeSync service on Hub Transport server role computer(s)" Display="Hide" AlwaysEvaluate="True"/>
					<Rule NextStep="CheckEdgeSyncSvcEvents" Name="fGotoCheckEdgeSyncSvcEvents" Query="true()" Priority="4" Text="- Check Hub Transport server role application event log(s)" Display="Hide" AlwaysEvaluate="True"/>

				</Object>
			</Object>
		</Object>
	</Object>

	<Object Type="Step" Name="CheckEdgeAdamObjects" Title="Verify Existence of Critical Configuration in Edge Active Directory Application Mode (ADAM) Instances" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varAllAdEdgeSyncUsers%" Substitution="varAllAdEdgeSyncUsers" Display="Hide"/>

			<Object Type="Progress" Text="Please wait while the tool verifies that EdgeSync has completed synchronization of critical configuration objects to each Edge Active Directory Application Mode (ADAM) instance that has an associated Edge subscription." Title="Verify Critical Configuration in Edge Active Directory Application Mode (ADAM) Instances">
				<Object Type="Variable" Name="EdgeServerList" Key1="List" Key2="varEdgeServer" Display="Hide">
					<Setting Key1="__KEY" Substitution="EDGEFQDN" Display="Hide">
						<Rule Name="szEdgeServerInstance" Query="$."/>
					</Setting>
					<Setting Key1="__VALUE" Substitution="HUBINSTANCES" Display="Hide"/>

					<!-- Begin 'Server' Group -->
					<Object Type="Group" Name="%EDGEFQDN%" Class="Server" GroupingClass="True" SecurityContext="EDGELOGON">

						<Object Type="Variable" Key1="Scalar" Display="Hide">
							<Setting Key1="%varADAMLDAPPORT[%EDGEFQDN%]%" Substitution="ADAMLDAPPORT" Display="Hide"/>
							<Setting Key1="%varADAMSSLPORT[%EDGEFQDN%]%" Substitution="ADAMSSLPORT" Display="Hide"/>

							<Object Type="Port" Name="IsAdamPortAlive" Key1="%EDGEFQDN%">
								<Setting Key1="%ADAMLDAPPORT%" Key3="1">
									<Rule Name="fLDAPPortRemoteServerSuccess" Query="$.[2]='%ADAMLDAPPORT% Available'" Error="None" Title="Port {9} responded" Text="Port {9} successfully responded on server {2}." S2="%EDGEFQDN%" S9="%ADAMLDAPPORT%"/>
									<Rule Name="fLDAPPortRemoteServerError" Query="not($fLDAPPortRemoteServerSuccess)" Error="Error" Sev="1" ReportIssue="Error" Title="Port {9} did not respond" Text="Port {9} did not respond on server {2}. The tool uses this port to retrieve information from the Active Directory Application Mode (ADAM) instance on server {2}. If the tool is unable to connect to this port on server {2}, it will not be able to verify the consistency of the ADAM store on that server. This will occur if a network firewall is blocking communications between the computer where you are running the tool and your Edge Transport server role computer." S2="%EDGEFQDN%" S9="%ADAMLDAPPORT%"/>
								</Setting>
								<Setting Key1="%ADAMSSLPORT%" Key3="2">
									<Rule Name="fLDAPSPortRemoteServerSuccess" Query="$.[2]='%ADAMSSLPORT% Available'" Error="None" Title="Port {9} responded" Text="Port {9} successfully responded on server {2}." S2="%EDGEFQDN%" S9="%ADAMSSLPORT%"/>
									<Rule Name="fLDAPSPortRemoteServerError" Query="not($fLDAPSPortRemoteServerSuccess)" Error="Error" Sev="1" ReportIssue="RootCause" Title="Port {9} did not respond" Text="Port {9} did not respond on server {2}. EdgeSync uses this port to perform synchronization between Active Directory and Active Directory Application Mode (ADAM) on server {2}. This port may not respond if any of the following conditions exists: the server is down, the ADAM service is not running, network connectivity is interrupted or a network firewall is blocking communication with this port." S2="%EDGEFQDN%" S9="%ADAMSSLPORT%"/>
								</Setting>
							</Object>

							<Object Type="Directory" Name="cn" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/">
								<Rule Name="fFatalADAMError" Query="../Exception/@Message and not($fDirectoryConfigurationNCError)" Error="Error" Sev="1" Title="Error accessing ADAM" Text="The tool was unable to create a connection to the Active Directory Application Mode (ADAM) instance on server {2} using the Edge Transport server credentials provided. {1}" P1="../Exception/@Message" S2="%EDGEFQDN%" AlwaysEvaluate="True"/>

								<Setting Key1="configurationNamingContext" Substitution="CONFIGDN" Display="Hide">
									<Rule Name="szAdamConfigurationNC" Query="$." Error="None" Title="ADAM Configuration Naming Context retrieved successfully" Text="The tool was able to retrieve the configuration naming context name of the Active Directory Application Mode (ADAM) instance on server {2} using anonymous access. The value is '{1}'." S1="%CONFIGDN%" S2="%EDGEFQDN%"/>
								</Setting>
								<Setting Key1="currentTime">
									<Rule Name="dCurrentAdamDateTime" Query="date-parse(substring($.,1,14), 'yyyyMMddHHmmss')"/>
								</Setting>

								<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="%CONFIGDN%">
									<Rule Name="fDirectoryConfigurationNCError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error retrieving '{4}' container from ADAM instance" Text="Unable to retrieve '{4}' container from Active Directory Application Mode (ADAM) instance on server {2}. {1}" P1="../Exception/@Message" S2="%EDGEFQDN%" S4="%CONFIGDN%" AlwaysEvaluate="True"/>
									<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>

									<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="cn=Services,%CONFIGDN%">
										<Rule Name="fDirectoryServicesContainerError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error retrieving '{4}' container from ADAM instance" Text="Unable to retrieve '{4}' container from Active Directory Application Mode (ADAM) instance on server {2}. {1}" P1="../Exception/@Message" S2="%EDGEFQDN%" S4="Services" AlwaysEvaluate="True"/>
										<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>

										<!--Unpack varAdEdgeSyncCredentials[%EDGECN%] to validate that ESRA user objects exist (new section) -->
										<Object Type="Variable" Name="AdEdgeCredentials" Key1="List" Key2="varAdEdgeSyncCredentials" Display="Hide">
											<Setting Key1="__KEY" Substitution="SERVERCN" Display="Hide"/>
											<Setting Key1="__VALUE" Substitution="PACKEDXML" Display="Hide"/>
											<Object Type="If" Name="EdgeSync User Credentials" Key1="starts-with(upper-case('%EDGEFQDN%'),concat(upper-case('%SERVERCN%'),'.'))">
												<Object Type="Variable" Name="EdgeSyncCredentialList" Key1="Unpack" Key2="%PACKEDXML%" Display="Hide">
													<Rule Name="iCountEdgeSyncCreds" Query="count(../Instance)"/>
													<Setting Key1="__VALUE" Substitution="CREDXML" Display="Hide"/>
													<Object Type="If" Name="EdgeCredentialProperties" Key1="true()" Display="Hide">
														<Setting Key1="substring-after(substring-before('%CREDXML%','&lt;/EdgeServerFQDN&gt;'),'&lt;EdgeServerFQDN&gt;')" Substitution="CREDFQDN" Display="Hide"/>
														<Setting Key1="substring-after(substring-before('%CREDXML%','&lt;/ESRAUsername&gt;'),'&lt;ESRAUsername&gt;')" Substitution="CREDUSERDN" Display="Hide"/>
														<Setting Key1="substring-after(substring-before('%CREDXML%','&lt;/EffectiveDate&gt;'),'&lt;EffectiveDate&gt;')" Substitution="CREDEFFDATE" Display="Hide"/>
														<Setting Key1="substring-after(substring-before('%CREDXML%','&lt;/Duration&gt;'),'&lt;Duration&gt;')" Substitution="CREDDURATION" Display="Hide"/>
														<Setting Key1="substring-after(substring-before('%CREDXML%','&lt;/IsBootStrapAccount&gt;'),'&lt;IsBootStrapAccount&gt;')" Substitution="CREDISBOOTSTRAP" Display="Hide"/>

														<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="%CREDUSERDN%">
															<Rule Name="fDirectoryServicesEsraUserError" Query="count(../Instance)=0 or ../Exception/@Message" Error="Error" Sev="1" ReportIssue="RootCause" Title="Error retrieving EdgeSync user object from ADAM instance" Text="Unable to retrieve EdgeSync user object '{3}' from Active Directory Application Mode (ADAM) instance on server {2}. {1}" P1="../Exception/@Message" S2="%EDGEFQDN%" S3="%CREDUSERDN%" AlwaysEvaluate="True"/>
															<Setting Key1="cn" Substitution="CREDUSERCN" Display="Hide">
																<Rule Name="szESRAUserCN" Query="$."/>
															</Setting>
															<Setting Key1="memberOf">
																<!--TODO:Need to detect when this attribute has no values, possible solution is to replace setting with Directory object and checking if user DN is member of DL object-->
																<Rule Name="fESRAUserNotMemberOfAdminGroup" Query="not(contains($.,'CN=Administrators,CN=Roles,CN=Configuration'))" Error="Error" Sev="1" ReportIssue="RootCause" Title="EdgeSync user object '{1}' found but is not a member of Administrators group" Text="EdgeSync user object '{1}' exists but is not a member of Administrators group within the Active Directory Application Mode (ADAM) instance on server {2}. This group membership is required in order for EdgeSync to maintain objects in this ADAM instance." S1="%CREDUSERCN%" S2="%EDGEFQDN%"/>
																<Rule Name="fESRAUserObjectNoIssuesFound" Query="not($fESRAUserNotMemberOfAdminGroup)" Error="None" Title="No issues found with EdgeSync user object '{1}'" Text="EdgeSync user object '{1}' was found within the Active Directory Application Mode (ADAM) instance on server {6} with an effective date of '{2}' and duration '{3}' ({5}='{4}'). This user object is also a member of the Administrators group in ADAM." S1="%CREDUSERCN%" S2="%CREDEFFDATE%" S3="%CREDDURATION%" S4="%CREDISBOOTSTRAP%" S5="IsBootStrapAccount" S6="%EDGEFQDN%"/>
															</Setting>
															<Setting Key1="WhenCreated"/>
															<Setting Key1="WhenChanged"/>
														</Object>
													</Object>
													<Rule Name="iCountEsraUsers" Query="count($szESRAUserCN)"/>
													<Rule Name="fESRAUserObjectsNoIssuesFound" Query="count($fESRAUserObjectNoIssuesFound) = $iCountEdgeSyncCreds" Error="None" Title="No issues were found with EdgeSync User objects" Text="There were no issues found with {1} EdgeSync user objects that match EdgeSync credentials found on server object {3} in Active Directory Application Mode (ADAM) on server {2}." P1="count($fESRAUserObjectNoIssuesFound)" S2="%EDGEFQDN%" S3="%SERVERCN%"/>
													<Rule Name="fESRAUserObjectsIssuesFound" Query="not($fESRAUserObjectsNoIssuesFound)" Error="Error" Sev="1" Title="One or more issues found with EdgeSync User objects" Text="There were one or more issues found with EdgeSync User objects associated with EdgeSync credentials found on server object {3} in Active Directory Application Mode (ADAM) instance on server {2}." S2="%EDGEFQDN%" S3="%SERVERCN%"/>
												</Object>
											</Object>
										</Object>
										<!--End Unpack (new section) -->

										<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="cn=Microsoft Exchange,%DN%">
											<Rule Name="fDirectoryExContainerError" Query="../Exception/@Message or ../Instance/Object/Exception/@Message" Error="Error" Sev="1" Title="Error retrieving '{4}' container from ADAM instance" Text="Unable to retrieve '{4}' container from Active Directory Application Mode (ADAM) instance on server {2}. {1}" P1="concat(../Exception/@Message, ../Instance/Object/Exception/@Message)" S2="%EDGEFQDN%" S4="Microsoft Exchange" AlwaysEvaluate="True"/>

											<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>
											<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="%DN%" Key3="objectClass=msExchOrganizationContainer" Key4="OneLevel">
												<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>

												<!--transportserver verification-->
												<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,%DN%">
													<Rule Name="fDirectoryServersContainerError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error retrieving '{4}' container information" Text="Unable to retrieve '{4}' container information from Active Directory Application Mode (ADAM) instance on server {2}. {1}" P1="../Exception/@Message" S2="%EDGEFQDN%" S4="Servers" AlwaysEvaluate="True"/>
													<Setting Key1="distinguishedName" Display="Hide"/>

													<!--Retrieve information about Edge Transport server role computer object-->
													<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="%DN%" Key3="(&amp;(objectCategory=msExchExchangeServer)((msExchCurrentServerRoles=64)))">
														<Rule Name="fNoSuchEdgeServerFound" Query="count(../Instance)=0" Error="Error" ReportIssue="RootCause" Sev="1" Title="Unable to retrieve Edge Transport server role information from Edge ADAM instance" Text="Unable to retrieve Edge Transport server role computer object from Active Directory Application Mode (ADAM) instance on server {2}." S2="%EDGEFQDN%" AlwaysEvaluate="True"/>
														<Setting Key1="distinguishedName" Substitution="EDGEDN" Display="Hide">
															<Rule Name="szAdamEdgeDn" Query="$."/>
														</Setting>
														<Setting Key1="CN" Substitution="EDGECN" Display="Hide">
															<Rule Name="szAdamEdgeCn" Query="$."/>
														</Setting>
														<Setting Key1="WhenCreated"/>
														<Setting Key1="WhenChanged">
															<Rule Name="fEdgeSyncStaleError" Query="get-seconds(date-difference($dCurrentAdamDateTime, date-parse(substring($.,1,19), 'MM/dd/yyyy HH:mm:ss')))&gt; 43200" Error="Error" ReportIssue="Issue" Title="EdgeSync has not completed replication with Edge ADAM instance in last 12 hours" Text="EdgeSync has not completed replication with local Active Directory Application Mode (ADAM) instance on server {2} in last 12 hours. This will result in stale configuration and recipient information, leading to unexpected results. Last successful EdgeSync replication completed at {1} GMT (current time is {3} GMT)" P1="$." S2="%EDGEFQDN%" P3="$dCurrentAdamDateTime"/>
														</Setting>
														<Setting Key1="msExchEdgeSyncLease" Format="Ascii" Display="Hide">
															<!--<Adpath;Expiration;LeaseTokenType>-->
															<!--<Value>CN=<serverCn>,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=<OrgName>,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=<domain>,DC=com;6/14/2006 12:04:31 AM;O</Value>-->
															<Rule Name="szAdamEdgeSyncLeaseServerName" Query="substring-before (substring-after ($.,'CN='),',CN=Servers,')" Error="None" Title="EdgeSync Lease Server Name" Text="Server {1} has an EdgeSync lease for the Active Directory Application Mode (ADAM) instance on server {2}" P1="substring-before (substring-after ($.,'CN='),',CN=Servers,')" S2="%EDGEFQDN%"/>
															<Rule Name="szAdamExchEdgeSyncLeaseExpiration" Query="substring-before (substring-after ($.,';'),';')" Error="None" Title="EdgeSync Lease Expiration" Text="The '{4}' Expiration value is '{1}'" P1="substring-before (substring-after ($.,';'),';')" S4="msExchEdgeSyncLease"/>
														</Setting>
														<Setting Key1="msExchEdgeSyncCredential" Format="Ascii" Display="Hide">
															<!--<Header<LF>EdgeServerFQDN<LF>ESRAUsername<LF>EncryptedESRAPassword<LF>EffectiveDate<LF>Duration<LF>IsBootStrapAccount> -->
															<!--From EdgeSyncSubscriptionConfig.cs-->
															<!--bootstrapDuration=4hrs in ticks-->
															<!--standardDuration=15days in ticks-->
															<!--EffectiveDate is in ticks-->
															<Rule Name="fAdamEdgeEdgeSyncCredentialFound" Query="count($.) &gt; 0" Error="None" Title="EdgeSync credential(s) were found in ADAM for Edge Transport server role computer {2}" Text="{1} EdgeSync credential(s) were found in Active Directory Application Mode (ADAM) for Edge Transport server role computer {2}." P1="count($.)" S2="%EDGECN%" AlwaysEvaluate="True"/>
															<Rule Name="fAdamEdgeSyncCredentialCountMismatch" Query="not (count($.) = $iCountEsraUsers)" Error="Error" ReportIssue="RootCause" Sev="1" Title="EdgeSync user object Count Mismatch" Text="The number of local EdgeSync user objects ({1}) does not match the number of Edge server EdgeSync credentials found in Active Directory Application Mode (ADAM) ({2}). The '{3}' service is responsible for local credential management and may be having problems or the EdgeSync user objects have been modified through some other means." P1="$iCountEsraUsers" P2="count($.)" S3="MSExchangeEdgeCredential"/>
														</Setting>
														<Rule Name="fNoAdamEdgeEdgeSyncCredentialFound" Query="not($fAdamEdgeEdgeSyncCredentialFound)" Error="Error" ReportIssue="RootCause" Sev="1" Title="No EdgeSync credential found in ADAM for Edge Transport server role computer {3}" Text="No EdgeSync credential found in Active Directory Application Mode (ADAM) instance on server {2} for Edge Transport server role computer {3}. This occurs when the tool fails to find the '{4}' attribute on the server object '{3}' in ADAM." S2="%EDGEFQDN%" P3="$szAdamEdgeCn" S4="msExchEdgeSyncCredential" AlwaysEvaluate="True"/>
													</Object>

													<!--Retrieve information about each Hub Transport server role computer object replicated to ADAM by EdgeSync-->
													<Object Type="Variable" Name="EdgeHubServerList" Key1="Unpack" Key2="%HUBINSTANCES%" Display="Hide">
														<Setting Key1="__VALUE" Substitution="varHubName" Display="Hide"/>
														<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="%DN%" Key3="(&amp;(objectCategory=msExchExchangeServer)(cn=%varHubName%))">
															<Rule Name="fNoSuchHubServerFound" Query="count(../Instance)=0" Error="Error" ReportIssue="RootCause" Sev="1" Title="Error retrieving Hub Transport server role information from ADAM instance" Text="Unable to retrieve Hub Transport server role computer {3} from Active Directory Application Mode (ADAM) instance on server {2}." S2="%EDGEFQDN%" S3="%varHubName%" AlwaysEvaluate="True"/>
															<Setting Key1="distinguishedName" Substitution="HUBDN" Display="Hide"/>
															<Setting Key1="CN" Substitution="HUBCN" Display="Hide"/>
															<Setting Key1="WhenCreated"/>
															<Setting Key1="WhenChanged"/>
															<Setting Key1="networkAddress" Display="Hide">
																<Rule Name="szExHubFQDN" Query="substring-after($.[contains(.,'ncacn_ip_tcp')],':')" Error="None" Title="Server fully-qualified domain name (FQDN)" Text="The fully-qualified domain name (FQDN) of server {2} is {1}" P1="substring-after($.[contains(.,'ncacn_ip_tcp')],':')" S2="%varHubName%"/>
															</Setting>
														</Object>
													</Object>
												</Object>
												<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="CN=Transport Settings,%DN%">
													<Rule Name="fDirectoryTransportSettingsContainerError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error retrieving '{4}' container information" Text="Unable to retrieve '{4}' container information from Active Directory Application Mode (ADAM) instance on server {2}." S2="%EDGEFQDN%" S4="Transport Settings" AlwaysEvaluate="True"/>
													<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>
													<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="CN=Accepted Domains,%DN%">
														<Rule Name="fDirectoryAcceptedDomainContainerError" Query="count(../Instance)=0" Error="Error" Sev="1" Title="Error retrieving '{4}' container information" Text="Unable to retrieve '{4}' container information from Active Directory Application Mode (ADAM) instance on server {2}. {1}" P1="../Exception/@Message" S2="%EDGEFQDN%" S4="Accepted Domains" AlwaysEvaluate="True"/>
														<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>

														<!--msExchAcceptedDomain verification-->
														<Object Type="Variable" Name="AcceptedDomainList" Key1="List" Key2="varAcceptedDomain" Display="Hide">
															<Setting Key1="__KEY" Substitution="ADACCEPTEDDOMAIN" Display="Hide">
																<Rule Name="szAdAcceptedDomain" Query="$."/>
															</Setting>
															<Setting Key1="__VALUE" Substitution="ADACCEPTEDDOMAINFLAG" Display="Hide"/>
															<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="%DN%" Key3="&amp;((objectClass=msExchAcceptedDomain)(msExchAcceptedDomainName=%ADACCEPTEDDOMAIN%))" Key4="OneLevel">
																<Rule Name="fNoAcceptedDomainFound" Query="count(../Instance)=0" Error="Error" ReportIssue="Issue" Sev="1" Title="Error retrieving Accepted Domain object for '{1}' from ADAM instance" Text="Unable to retrieve Accepted Domain object for '{1}' from Active Directory Application Mode (ADAM) instance on server {2}. This object was found to exist in Active Directory and has not yet been replicated to this ADAM instance, indicating that there is a synchronization issue between Active Directory and ADAM. This may result in the rejection of mail destined for recipients in domain '{1}'." S1="%ADACCEPTEDDOMAIN%" S2="%EDGEFQDN%" AlwaysEvaluate="True"/>
																<Setting Key1="cn"/>
																<Setting Key1="msExchAcceptedDomainName" Substitution="NAME">
																	<Rule Name="szAcceptedDomainName" Query="$."/>
																</Setting>
																<Setting Key1="msExchAcceptedDomainFlags">
																	<Rule Name="fAcceptedDomainFlagMismatch" Query="not($. = '%ADACCEPTEDDOMAINFLAG%')" Error="Error" Sev="1" ReportIssue="Issue" Title="'{4}' Attribute Value Mismatch for Accepted Domain {0}" Text="The '{4}' attribute value ({1}) for Accepted Domain '{0}' in Active Directory Application Mode (ADAM) instance on server {3} does not match the value in Active Directory ({2}). This may result in mail flow issues." S0="%ADACCEPTEDDOMAIN%" P1="$." S2="%ADACCEPTEDDOMAINFLAG%" S3="%EDGEFQDN%" S4="msExchAcceptedDomainFlags"/>
																</Setting>
																<Setting Key1="WhenCreated"/>
																<Setting Key1="WhenChanged"/>
															</Object>
															<Rule Name="iAcceptedDomainCountAdam" Query="count($szAcceptedDomainName)" AlwaysEvaluate="True"/>
														</Object>
														<Rule Name="fAcceptedDomainCountValid" Query="count($szAdAcceptedDomain) = count($szAcceptedDomainName)" Error="None" Title="All Accepted Domains found in ADAM instance" Text="Found {1} Accepted Domain object(s) in the Active Directory and {2} Accepted Domain object(s) in the Active Directory Application Mode (ADAM) instance on server {3}. This indicates that all Accepted Domain objects have synchronized from Active Directory to ADAM." P1="count($szAdAcceptedDomain)" P2="count($szAcceptedDomainName)" S3="%EDGEFQDN%"/>
														<Rule Name="fAcceptedDomainCountMismatch" Query="not($fAcceptedDomainCountValid)" Error="Error" Sev="1" ReportIssue="Issue" Title="Accepted Domain count mismatch" Text="Found {1} Accepted Domain object(s) in the Active Directory and {2} Accepted Domain object(s) in the Active Directory Application Mode (ADAM) instance on server {3}. This mismatched count of objects indicates that there is a synchronization issue between Active Directory and ADAM. This may result in mail flow issues." P1="count($szAdAcceptedDomain)" P2="count($szAcceptedDomainName)" S3="%EDGEFQDN%"/>
													</Object>
													<!--RecipientValidationEnabled verification-->
													<Object Type="Directory" Key1="LDAP://%EDGEFQDN%:%ADAMLDAPPORT%/" Key2="CN=RecipientFilterConfig,CN=Message Hygiene,%DN%">
														<Rule Name="fDirectoryRecipientFilterConfigError" Query="../Exception/@Message" Error="Error" Sev="1" Title="Error retrieving recipient configuration object information" Text="Unable to retrieve recipient configuration object information from Active Directory Application Mode (ADAM) instance on server {2}. {1}" P1="../Exception/@Message" S2="%EDGEFQDN%" AlwaysEvaluate="True"/>
														<Setting Key1="distinguishedName" Substitution="DN" Display="Hide"/>
														<Setting Key1="msExchAgentsFlags" Display="Hide">
															<Rule Name="szRecipientValidationEnabledServer" Query="if(bitwise-and($.,2048)=2048,upper-case(substring-before('%EDGEFQDN%','.')))" AlwaysEvaluate="True" Error="None" Title="Recipient validation has been enabled" Text="The recipient filtering agent has recipient validation enabled on server {1}" S1="%EDGEFQDN%"/>
														</Setting>
													</Object>
												</Object>
											</Object>
										</Object>
										<Rule Name="fAdamReplIssuesFound" Query="$fEdgeSyncStaleError or $fNoSuchEdgeServerFound or $fNoSuchHubServerFound or $fNoAcceptedDomainFound or $fNoAdamEdgeEdgeSyncCredentialFound or $fAcceptedDomainCountMismatch or $fESRAUserObjectsIssuesFound" AlwaysEvaluate="True" Error="Error" ReportIssue="Summary" Sev="1" Title="EdgeSync replication issues were found with ADAM instance" Text="One or more inconsistencies were found with Active Directory Application Mode (ADAM) instance on server {2}. This is an indication that EdgeSync has not successfully replicated critical configuration information from Active Directory to this ADAM instance." S2="%EDGEFQDN%"/>
										<Rule Name="fNoAdamReplIssuesFound" Query="not($fAdamReplIssuesFound) and not($fAdamValidationFailed)" Error="None" ReportIssue="Issue" Title="No configuration issues were identified in the ADAM instance" Text="No issues were found when validating critical configuration objects in the Active Directory Application Mode (ADAM) instance on server {2}." S2="%EDGEFQDN%"/>
									</Object>
								</Object>
								<Rule Name="fAllAdamConnectionsFailed" Query="$fFatalADAMError and $fLDAPSPortRemoteServerError and $fLDAPPortRemoteServerError" AlwaysEvaluate="True" Error="Error" Sev="1" ReportIssue="Issue" Title="The tool was unable to connect to ADAM" Text="The tool was unable to connect to the Active Directory Application Mode (ADAM) instance on server {2}." S2="%EDGEFQDN%"/>
								<Rule Name="fAdamValidationFailed" Query="($fFatalADAMError or $fDirectoryConfigurationNCError) and $fLDAPSPortRemoteServerSuccess" AlwaysEvaluate="True" Error="Error" Sev="2" ReportIssue="Issue" Title="The tool was able to connect to ADAM but unable to verify replication" Text="The tool was able to connect to Active Directory Application Mode (ADAM) instance on server {2} using LDAP, but was unable to retrieve objects from ADAM. This could be due to an issue with credentials provided in the tool or firewall blocking connectivity to the LDAP port from the server where the tool was run." S2="%EDGEFQDN%"/>
							</Object>
						</Object>
					</Object>
					<!--End EdgeServerList-->
				</Object>

				<Rule Name="iCountRecipientValidationEnabledServers" Query="count($szRecipientValidationEnabledServer)" AlwaysEvaluate="True"/>
				<Rule Name="fCountEdgeCountRecipientValidationMismatch" Query="not(count($szEdgeServerInstance)=$iCountRecipientValidationEnabledServers) and ($iCountRecipientValidationEnabledServers &gt; 0)" Error="Warning" Sev="2" Title="Recipient validation configuration inconsistency found" Text="Recipient validation was enabled on at least one Edge Transport server, but one or more Edge Transport servers do not have recipient validation enabled.  This configuration could lead to inconsistent recipient validation behavior." AlwaysEvaluate="True"/>
				<Rule Name="szAllRecipientValidationEnabledServers" Query="join(',',$szRecipientValidationEnabledServer)" AlwaysEvaluate="True">
					<Variable Name="varAllRecipientValidationEnabledServers" Scope="Global"/>
				</Rule>

				<Rule Name="szCheckEdgeAdamObjects" Query="'CheckEdgeAdamObjects'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fLDAPPortRemoteServerError or $fLDAPSPortRemoteServerError or $fFatalADAMError or $fAdamReplIssuesFound,string(@Title),$szExNoErrorStateText)" Title="One or more issues were identified when retrieving EdgeSync and Accepted Domain Configuration from Edge Active Directory Application Mode (ADAM) instances" AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No EdgeSync Configuration or Accepted Domain issues were identified in any of the Active Directory Application Mode (ADAM) instances"/>
				<Rule Name="szCheckEdgeAdamObjectsResult" Query="string(@Title)" Title="Check Edge Active Directory Application Mode (ADAM) Instance Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>
				<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckEdgeAdamObjectsStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
			</Object>
		</Object>
	</Object>

	<Object Type="Step" Name="CheckEdgeSyncSvcHealth" Title="Verify Health of Hub Transport Server Role EdgeSync Service" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Object Type="Progress" Title="Verify EdgeSync Service Health" Text="Please wait while the tool tests the EdgeSync service on each Hub Transport server role computer.">
				<Object Type="Variable" Name="SiteHubServerList" Key1="List" Key2="varHubServers" Display="Hide">
					<Setting Key1="__KEY" Substitution="ADSITEGUID" Display="Hide"/>
					<Setting Key1="__VALUE" Substitution="HUBINSTANCES" Display="Hide"/>
					<Object Type="Variable" Name="HubServers" Key1="Unpack" Key2="%HUBINSTANCES%" Display="Hide">
						<Setting Key1="__VALUE" Substitution="HUBNAME" Display="Hide"/>
						<!-- Begin 'Server' Group -->
						<Object Type="Group" Name="%HUBNAME%" Class="Server" GroupingClass="True" SecurityContext="EXLOGON">
							<!-- Check whether the EdgeSync service is up and running on each Hub Transport server role computer in same site as Edge server(s) -->
							<Object Type="WMI" Key1="%HUBNAME%" Key3="Win32_Service" Key4="Name='MSExchangeEdgeSync'">
								<Rule Name="fHubWmiServiceException" Query="../Exception/@Message" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%HUBNAME%"/>
								<Rule Name="fEdgeSyncNotFound" Query="count(../Instance)=0 and not($fHubWmiServiceException)" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not found" Text="'{0}' service on server {2} was not found to be installed but the '{4}' attribute on the Exchange server object in Active Directory indicates that the Edge Transport server role is installed on this server. This service is required for the Edge Transport server role to operate correctly." S0="MSExchangeEdgeSync" S2="%HUBNAME%" S4="msExchCurrentServerRoles"/>
								<Setting Key1="Started">
									<Rule Name="fEdgeSyncStarted" Query="$.='True'"/>
									<Rule Name="fEdgeSyncNotStarted" Query="$.='False'" AlwaysEvaluate="True" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service on server {2} is not running. This service must be running for the Edge Transport server role to operate correctly." S0="MSExchangeEdgeSync" S2="%HUBNAME%"/>
								</Setting>
								<Setting Key1="State">
									<Rule Name="fEdgeSyncRunning" Query="$fEdgeSyncStarted and $.='Running'" Error="None" Title="'{0}' service started and running" Text="'{0}' service on server {2} is started and running." S0="MSExchangeEdgeSync" S2="%HUBNAME%"/>
									<Rule Name="fEdgeSyncNotRunning" Query="not($.='Running') and not($fEdgeSyncNotStarted)" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service not running" Text="'{0}' service state on server {2} is '{1}'. This service must be running for the Edge Transport server role to operate correctly." S0="MSExchangeEdgeSync" P1="$." S2="%HUBNAME%"/>
								</Setting>
								<Setting Key1="StartMode">
									<Rule Name="fEdgeSyncDisabled" Query="$.='Disabled'" Error="Error" Sev="1" ReportIssue="RootCause" Title="'{0}' service is disabled" Text="'{0}' service on server {2} is disabled. This service must be running for the Edge Transport server role to operate correctly." S0="MSExchangeEdgeSync" S2="%HUBNAME%"/>
									<Rule Name="fEdgeSyncManual" Query="$.='Manual'" Error="Warning" Sev="2" Title="'{0}' service manual startup" Text="'{0}' service on server {2} is set to be started manually. The service should be set to 'Automatic' because Exchange depends on this service to operate properly." S0="MSExchangeEdgeSync" S2="%HUBNAME%"/>
								</Setting>
							</Object>
						</Object>
					</Object>
				</Object>

				<Rule Name="szCheckEdgeSyncSvcHealth" Query="'CheckEdgeSyncSvcHealth'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fHubWmiServiceException or $fEdgeSyncNotStarted or $fEdgeSyncNotRunning or $fEdgeSyncDisabled or $fEdgeSyncManual,string(@Title),$szExNoErrorStateText)" Title="One or more issues were identified when verifying EdgeSync service health on Hub Transport servers" AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No EdgeSync Service issues were identified on any of the Hub Transport servers"/>
				<Rule Name="szCheckEdgeSyncSvcHealthResult" Query="string(@Title)" Title="Check EdgeSync Service Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>
				<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckEdgeSyncSvcHealthStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>

			</Object>
		</Object>
	</Object>


	<Object Type="Step" Name="CheckEdgeSyncSvcEvents" Title="Check Hub Transport Server Role Application Event Log" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varAllRecipientValidationEnabledServers%" Substitution="varAllRecipientValidationEnabledServers" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Check Hub Transport Server Role Application Event Log" Text="Please wait while the tool retrieves events from the Application Event Log on each Hub Transport server role computer where the EdgeSync service can run.">
				<Object Type="Variable" Name="SiteHubServerList" Key1="List" Key2="varHubServers" Display="Hide">
					<Setting Key1="__KEY" Substitution="ADSITEGUID" Display="Hide"/>
					<Setting Key1="__VALUE" Substitution="HUBINSTANCES" Display="Hide"/>

					<Object Type="Variable" Name="HubServers" Key1="Unpack" Key2="%HUBINSTANCES%" Display="Hide">
						<Setting Key1="__VALUE" Substitution="HUBNAME" Display="Hide"/>

						<!-- Begin 'Server' Group -->
						<Object Type="Group" Name="%HUBNAME%" Class="Server" GroupingClass="True" SecurityContext="EXLOGON">

							<!--Retrieve local system time from remote server and calculate 12 hrs difference-->
							<Object Type="WMI" Name="RetrieveRemoteTime" Key1="%HUBNAME%" Key3="Win32_OperatingSystem" SecurityContext="EXLOGON">
								<Rule Name="fWmiEventLogException" Query="../Exception/@Message" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%HUBNAME%"/>
								<Setting Key1="LocalDateTime" Substitution="WMICURRENTTIME" Format="CIMDateTime"/>
								<Object Type="If" Name="ApplicationEventLog" Key1="true()">
									<Setting Key1="date-add(date-parse(substring('%WMICURRENTTIME%',1,19), 'MM/dd/yyyy HH:mm:ss'),get-timespan(-(900)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>
									<Setting Key1="date-add(date-parse(substring('%WMICURRENTTIME%',1,19), 'MM/dd/yyyy HH:mm:ss'),get-timespan(-(14400)))" Substitution="RECIPIENTSYNCWINDOW" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>

									<!--TODO:Combine these using an OR between EventCodes-->
									<!-- Retrieve SourceName='MSExchange EdgeSync' AND EventCode='1024' since %STARTTIME% from Application Event Log -->
									<Object Type="WMI" Key1="%HUBNAME%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchange EdgeSync' AND EventCode='1024' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1">
										<Rule Name="szEvent1024LogException" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%HUBNAME%"/>
										<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
										<Setting Key1="Message" Format="([\r\n])---- " Substitution="MESSAGE" Display="Hide">
											<Rule Name="szEdgeSyncEvent1024LdapException" Query="$." AlwaysEvaluate="True" Error="Error" ReportIssue="RootCause" Sev="1" Title="MSExchange EdgeSync Event ID 1024 Found" Text="MSExchange EdgeSync Event ID 1024 at {2} was found with description '{1}'." S1="%MESSAGE%" S2="%TIMEWRITTEN%"/>
										</Setting>
										<Setting Key1="InsertionStrings"/>
									</Object>

									<!-- Retrieve SourceName='MSExchange EdgeSync' AND EventCode='1031' since %STARTTIME% from Application Event Log -->
									<Object Type="WMI" Key1="%HUBNAME%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchange EdgeSync' AND EventCode='1031' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1">
										<Rule Name="szEvent1031LogException" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%HUBNAME%"/>
										<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
										<Setting Key1="Message" Format="([\r\n])---- " Substitution="MESSAGE">
											<!--Modify text, ESRA is not responsible for this event since HT role logged the event while Edge role was down (credential did not exist on AD object)-->
											<Rule Name="szEdgeSyncEvent1031CredentialRejected" Query="$." AlwaysEvaluate="True" Error="Error" ReportIssue="RootCause" Sev="1" Title="Found Event Log description with 'EdgeSync Credentials Rejected'" Text="Event description '{1}' was logged at {2}. This may occur if the EdgeSync credential has not yet been synchronized to the Active Directory Application Mode (ADAM) instance on the Edge Transport server role computer or the EdgeSync credentials have expired because EdgeSync has not completed within the credential expiration period. Please remove and recreate the subscription for this Edge Transport server role computer." S1="%MESSAGE%" S2="%TIMEWRITTEN%"/>
										</Setting>
										<Setting Key1="InsertionStrings"/>
									</Object>

									<!-- Retrieve SourceName='MSExchange EdgeSync' AND EventCode='1032' since %STARTTIME% from Application Event Log -->
									<Object Type="WMI" Key1="%HUBNAME%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchange EdgeSync' AND EventCode='1032' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1">
										<Rule Name="szEvent1032LogException" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%HUBNAME%"/>
										<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
										<Setting Key1="Message" Format="([\r\n])---- " Substitution="MESSAGE">
											<Rule Name="szEdgeSyncEvent1032CredentialNotFound" Query="$." AlwaysEvaluate="True" Error="Error" ReportIssue="RootCause" Sev="1" Title="Found Event Log description with 'EdgeSync Credentials Not Found'" Text="Event description '{1}' was logged at {2}. This will occur if the EdgeSync credential has not been created by the '{3}' service after EdgeSync has replicated the Edge Transport server role computer object to the Edge Transport server role computer." S1="%MESSAGE%" S2="%TIMEWRITTEN%" S3="MSExchangeEdgeCredential"/>
										</Setting>
										<Setting Key1="InsertionStrings"/>
									</Object>

									<!-- Retrieve SourceName='MSExchange EdgeSync' AND EventCode='1033' since %STARTTIME% from Application Event Log -->
									<Object Type="WMI" Key1="%HUBNAME%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchange EdgeSync' AND EventCode='1033' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1">
										<Rule Name="szEvent1033LogException" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%HUBNAME%"/>
										<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
										<Setting Key1="InsertionStrings">
											<Rule Name="szInsertionStrings" Query="$."/>
										</Setting>
										<Setting Key1="Message" Format="([\r\n])---- " Substitution="MESSAGE">
											<Rule Name="szEdgeSyncEvent1033CredentialNotFound" Query="$." AlwaysEvaluate="True" Error="Error" ReportIssue="RootCause" Sev="1" Title="MSExchange EdgeSync Event ID 1033 found" Text="Event description '{1}' was logged at {2}. This will occur if the EdgeSync is unable to extract credentials from Active Directory for Edge server {3}." S1="%MESSAGE%" S2="%TIMEWRITTEN%" P3="$szInsertionStrings[1]"/>
										</Setting>
									</Object>

									<!-- Retrieve SourceName='MSExchange EdgeSync' AND EventCode='1000' since %RECIPIENTSYNCWINDOW% from Application Event Log (default schedule is 4 hrs) -->
									<Object Type="WMI" Key1="%HUBNAME%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchange EdgeSync' AND EventCode='1000' AND TimeWritten &gt; '%RECIPIENTSYNCWINDOW%'" Sort="TimeWritten DESC">
										<Rule Name="szEvent1000LogException" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%HUBNAME%"/>
										<Setting Key1="TimeWritten" Display="Hide"/>
										<Setting Key1="InsertionStrings">
											<Rule Name="szEdgeSyncEvent1000ServerName" Query="upper-case(substring-after(substring-before($.[1],',CN=Servers'),'CN='))" AlwaysEvaluate="True"/>
											<Rule Name="fEdgeSyncReportSyncCompleted" Query="$.[3]='Success'" Error="None" Title="EdgeSync completed '{3}' synchronization with server {1}" Text="EdgeSync completed '{3}' synchronization with server {1} at {2} UTC. Result: {4}" P1="$szEdgeSyncEvent1000ServerName" P2="$.[5]" P3="$.[2]" P4="$.[3]" AlwaysEvaluate="True"/>
											<Rule Name="fRecipientValidationWarning" Query="(not(contains('%varAllRecipientValidationEnabledServers%',$szEdgeSyncEvent1000ServerName)) or '%varAllRecipientValidationEnabledServers%'='') and $.[2]='Recipients' and $.[3]='Success'" Error="Warning" Sev="1" ReportIssue="Error" Title="Recipient validation has not been enabled on server {1}" Text="EdgeSync has completed recipient synchronization with server {1} but the recipient filtering agent on that server does not have recipient validation enabled. Recipient validation can be enabled by using the Exchange Management Shell command '{2}'." P1="$szEdgeSyncEvent1000ServerName" S2="Set-RecipientFilterConfig -RecipientValidationEnabled:$TRUE" AlwaysEvaluate="True"/>
										</Setting>
									</Object>
								</Object>
							</Object>
						</Object>
					</Object>
				</Object>

				<Rule Name="szCheckEdgeSyncSvcHealth" Query="'CheckEdgeSyncSvcEvents'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fWmiEventLogException or $szEdgeSyncEvent1024LdapException or $szEdgeSyncEvent1031CredentialRejected or $szEdgeSyncEvent1032CredentialNotFound,string(@Title),$szExNoErrorStateText)" Title="One or more issues were identified when retrieving EdgeSync events from application event log on Hub Transport servers" AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No EdgeSync event log issues were identified on any of the Hub Transport servers"/>
				<Rule Name="szCheckEdgeSyncSvcEventsResult" Query="string(@Title)" Title="Check EdgeSync Application Event Log Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>
				<Rule NextStep="DisplayResultsStep" Name="fDisplayCheckEdgeSyncSvcHealthStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>

			</Object>
		</Object>
	</Object>

	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="E12SubmissionQCheck" Title="Check Submission Queue" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varNonEnglishOS%" Substitution="varNonEnglishOS" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of Submission Queue" Text="Please wait while the tool checks the status of the Submission queue on server {2}. This process may take a minute or so as it attempts to obtain several performance samples over the period." S2="%varExName%">
				<!-- Let's take a look at Submission performance in general-->
				<Object Type="Group" Name="Submission Status" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">
						<Object Type="Pdh" Name="SubmissionBasicData" Key1="%varExName%" Key2="20" Key3="6" Level="1" SecurityContext="EXLOGON">
							<Rule Name="fGeneralErrorAccessPerf" Query="../Exception" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. Error message: {1}." S0="MSExchangeTransport" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fBDBErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bdb')" Error="Error" Sev="1" Title="Error accessing '{0}' performance counters" Text="Error accessing performance counters on server {2}. This may be due to insufficient permissions. Error message: {1}." S0="MSExchangeTransport" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fContactErrorAccessPerf" Query="contains(../Exception/@Message, '0x800007d0')" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Error accessing performance counters on server {2}. The server may be unavailable, or the remote registry service may not be running on that server. Error message: {1}." P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fNonEngErrorAccessPerf" Query="contains(../Exception/@Message, '0xc0000bb8') and @S1='1'" Error="Error" Sev="1" Title="Error accessing performance counters" Text="Cannot access performance monitor counters. This tool must run on a U.S. English operating system." S1="%varNonEnglishOS%"/>

							<Setting Key1="MSExchangeTransport Queues" Key2="Messages Submitted Total" Key3="_Total">
								<Rule Name="fEnterSubmissionProgress" Query="not (list-min($.)=list-max($.))" Error="None" Title="'{1}' queue is making progress" Text="The '{1}' queue is making progress and {2} messages have entered this queue over last {3} seconds." S1="Submission" P2="$iEnterSubmission" S3="60"/>
								<Rule Name="iEnterSubmission" Query="list-max($.)-list-min($.)" AlwaysEvaluate="True"/>
							</Setting>

							<Setting Key1="MSExchangeTransport Queues" Key2="Submission Queue Length" Key3="_Total">
								<Rule Name="iAvgSubmissionQueueLength" Query="list-average($.)" AlwaysEvaluate="True"/>
							</Setting>

							<Setting Key1="MSExchangeTransport Queues" Key2="Items Resubmitted Total" Key3="_Total">
								<Rule Name="fReSubmissionProgress" Query="not (list-min($.)=list-max($.))" Error="None" Title="Messages are being resubmitted to the '{1}' queue" Text="Messages are being resubmitted to the '{1}' queue and {2} messages have resubmitted to this queue over last {3} seconds." S1="Submission" P2="$iReSubmission" S3="60"/>
								<Rule Name="iReSubmission" Query="list-max($.)-list-min($.)" AlwaysEvaluate="True"/>
							</Setting>

							<Setting Key1="MSExchangeTransport Queues" Key2="Items Queued For Delivery Total" Key3="_Total">
								<Rule Name="fItemEnterDeliveryProgress" Query="not (list-min($.)=list-max($.))" Error="None" Title="'{1}' queue is making progress" Text="The '{1}' queue is making progress and {2} items have entered this queue over last {3} seconds." S1="Delivery" P2="$iItemEnterDelivery" S3="60"/>
								<Rule Name="iItemEnterDelivery" Query="list-max($.)-list-min($.)"/>
								<Rule Name="fEnterSubmissionExceedsDeliveryTooHigh" Query="($iEnterSubmission &gt; $iItemEnterDelivery) and $iAvgSubmissionQueueLength &gt; 5000" Error="Warning" Title="'{1}' queue exceeds {8} messages and is growing" Text="The '{1}' queue average length exceeds {8} messages and number of messages entering the '{1}' queue ({2}) is greater than the number of messages entering the '{4}' queue ({5}) over last {3} seconds. This could mean that the Categorizer or an agent is underperforming on this server. If the '{6}' service is paused, new submissions from SMTP and the Mailbox server role will be rejected and will allow for the '{1}' queue to drain. Pausing the '{6}' service until the '{1}' queue is healthy is recommended." S1="Submission" P2="$iEnterSubmission" S3="60" S4="Delivery" P5="$iItemEnterDelivery" S6="MSExchangeTransport" S8="5000"/>
							</Setting>
							<Setting Key1="MSExchangeTransport Queues" Key2="Messages Queued For Delivery Total" Key3="_Total">
								<Rule Name="fMsgEnterDeliveryProgress" Query="not (list-min($.)=list-max($.))" Error="None" Title="'{1}' queue is making progress" Text="The '{1}' queue is making progress and {2} messages have entered this queue over last {3} seconds." S1="Delivery" P2="$iMsgEnterDelivery" S3="60"/>
								<Rule Name="iMsgEnterDelivery" Query="list-max($.)-list-min($.)"/>
							</Setting>

							<Setting Key1="MSExchange Store Driver" Key2="Outbound: Submitted Mail Items" Key3="_total">
								<Rule Name="fBadPerfmonInstanceStoreDriverSubmission" Query="list-average($.) = 'NaN'" Error="Warning" Title="Error gathering performance counter data for object '{4}'" Text="Missing performance data for object '{4}' instance '{5}' on server {2}." S2="%varExName%" P4="../@Key1" P5="../@Key3"/>
								<Rule Name="fStoreDriverEnterSubmissionProgress" Query="not (list-min($.)=list-max($.))" Error="None" Title="'{1}' queue is receiving messages from '{4}'" Text="The '{1}' queue is receiving messages from '{4}' and {2} messages have entered this queue over last {3} seconds." S1="Submission" P2="$iStoreDriverEnterSubmission" S3="60" S4="StoreDriver"/>
								<Rule Name="iStoreDriverEnterSubmission" Query="list-max($.)-list-min($.)"/>
							</Setting>

							<Setting Key1="MSExchangeTransport SmtpReceive" Key2="Messages Received Total" Key3="_Total">
								<Rule Name="fSmtpEnterSubmissionProgress" Query="not (list-min($.)=list-max($.))" Error="None" Title="'{1}' queue is receiving messages from '{4}'" Text="The '{1}' queue is receiving messages from '{4}' and {2} messages have entered this queue over last {3} seconds." S1="Submission" P2="$iSmtpEnterSubmission" S3="60" S4="SMTP"/>
								<Rule Name="iSmtpEnterSubmission" Query="list-max($.)-list-min($.)"/>
							</Setting>

							<Setting Key1="MSExchangeTransport Pickup" Key2="Messages Submitted" Key3="pickup">
								<Rule Name="fPickupEnterSubmissionProgress" Query="not (list-min($.)=list-max($.))" Error="None" Title="'{1}' queue is receiving messages from '{4}'" Text="The '{1}' queue is receiving messages from '{4}' and {2} messages have entered this queue over last {3} seconds." S1="Submission" P2="$iPickupEnterSubmission" S3="60" S4="Pickup"/>
								<Rule Name="iPickupEnterSubmission" Query="list-max($.)-list-min($.)"/>
							</Setting>

							<Setting Key1="MSExchangeTransport Pickup" Key2="Messages Submitted" Key3="replay">
								<Rule Name="fReplayEnterSubmissionProgress" Query="not (list-min($.)=list-max($.))" Error="None" Title="'{1}' queue is receiving messages from '{4}'" Text="The '{1}' queue is receiving messages from '{4}' and {2} messages have entered this queue over last {3} seconds." S1="Submission" P2="$iReplayEnterSubmission" S3="60" S4="Replay"/>
								<Rule Name="iReplayEnterSubmission" Query="list-max($.)-list-min($.)"/>
							</Setting>

							<Setting Key1="MSExchange Extensibility Agents" Key2="Average Agent Processing Time (sec)" Key3="transport rule agent">
								<Rule Name="iAvgTransportRuleProcessingTimeSec" Query="if(f$TransportAgentInvocationProgress,list-average($.))" Error="None" Title="'{1}' average performance" Text="'{1}' average performance is {4} seconds per invocation over the last {3} seconds handling {2} total invocations." S1="transport rule agent" P2="$iTransportAgentInvocation" S3="60" P4="list-average($.)"/>
							</Setting>

							<Setting Key1="MSExchange Extensibility Agents" Key2="Total Agent Invocations" Key3="transport rule agent">
								<Rule Name="fTransportAgentInvocationProgress" Query="not (list-min($.)=list-max($.))" Error="None" Title="'{1}' is processing messages" Text="The '{1}' is processing messages and {2} invocations of this agent have occured over the last {3} seconds." S1="transport rule agent" P2="$iTransportAgentInvocation" S3="60"/>
								<Rule Name="iTransportAgentInvocation" Query="list-max($.)-list-min($.)"/>
							</Setting>

							<Setting Key1="Processor" Key2="% Processor Time" Key3="_Total">
								<Rule Name="fAvgSubmissionCPUHigh" Query="list-average($.) &gt; @S6" Error="Warning" Title="Total process utilization is high" Text="The average '{0}' has exceeded {6}% over the last {3} seconds." P0="localize-path('Processor(_Total)\% Processor Time')" S3="60" S6="80"/>
							</Setting>

							<Setting Key1="PhysicalDisk" Key2="Avg. Disk sec/Transfer" Key3="_Total">
								<Rule Name="fAvgSubmissionDiskLatencyHigh" Query="list-average($.) &gt; @S6" Error="Warning" Title="Total disk latency is high" Text="The average '{0}' has exceeded {6} msec over the last {3} seconds." P0="localize-path('PhysicalDisk(_Total)\Avg. Disk sec/Transfer')" S3="60" S6="40"/>
							</Setting>

						</Object>
					</Object>

					<Rule Name="szE12SubmissionQCheck" Query="'E12SubmissionQCheck'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($fAvgSubmissionCPUHigh or $fAvgSubmissionDiskLatencyHigh,string(@Title),$szExNoErrorStateText)" Title="Potential combination of slow performance and slow progression from submission queue to delivery queue." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No submission queue issues were identified"/>
					<Rule Name="szE12SubmissionQCheckResult" Query="string(@Title)" Title="Submission Queue Analysis Results.">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayE12SubmissionQCheckStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>

	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="E12PoisonQCheck" Title="Check Poison Message Queue" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varNonEnglishOS%" Substitution="varNonEnglishOS" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varPoisonThreshold%" Substitution="varPoisonThreshold" Display="Hide"/>
			<Setting Key1="%varMessageExpirationTimeout%" Substitution="varMessageExpirationTimeout" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of Poison Message Queue" Text="Please wait while the tool checks the status of the Poison Message queue on server {2}. This process may take a minute or so as it attempts to obtain details of the messages in the queue and entries from the event log." S2="%varExName%">
				<!-- Let's take a look at Submission performance in general-->
				<Object Type="Group" Name="Poison Message Detail" Class="Area" GroupingClass="True">
					<Object Type="MonadCommand" Name="Identity" Key1="get-Message -Server '%varExName%' -IncludeRecipientInfo -Filter {Queue -eq &quot;%varExName%\Poison&quot;}">
						<Rule Name="fPoisonMessageFound" Query="count(../Instance) &gt;0"/>
						<Setting Key1="Identity" Substitution="IDENTITY"/>
						<Setting Key1="FromAddress" Substitution="FROMADDRESS"/>
						<Setting Key1="Recipients"/>
						<Setting Key1="Subject"/>
						<Setting Key1="Status"/>
						<Setting Key1="Size"/>
						<Setting Key1="SourceIP" Substitution="SOURCEIP"/>
						<Setting Key1="SCL" Substitution="SCL"/>
						<Setting Key1="DateReceived" Substitution="DATERECEIVED">
							<Rule Name="fPoisonMessageExpired" Query="contains(date-difference(date-add('%DATERECEIVED%', get-timespan(substring-before('%varMessageExpirationTimeout%','.') * 24 * 3600)),'%varCurrentDateTime%'),'-')" Error="Warning" Sev="1" Title="Poison Message ({1}) Has Exceeded The Expiration Timeout" Text="Poison Message ({1}) received at {2} has exceeded the expiration timeout ({9})." S1="%IDENTITY%" S2="%DATERECEIVED%" S9="%varMessageExpirationTimeout%"/>
						</Setting>
						<Setting Key1="MessageSourceName" Substitution="MESSAGESOURCENAME">
							<Rule Name="fPoisonMessageLocal" Query="$.='FromLocal'" Error="Error" Sev="1" ReportIssue="Issue" Title="Poison message ({1}) received from local mailbox source" Text="Poison message ({1}) received at {2} from {3} (source {4}) with SCL={5} has exceeded the poison message count threshold ({7}). This message was submitted from a mailbox server in the local Active Directory site." S1="%IDENTITY%" S2="%DATERECEIVED%" S3="%FROMADDRESS%" S4="%MESSAGESOURCENAME%" S5="%SCL%" S7="%varPoisonThreshold%"/>
							<Rule Name="fPoisonMessageSmtp" Query="contains($.,'SMTP')" Error="Error" Sev="1" ReportIssue="Issue" Title="Poison message ({1}) received from SMTP source" Text="Poison message ({1}) received at {2} from {3} (receive connector '{4}') with SCL={5} has exceeded the poison message count threshold ({7}). This message was submitted from SMTP server with IP address {6}." S1="%IDENTITY%" S2="%DATERECEIVED%" S3="%FROMADDRESS%" S4="%MESSAGESOURCENAME%" S5="%SCL%" S6="%SOURCEIP%" S7="%varPoisonThreshold%"/>
							<Rule Name="fPoisonMessageElse" Query="not($fPoisonMessageLocal or $fPoisonMessageSmtp)" Error="Error" Sev="1" ReportIssue="Issue" Title="Poison message ({1}) received from {4} source" Text="Poison message ({1}) received at {2} from {3} (source '{4}') with SCL={5} has exceeded the poison message count threshold ({7})." S1="%IDENTITY%" S2="%DATERECEIVED%" S3="%FROMADDRESS%" S4="%MESSAGESOURCENAME%" S5="%SCL%" S7="%varPoisonThreshold%"/>
						</Setting>
						<Rule Name="fPoisonMessageExpiredCount" Query="count($fPoisonMessageExpired) &gt; 0" Error="Warning" ReportIssue="Summary" Sev="2" Title="One or more poison messages have expired" Text="A total of {1} messages found in the Poison Message queue has exceeded the expiration timeout ({9})." P1="count($fPoisonMessageExpired)" S9="%varMessageExpirationTimeout%"/>
						<Rule Name="fPoisonMessageLocalCount" Query="count($fPoisonMessageLocal) &gt; 0" Error="Error" ReportIssue="Summary" Sev="2" Title="One or more poison messages submitted from local mailbox" Text="A total of {1} messages found in the Poison Message queue were submitted by mailboxes in the local Active Directory site. These messages are less likely to be malicious and should be resubmitted." P1="count($fPoisonMessageLocal)"/>
						<Rule Name="fPoisonMessageSmtpCount" Query="count($fPoisonMessageSmtp) &gt; 0" Error="Error" ReportIssue="Summary" Sev="2" Title="One or more poison messages submitted from SMTP" Text="A total of {1} messages found in the Poison Message queue were submitted by mailboxes in a remote Active Directory site or foreign SMTP system. These messages are potentially malicious and the SourceIP and SCL should be carefully reviewed before message is resubmitted." P1="count($fPoisonMessageSmtp)"/>
						<Rule Name="fPoisonMessageElseCount" Query="count($fPoisonMessageElse) &gt; 0" Error="Error" ReportIssue="Summary" Sev="2" Title="One or more poison messages submitted from Other" Text="A total of {1} messages found in the Poison Message queue were submitted from a source other than local mailboxes or SMTP. Each message is potentially malicious and should be carefully reviewed before message is resubmitted." P1="count($fPoisonMessageElse)"/>
					</Object>
				</Object>

				<Object Type="Group" Name="Poison Message Events" Class="Area" GroupingClass="True">
					<Object Type="If" Name="%varExName%" Key1="true()">
						<!-- Get the the datetime of now minus MessageExpirationTimeout in the yyyyMMddHHmmss.000000+000 format as this format is faster for a WMI query -->
						<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-((substring-before('%varMessageExpirationTimeout%','.')) * 24 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide">
							<Rule Name="szPoisonMessageEventStartTime" Query="$."/>
						</Setting>

						<!-- Retrieve SourceName='MSExchangeTransport' AND EventCode='10003' from Application Event Log -->
						<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchangeTransport' AND EventCode='10003' AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC">
							<Rule Name="szPoisonMessageEvent10003Exception" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%varExName%"/>
							<Rule Name="fPoisonMessageEvent10003Found" Query="count(../Instance) &gt;0"/>
							<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
							<Setting Key1="InsertionStrings">
								<Rule Name="fPoisonInStage1Agent" Query="contains($.,'Microsoft.Exchange.Transport.Categorizer.MExEvents.RaiseOnSubmittedMessage')" Error="Error" Sev="1" ReportIssue="Issue" Title="Poison message encountered by agent registered for '{3}' event" Text="Agent registered for '{3}' event failed while processing a message at {2} with the following call stack: {1}" P1="$." S2="%TIMEWRITTEN%" S3="OnSubmittedMessage"/>
								<Rule Name="fPoisonInStage5Agent" Query="contains($.,'Microsoft.Exchange.Transport.Categorizer.MExEvents.RaiseOnRoutedMessage')" Error="Error" Sev="1" ReportIssue="Issue" Title="Poison message encountered by agent registered for '{3}' event" Text="Agent registered for '{3}' event failed while processing a message at {2} with the following call stack: {1}" P1="$." S2="%TIMEWRITTEN%" S3="OnRoutedMessage"/>
								<Rule Name="fPoisonInStoreDriver" Query="contains($.,'Microsoft.Exchange.MailboxTransport.StoreDriver')" Error="Error" Sev="1" ReportIssue="Issue" Title="Poison message encountered by '{3}' during local delivery" Text="'{3}' failed during local delivery of a message at {2} with the following call stack: {1}" P1="$." S2="%TIMEWRITTEN%" S3="StoreDriver"/>
								<Rule Name="fPoisonInTransport" Query="not($fPoisonInStage1Agent) and not($fPoisonInStage5Agent) and not($fPoisonInStoreDriver)" Error="Error" Sev="1" ReportIssue="Issue" Title="Poison message encountered by '{3}' service" Text="'{3}' service failed while processing a message at {2} with the following call stack: {1}" P1="$." S2="%TIMEWRITTEN%" S3="MSExchangeTransport"/>
							</Setting>
							<Rule Name="fPoisonInStage1AgentFound" Query="count($fPoisonInStage1Agent) &gt;0" Error="Error" ReportIssue="Summary" Title="One or more poison messages have been encountered by agent registered for '{3}' event" Text="An agent registered for the '{3}' event has failed {1} times due to poison messages since {2}." P1="count($fPoisonInStage1Agent)" P2="$szPoisonMessageEventStartTime" S3="OnSubmittedMessage"/>
							<Rule Name="fPoisonInStage5AgentFound" Query="count($fPoisonInStage5Agent) &gt;0" Error="Error" ReportIssue="Summary" Title="One or more poison messages have been encountered by agent registered for '{3}' event" Text="An agent registered for the '{3}' event has failed {1} times due to poison messages since {2}." P1="count($fPoisonInStage5Agent)" P2="$szPoisonMessageEventStartTime" S3="OnRoutedMessage"/>
							<Rule Name="fPoisonInStoreDriverFound" Query="count($fPoisonInStoreDriver) &gt;0" Error="Error" ReportIssue="Summary" Title="One or more poison messages have been encountered by '{3}' during local delivery" Text="'{3}' has failed {1} times due to poison messages since {2}." P1="count($fPoisonInStoreDriver)" P2="$szPoisonMessageEventStartTime" S3="StoreDriver"/>
							<Rule Name="fPoisonInTransportFound" Query="count($fPoisonInTransport) &gt;0" Error="Error" ReportIssue="Summary" Title="One or more poison messages have been encountered by the '{3}' service" Text="The '{3}' service has failed {1} times due to poison messages since {2}." P1="count($fPoisonInTransport)" P2="$szPoisonMessageEventStartTime" S3="MSExchangeTransport"/>
						</Object>
					</Object>
				</Object>

				<Rule Name="szE12PoisonQCheck" Query="'E12PoisonQCheck'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fPoisonMessageFound or $fPoisonMessageEvent10003Found,string(@Title),$szExNoErrorStateText)" Title="Messages found in poison message queue." AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No Poison Message queue issues were identified."/>
				<Rule Name="szE12PoisonQCheckResult" Query="string(@Title)" Title="Poison Message Queue Analysis Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>

				<Rule NextStep="DisplayResultsStep" Name="fDisplayE12PoisonQCheckStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
			</Object>
		</Object>
	</Object>


	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="E12BackPressureCheck" Title="Check Transport Resource Pressure" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varAllHostReporting452%" Substitution="varAllHostReporting452" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Check Transport Resource Pressure Conditions" Text="Please wait while the tool tries to determine why the transport service is reporting insufficient system resources.">
				<!-- Let's take a look at Submission performance in general-->
				<Object Type="Cache" Name="RemoteServerList" Key1="Add" Key2="RemoteServer" Key3="%varAllHostReporting452%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
					<Setting Key1="RemoteServer" Substitution="REMOTESERVER"/>
					<!--Only perform the following checks for Exchange Server 2007s that are in the local organization-->
					<Object Type="MonadCommand" Name="Identity" Key1="get-ExchangeServer '%REMOTESERVER%' -Status -DomainController %varDCName% | where {$_.AdminDisplayVersion -match &quot;Version 8&quot; -or $_.AdminDisplayVersion -match &quot;Version 14&quot;}">
						<Rule Name="fE12ServerinBackPressureException" Query="../Exception" Error="Error" Sev="1" Title="Error executing '{0}'" Text="Error executing '{0}'. Error message: {1}." S0="get-ExchangeServer '%REMOTESERVER%' -Status -DomainController %varDCName% | where {$_.AdminDisplayVersion -match &quot;Version 8&quot; -or $_.AdminDisplayVersion -match &quot;Version 14&quot;}" P1="../Exception/@Message"/>
						<Rule Name="fE12ServerinBackPressureNotFound" Query="count(../Instance)=0 and not($fE12ServerinBackPressureException)" Error="Error" Sev="1" Title="No further root cause analysis possible on remote server" Text="The remote server {2} failed the SMTP connectivity test but is either not running Exchange Server 2007 or is not in the same Active Directory forest. The tool is unable to perform further root cause analysis on this server." S2="%REMOTESERVER%"/>
						<Setting Key1="IsHubTransportServer"/>
						<Setting Key1="IsClientAccessServer"/>
						<Setting Key1="IsEdgeServer"/>
						<Setting Key1="IsMailboxServer"/>
						<Setting Key1="IsUnifiedMessagingServer"/>
						<Setting Key1="IsMemberOfCluster"/>
						<Setting Key1="AdminDisplayVersion"/>
						<Setting Key1="Site"/>
						<Setting Key1="CurrentConfigDomainController"/>
						<Setting Key1="CurrentDomainControllers"/>
						<Setting Key1="CurrentGlobalCatalogs"/>
						<Setting Key1="StaticDomainControllers"/>
						<Setting Key1="StaticGlobalCatalogs"/>
						<Setting Key1="StaticConfigDomainController"/>
						<Setting Key1="StaticExcludedDomainControllers"/>
						<Setting Key1="WhenChanged"/>
						<Setting Key1="OriginatingServer"/>

						<Object Type="MonadCommand" Name="Name" Key1="get-TransportServer -DomainController %varDCName% -Identity %REMOTESERVER%">
							<Setting Key1="MessageTrackingLogPath" Substitution="MESSAGETRACKINGLOGPATH"/>
							<Setting Key1="RoutingTableLogPath" Substitution="ROUTINGTABLELOGPATH"/>
							<Setting Key1="ConnectivityLogPath" Substitution="CONNECTIVITYLOGPATH"/>
							<Setting Key1="PipelineTracingPath" Substitution="PIPELINETRACINGPATH"/>
							<Setting Key1="ContentConversionTracingEnabled">
								<Rule Name="fRemoteContentConversionTracingEnabled" Query="$.='True'" Error="None" Sev="1" ReportIssue="Recommendation" Title="Transport content conversion tracing enabled" Text="Transport on remote server {2} is experiencing resource pressure and content conversion tracing is enabled. Please disable content conversion tracing and remove files from '{3}'." S2="%REMOTESERVER%" S3="%PIPELINETRACINGPATH%"/>
							</Setting>
							<Setting Key1="PipelineTracingEnabled">
								<Rule Name="fRemotePipelineTracingEnabled" Query="$.='True'" Error="None" Sev="1" ReportIssue="Recommendation" Title="Transport pipeline tracing enabled" Text="Transport on remote server {2} is experiencing resource pressure and pipeline tracing is enabled. Please disable pipeline tracing and remove files from '{3}'." S2="%REMOTESERVER%" S3="%PIPELINETRACINGPATH%"/>
							</Setting>
							<Setting Key1="ReceiveProtocolLogPath" Substitution="RECEIVEPROTOCOLLOGPATH"/>
							<Setting Key1="ReplayDirectoryPath" Substitution="REPLACYDIRECTORYPATH"/>
							<Setting Key1="RootDropDirectoryPath" Substitution="ROOTDROPDIRECTORYPATH"/>
							<Setting Key1="SendProtocolLogPath" Substitution="SENDPROTOCOLLOGPATH"/>
							<Setting Key1="WhenChanged"/>
							<Setting Key1="OriginatingServer"/>

							<Object Type="Group" Name="Transport Resource Pressure" Class="Area" GroupingClass="True">

								<Object Type="If" Name="%REMOTESERVER%" Key1="true()" Display="Hide">
									<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(48 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>

									<!--Check for 'MSExchange TransportService' event 1000 (logged when transport service attempts to start)-->
									<Object Type="WMI" Key1="%REMOTESERVER%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchange TransportService' AND EventCode='1000' AND TimeWritten &gt; '%STARTTIME%'" Range="1" Sort="TimeWritten DESC">
										<Rule Name="szTransportSvcEvent1000Exception" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%REMOTESERVER%"/>
										<Rule Name="fTransportSvcEvent1000Found" Query="count(../Instance) &gt; 0" AlwaysEvaluate="True"/>
										<Setting Key1="TimeWritten" Format="CIMDateTime" Display="Hide">
											<Rule Name="szTransportSvcEvent1000TimeStamp" Query="$."/>
										</Setting>
									</Object>

									<!--Check for resource pressure event 15001 (logged when resource pressure transitions between levels Normal/MediumHigh/High)-->
									<Object Type="WMI" Key1="%REMOTESERVER%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchangeTransport' AND EventCode='15001' AND TimeWritten &gt; '%STARTTIME%'" Range="1" Sort="TimeWritten DESC">
										<Rule Name="szTransportEvent15001Exception" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%REMOTESERVER%"/>
										<Rule Name="fTransportEvent15001Found" Query="count(../Instance) &gt;0" AlwaysEvaluate="True"/>
										<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide">
											<Rule Name="szTransportEvent15001TimeStamp" Query="$."/>
											<!--check to see if last Event 15001 is logged AFTER last transport service restart (or if event not found), else toss-->
											<Rule Name="szTransportEvent15001DurationAfterRestart" Query="date-difference($szTransportEvent15001TimeStamp,if($fTransportSvcEvent1000Found,$szTransportSvcEvent1000TimeStamp,'01/01/2000 00:00:00'))" AlwaysEvaluate="True"/>
										</Setting>
										<Setting Key1="InsertionStrings">
											<Rule Name="fTransportEvent15001Valid" Query="not(contains($szTransportEvent15001DurationAfterRestart,'-'))" Error="Warning" Sev="1" ReportIssue="Issue" Title="The '{4}' service reported resource pressure state transition from '{1}' to '{2}'" Text="The '{4}' service reported resource pressure state transition from '{1}' to '{2}' at {3} and logged the following statistics: {5}" P1="$.[1]" P2="$.[2]" S3="%TIMEWRITTEN%" S4="MSExchangeTransport" P5="$.[3]"/>
										</Setting>
									</Object>

									<!--Check for resource pressure event 15002 (periodic every 15 mins when resource pressure constant)-->
									<Object Type="WMI" Key1="%REMOTESERVER%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchangeTransport' AND EventCode='15002' AND TimeWritten &gt; '%STARTTIME%'" Range="1" Sort="TimeWritten DESC">
										<Rule Name="szTransportEvent15002Exception" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%REMOTESERVER%"/>
										<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide">
											<Rule Name="szTransportEvent15002TimeStamp" Query="$." Display="Hide"/>
											<!--Check to see if last Event 15002 is logged AFTER last transport service restart (or if event not found), else toss-->
											<Rule Name="szTransportEvent15002DurationAfterRestart" Query="date-difference($szTransportEvent15002TimeStamp,if($fTransportSvcEvent1000Found,$szTransportSvcEvent1000TimeStamp,'01/01/2000 00:00:00'))" AlwaysEvaluate="True"/>
											<!--Check to see if last Event 15002 (constant pressure) is logged AFTER last Event 15001 (transition between resource pressure levels), else toss-->
											<Rule Name="szTransportEvent15002DurationAfterEvent15001" Query="date-difference($szTransportEvent15002TimeStamp,if($fTransportEvent15001Found,$szTransportEvent15001TimeStamp,'01/01/2000 00:00:00'))" AlwaysEvaluate="True"/>
										</Setting>
										<Setting Key1="InsertionStrings">
											<Rule Name="szTransportEvent15002ConstantThreshold" Query="$.[1]"/>
											<Rule Name="fTransportEvent15002Valid" Query="not(contains($szTransportEvent15002DurationAfterRestart,'-') or contains($szTransportEvent15002DurationAfterEvent15001,'-'))" Error="Error" Sev="1" ReportIssue="RootCause" Title="The '{0}' service reported constant resource pressure state of '{1}'" Text="The '{0}' service reported constant resource pressure state of '{1}' at {3} and logged the following statistics: {2}" S0="MSExchangeTransport" P1="$.[1]" P2="$.[2]" S3="%TIMEWRITTEN%"/>
											<Rule Name="szTransportDbFilePath" Query="replace($.[2], '^[\s\S]*?&quot;(.*?)&quot;[\s\S]*', '$1')" Error="None" Title="Transport database file location" Text="The transport database file is located at {1}." P1="$szTransportDbFilePath"/>
											<Rule Name="szTransportDbLogPath" Query="replace($.[2], '^[\s\S]*?&quot;(.*?)&quot;[\s\S]*?&quot;(.*?)&quot;[\s\S]*', '$2')" Error="None" Title="Transport database log file directory location" Text="The transport database log file directory is located at {1}." P1="$szTransportDbLogPath"/>
											<Rule Name="fTransportDbSpaceIssue" Query="$fTransportEvent15002Valid and contains($.[1],replace($.[2], '^[\s\S]*?\[(.*?)\][\s\S]*', '$1'))"/>
											<Rule Name="iTransportDbNormalThreshold" Query="replace($.[2], '^[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*', '$1')"/>
											<Rule Name="iTransportDbMediumHighThreshold" Query="replace($.[2], '^[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*', '$2')"/>
											<Rule Name="iTransportDbHighThreshold" Query="replace($.[2], '^[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*', '$3')"/>
											<Rule Name="fTransportDbLogSpaceIssue" Query="$fTransportEvent15002Valid and contains($.[1],replace($.[2], '^[\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*', '$3'))"/>
											<Rule Name="iTransportDbLogNormalThreshold" Query="replace($.[2], '^[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*', '$4')"/>
											<Rule Name="iTransportDbLogMediumHighThreshold" Query="replace($.[2], '^[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*', '$5')"/>
											<Rule Name="iTransportDbLogHighThreshold" Query="replace($.[2], '^[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*?\=([0-9]*?)%[\s\S]*', '$6')"/>
											<Rule Name="fTransportVersionBucketsIssue" Query="$fTransportEvent15002Valid and contains($.[1],replace($.[2], '^[\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*', '$5'))" Error="None" ReportIssue="Recommendation" Title="The '{0}' service reported constant resource pressure state of '{1}' due to internal transport database workload" Text="The '{0}' service reported constant resource pressure state of '{1}' due to increased internal transport database workload. This will cause the '{0}' service to stop all incoming message submissions and outgoing message delivery until the internal database workload decreases, at which point the service will resume normal operation. No administrative action is needed at this time, as back pressure has been enabled to reduce this local resource pressure." S0="MSExchangeTransport" P1="$szTransportEvent15002ConstantThreshold"/>
											<Rule Name="fTransportPrivateBytesIssue" Query="$fTransportEvent15002Valid and contains($.[1],replace($.[2], '^[\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*?\[(.*?)\][\s\S]*', '$7'))" Error="None" ReportIssue="Recommendation" Title="The '{0}' service reported constant resource pressure state of '{1}' due to internal transport memory utilization" Text="The '{0}' service reported constant resource pressure state of '{1}' due to increased internal transport memory utilization. This will cause the '{0}' service to stop all incoming message submissions, outgoing message delivery and loading of messages into submission queue until the internal memory utilization decreases, at which point the service will resume normal operation. No administrative action is needed at this time, as back pressure has been enabled to reduce this local resource pressure." S0="MSExchangeTransport" P1="$szTransportEvent15002ConstantThreshold"/>
										</Setting>
										<Setting Key1="Message" Substitution="MESSAGE" Display="Hide"/>

										<Object Type="WMI" Key1="%REMOTESERVER%" Key3="Win32_LogicalDisk" Key4="FileSystem='NTFS'">
											<Rule Name="szExConnectWMILogicalException" Query="../Exception/@Message"/>
											<Rule Name="fFatalWMILogicalError" Query="../Exception/@Message"/>
											<Setting Key1="Name">
												<Rule Name="szLogicalDisk" Query="$."/>
											</Setting>
											<Setting Key1="DeviceID" Substitution="DEVICEID">
												<Rule Name="fTransportDbDiskDevice" Query="contains($szTransportDbFilePath,'%DEVICEID%')" AlwaysEvaluate="True"/>
												<Rule Name="fTransportLogDiskDevice" Query="contains($szTransportDbLogPath,'%DEVICEID%')" AlwaysEvaluate="True"/>
												<Rule Name="fMsgTrackLogSameAsDbOrLog" Query="contains('%MESSAGETRACKINGLOGPATH%','%DEVICEID%') and ($fTransportDbDiskDevice or $fTransportLogDiskDevice)" Error="None" Title="Message tracking log path" Text="The message tracking log path ('{1}') is located on same drive as transport database or log files." S1="%MESSAGETRACKINGLOGPATH%" AlwaysEvaluate="True"/>
												<Rule Name="fRoutingLogSameAsDbOrLog" Query="contains('%ROUTINGTABLELOGPATH%','%DEVICEID%') and ($fTransportDbDiskDevice or $fTransportLogDiskDevice)" Error="None" Title="Routing table log path" Text="The routing table log path ('{1}') is located on same drive as transport database or log files." S1="%ROUTINGTABLELOGPATH%" AlwaysEvaluate="True"/>
												<Rule Name="fConnectLogSameAsDbOrLog" Query="contains('%CONNECTIVITYLOGPATH%','%DEVICEID%') and ($fTransportDbDiskDevice or $fTransportLogDiskDevice)" Error="None" Title="Connectivity log path" Text="The connectivity log path ('{1}') is located on same drive as transport database or log files." S1="%CONNECTIVITYLOGPATH%" AlwaysEvaluate="True"/>
												<Rule Name="fPipelineTraceLogSameAsDbOrLog" Query="contains('%PIPELINETRACINGPATH%','%DEVICEID%') and ($fTransportDbDiskDevice or $fTransportLogDiskDevice)" Error="None" Title="Pipeline tracing path" Text="The pipeline tracing path ('{1}') is located on same drive as transport database or log files." S1="%PIPELINETRACINGPATH%" AlwaysEvaluate="True"/>
												<Rule Name="fReceiveLogSameAsDbOrLog" Query="contains('%RECEIVEPROTOCOLLOGPATH%','%DEVICEID%') and ($fTransportDbDiskDevice or $fTransportLogDiskDevice)" Error="None" Title="SMTP receive protocol log path" Text="The SMTP receive protocol log path ('{1}') is located on same drive as transport database or log files." S1="%RECEIVEPROTOCOLLOGPATH%" AlwaysEvaluate="True"/>
												<Rule Name="fReplaySameAsDbOrLog" Query="contains('%REPLAYDIRECTORYPATH%','%DEVICEID%') and ($fTransportDbDiskDevice or $fTransportLogDiskDevice)" Error="None" Title="Replay directory path" Text="The replay directory path ('{1}') is located on same drive as transport database or log files." S1="%REPLAYDIRECTORYPATH%" AlwaysEvaluate="True"/>
												<Rule Name="fDropSameAsDbOrLog" Query="contains('%ROOTDROPDIRECTORYPATH%','%DEVICEID%') and ($fTransportDbDiskDevice or $fTransportLogDiskDevice)" Error="None" Title="Drop directory path" Text="The drop directory path ('{1}') is located on same drive as transport database or log files." S1="%ROOTDROPDIRECTORYPATH%" AlwaysEvaluate="True"/>
												<Rule Name="fSendLogSameAsDbOrLog" Query="contains('%SENDPROTOCOLLOGPATH%','%DEVICEID%') and ($fTransportDbDiskDevice or $fTransportLogDiskDevice)" Error="None" Title="SMTP send protocol log path" Text="The SMTP send protocol log path ('{1}') is located on same drive as transport database or log files." S1="%SENDPROTOCOLLOGPATH%" AlwaysEvaluate="True"/>
											</Setting>
											<Setting Key1="FreeSpace">
												<Rule Name="iBackPressureDiskFreeSpace" Query="$."/>
												<Rule Name="iBackPressureDiskFreeSpaceGB" Query="roundto($iBackPressureDiskFreeSpace div (1024*1024*1024),2)" AlwaysEvaluate="True"/>
												<Rule Name="iTransportDbDiskResourcePercentUsed" Query="if($fTransportEvent7007Found,roundto(1- (($iBackPressureDiskFreeSpace + $iTransport7007FreeSpace) div $iBackPressureDiskSize),3)*100,roundto(1- (($iBackPressureDiskFreeSpace) div $iBackPressureDiskSize),3)*100)" AlwaysEvaluate="True"/>
												<Rule Name="iTransportDbDiskResourceNeeded" Query="if($fTransportEvent7007Found,roundto(((($iBackPressureDiskSize*(1-($iTransportDbNormalThreshold div 100)))-($iTransport7007FreeSpace+$iBackPressureDiskFreeSpace)) div (1024*1024)), 0),roundto(((($iBackPressureDiskSize*(1-($iTransportDbNormalThreshold div 100)))-($iBackPressureDiskFreeSpace)) div (1024*1024)), 0))" AlwaysEvaluate="True"/>
												<Rule Name="iTransportDbLogDiskResourcePercentUsed" Query="roundto(1- (($iBackPressureDiskFreeSpace) div $iBackPressureDiskSize),3)*100" AlwaysEvaluate="True"/>
												<Rule Name="iTransportDbLogDiskResourceNeeded" Query="roundto(((($iBackPressureDiskSize*(1-($iTransportDbLogNormalThreshold div 100)))-($iBackPressureDiskFreeSpace)) div (1024*1024)), 0)" AlwaysEvaluate="True"/>
												<Rule Name="fBackPressureNotEnoughDbFreeSpace" Query="$fTransportDbDiskDevice and $fTransportDbSpaceIssue" Error="None" Sev="1" ReportIssue="Recommendation" Title="Drive {1} has insufficient disk space available for the transport database" Text="Drive {1} is used by the '{0}' service (database file) and only has approximately {2} GB available ({3}% of {4} GB used including free space in the transport database which exceeds the '{8}' threshold of {9}%). Please make {5} MB or more additional free space available on this drive, dropping the disk space usage below the 'Normal' threshold of {6}% to resolve resource pressure issues with the '{0}' service." S0="MSExchangeTransport" S1="%DEVICEID%" P2="$iBackPressureDiskFreeSpaceGB" P3="$iTransportDbDiskResourcePercentUsed" P4="$iBackPressureDiskSizeGB" P5="$iTransportDbDiskResourceNeeded" P6="$iTransportDbNormalThreshold" P8="$szTransportEvent15002ConstantThreshold" P9="$iTransportDbHighThreshold" AlwaysEvaluate="True"/>
												<Rule Name="fBackPressureEnoughDbFreeSpace" Query="$fTransportDbDiskDevice and not($fBackPressureNotEnoughDbFreeSpace)" Error="None" Title="Drive {1} has {2} GB disk space available" Text="Drive {1} is used by the '{0}' service (database file location) and has {2} GB available ({3}% of {4} GB used which is below the threshold of {9}%)." S0="MSExchangeTransport" S1="%DEVICEID%" P2="$iBackPressureDiskFreeSpaceGB" P3="$iTransportDbDiskResourcePercentUsed" P4="$iBackPressureDiskSizeGB" P9="$iTransportDbHighThreshold" AlwaysEvaluate="True"/>
												<Rule Name="fBackPressureNotEnoughLogFreeSpace" Query="$fTransportLogDiskDevice and $fTransportDbLogSpaceIssue" Error="None" Sev="1" ReportIssue="Recommendation" Title="Drive {1} has insufficient disk space available for the transport database log files" Text="Drive {1} is used by the '{0}' service (database log directory) and only has {2} GB available ({3}% of {4} GB used which exceeds the '{8}' threshold of {9}%). Please make {5} MB or more additional free space available on this drive, dropping the disk space usage below the 'Normal' threshold of {6}% to resolve resource pressure issues with the '{0}' service." S0="MSExchangeTransport" S1="%DEVICEID%" P2="$iBackPressureDiskFreeSpaceGB" P3="$iTransportDbLogDiskResourcePercentUsed" P4="$iBackPressureDiskSizeGB" P5="$iTransportDbLogDiskResourceNeeded" P6="$iTransportDbLogNormalThreshold" P7="$szTransport7007EventDbName" P8="$szTransportEvent15002ConstantThreshold" P9="$iTransportDbLogHighThreshold" AlwaysEvaluate="True"/>
												<Rule Name="fBackPressureEnoughLogFreeSpace" Query="$fTransportLogDiskDevice and not($fBackPressureNotEnoughLogFreeSpace)" Error="None" Title="Drive {1} has {2} GB disk space available for the transport database log files" Text="Drive {1} is used by the '{0}' service (database log directory location) and has {2} GB available ({3}% of {4} GB used which is below the threshold of {9}%)." S0="MSExchangeTransport" S1="%DEVICEID%" P2="$iBackPressureDiskFreeSpaceGB" P3="$iTransportDbLogDiskResourcePercentUsed" P4="$iBackPressureDiskSizeGB" P9="$iTransportDbLogHighThreshold" AlwaysEvaluate="True"/>
											</Setting>
											<Setting Key1="Size">
												<Rule Name="iBackPressureDiskSize" Query="$."/>
												<Rule Name="iBackPressureDiskSizeGB" Query="roundto($. div (1024*1024*1024),2)"/>
											</Setting>

											<!--Only Check for defrag events if drive matches database log directory location included in event 15002 message-->
											<Object Type="If" Key1="contains('%MESSAGE%','%DEVICEID%')">
												<!--Check for MSExchangeTransport 7007 defrag information-->
												<Object Type="WMI" Key1="%REMOTESERVER%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchangeTransport' AND EventCode='7007' AND TimeWritten &gt; '%STARTTIME%'" Range="1" Sort="TimeWritten DESC">
													<Rule Name="szTransportEvent7007Exception" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%REMOTESERVER%"/>
													<Rule Name="fTransportEvent7007Found" Query="count(../Instance) &gt;0"/>
													<Setting Key1="TimeWritten" Substitution="TIMEWRITTEN" SubstitutionFormat="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Display="Hide"/>
													<Setting Key1="InsertionStrings">
														<Rule Name="szTransport7007EventDbName" Query="$.[1]"/>
														<Rule Name="iTransport7007FreeSpace" Query="$.[2]"/>
														<Rule Name="szTransport7007EventRecommend" Query="(($.[2] div (1024*1024)) &gt; $iTransportDbLogDiskResourceNeeded) and $fTransportDbLogSpaceIssue and $fTransportDbDiskDevice and $fTransportLogDiskDevice" Error="None" Sev="1" ReportIssue="Recommendation" Title="Free space available in '{4}' service '{5}' database should be reclaimed" Text="The '{4}' service reports {1} MB free space in the transport database file '{5}' at {2}. This free space can be reclaimed by performing defragmentation of this database using the ESEUTIL command-line utility with the '{4}' service offline. This will provide additional free disk space required by the database log directory, since the database file and database log directory are both located on the same drive." P1="roundto($.[2] div (1024*1024),2)" S2="%TIMEWRITTEN%" S4="MSExchangeTransport" P5="$.[1]" AlwaysEvaluate="True"/>
														<Rule Name="szTransport7007EventInfo" Query="not($szTransport7007EventRecommend) and $fTransportDbDiskDevice" Error="None" Title="Free space available in '{4}' service '{5}' database " Text="The '{4}' service reports {1} MB free space in the transport database file '{5}' at {2}. There is no reason to reclaim this free space using offline defragmentation at this time." P1="roundto($.[2] div (1024*1024),2)" S2="%TIMEWRITTEN%" S4="MSExchangeTransport" P5="$.[1]" AlwaysEvaluate="True"/>
													</Setting>
												</Object>
											</Object>

											<!--End Win32_LogicalDisk-->
										</Object>
									</Object>
								</Object>
							</Object>
						</Object>
					</Object>
				</Object>

				<Rule Name="szE12BackPressureCheck" Query="'E12BackPressureCheck'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fTransportEvent15002Valid or $fTransportEvent15001Valid,string(@Title),$szExNoErrorStateText)" Title="Transport resource pressure issues found." AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="Transport resource pressure issues were not identified."/>
				<Rule Name="szE12BackPressureCheckResult" Query="string(@Title)" Title="Transport Resource Pressure Analysis Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>

				<Rule NextStep="DisplayResultsStep" Name="fDisplayE12BackPressureCheckStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
			</Object>
		</Object>
	</Object>

	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="RDE12ReceiveCheck" Title="Check Remote Exchange Server 2007 Connector Configuration" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varDCName%" Substitution="varDCName" Display="Hide"/>
			<Setting Key1="%varCurrentDateTime%" Substitution="varCurrentDateTime" Display="Hide"/>
			<Setting Key1="%varAllE12NotAdvertisingXAnonTLS%" Substitution="varAllE12NotAdvertisingXAnonTLS" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>

			<Object Type="Progress" Title="Check Remote Server Receive Connector" Text="Please wait while the tool tries to verify the remote server receive connector configuration.">
				<Object Type="Cache" Name="RemoteServerList" Key1="Add" Key2="RemoteServer" Key3="%varAllE12NotAdvertisingXAnonTLS%" Key4="," Class="Name" GroupingClass="True" Display="Hide">
					<Setting Key1="RemoteServer" Substitution="REMOTESERVER"/>
					<!--Only perform the following checks for Exchange Server 2007s that are in the local organization-->
					<Object Type="Group" Name="Remote SMTP Status" Class="Area" GroupingClass="True" Display="Hide" SecurityContext="EXLOGON">

						<Object Type="MonadCommand" Name="Fqdn" Key1="get-ExchangeServer '%REMOTESERVER%' -Status -DomainController %varDCName% | where {$_.AdminDisplayVersion -match &quot;Version 8&quot; -or $_.AdminDisplayVersion -match &quot;Version 14&quot;}">
							<Rule Name="fRemoteE12ServerinOrgNotFound" Query="count(../Instance)=0" Error="None" Title="Remote Exchange Server 2007 advertising '{1}' but is not in local Active Directory forest" Text="The remote Exchange Server 2007 {0} is not in the same Active Directory forest (Exchange organization) as {3} and is advertising '{1}' and '{2}'. This would be expected in a multi-forest topology." S0="'%REMOTESERVER%'" S1="XEXCH50" S2="X-ANONYMOUSTLS" S3="%varExName%"/>
							<Setting Key1="Fqdn" Substitution="FQDN"/>
							<Setting Key1="IsHubTransportServer">
								<Rule Name="fRemoteE12ServerhasHTRole" Query="$." Error="None" Title="Remote server ({0}) has Hub Transport role installed" Text="The remote Exchange Server 2007 {0} has the Hub Transport role installed." S0="%FQDN%"/>
							</Setting>
							<Setting Key1="IsClientAccessServer"/>
							<Setting Key1="IsEdgeServer"/>
							<Setting Key1="IsMailboxServer"/>
							<Setting Key1="IsUnifiedMessagingServer"/>
							<Setting Key1="IsMemberOfCluster"/>
							<Setting Key1="AdminDisplayVersion"/>
							<Setting Key1="Site"/>
							<Setting Key1="CurrentConfigDomainController"/>
							<Setting Key1="CurrentDomainControllers"/>
							<Setting Key1="CurrentGlobalCatalogs"/>
							<Setting Key1="StaticDomainControllers"/>
							<Setting Key1="StaticGlobalCatalogs"/>
							<Setting Key1="StaticConfigDomainController"/>
							<Setting Key1="StaticExcludedDomainControllers"/>
							<Setting Key1="WhenChanged"/>
							<Setting Key1="OriginatingServer"/>

							<Object Type="If" Name="%REMOTESERVER%" Key1="true()" Display="Hide">
								<Setting Key1="date-add('%varCurrentDateTime%', get-timespan(-(1 * 3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>

								<!--Check for 'MSExchangeTransport' event 12012 (logged when transport service fails to read local certificate)-->
								<Object Type="WMI" Key1="%REMOTESERVER%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchangeTransport' AND EventCode='12012' AND TimeWritten &gt; '%STARTTIME%'" Range="1" Sort="TimeWritten DESC">
									<Rule Name="szTransportSvcEvent12012Exception" Query="../Exception" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%REMOTESERVER%"/>
									<Rule Name="fTransportSvcEvent12012Found" Query="count(../Instance) &gt; 0" AlwaysEvaluate="True"/>
									<Setting Key1="TimeWritten" Format="CIMDateTime" Display="Hide">
										<Rule Name="szTransportSvcEvent12012TimeStamp" Query="$."/>
									</Setting>
									<Setting Key1="Message">
										<Rule Name="szE12RemoteServerEvent12012Msg" Query="$." Error="Error" Sev="1" ReportIssue="RootCause" Title="Remote server is failing to load certificate" Text="The '{3}' service on remote server {0} is unable to load a certificate and is not advertising '{1}'. The following event description was logged at {5} UTC: {4}" S0="'%REMOTESERVER%'" S1="X-ANONYMOUSTLS" S3="MSExchangeTransport" P4="$." P5="$szTransportSvcEvent12012TimeStamp"/>
									</Setting>
								</Object>
							</Object>

						</Object>
					</Object>
				</Object>

				<Rule Name="szRDE12ReceiveCheck" Query="'RDE12ReceiveCheck'">
					<Variable Name="varPreviousName" Scope="Children"/>
				</Rule>
				<Rule Name="szExErrorStateText" Query="if($fTransportSvcEvent12012Found,string(@Title),$szExNoErrorStateText)" Title="Issues found in receive connector configuration." AlwaysEvaluate="True">
					<Variable Name="varErrorStateText" Scope="Global"/>
				</Rule>
				<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No issues found in receive connector configuration were identified."/>
				<Rule Name="szRDE12ReceiveCheckResult" Query="string(@Title)" Title="Receive Connector Analysis Results">
					<Variable Name="varDisplayTitle" Scope="Global"/>
				</Rule>

				<Rule NextStep="DisplayResultsStep" Name="fDisplayRDE12ReceiveCheckStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
			</Object>
		</Object>
	</Object>

	<!-- ****************************************************************************************************************** -->
	<Object Type="Step" Name="E12UnreachableQCheck" Title="Check Unreachable Queue" Display="Left">
		<Object Type="Variable" Key1="Scalar" Display="Hide">
			<Setting Key1="%varExName%" Substitution="varExName" Display="Hide"/>
			<Setting Key1="%varNonEnglishOS%" Substitution="varNonEnglishOS" Display="Hide"/>
			<Setting Key1="%varContinueRun%" Substitution="varContinueRun" Display="Hide"/>
			<Setting Key1="%varUnreachableQueueName%" Substitution="varUnreachableQueueName" Display="Hide"/>

			<Object Type="Progress" Title="Checking the Status of Unreachable Queue" Text="Please wait while the tool checks the status of queue {1}." S1="%varUnreachableQueueName%">
				<!-- Let's take a look at Unreachable performance in general-->
				<Object Type="Group" Name="Unreachable Queue" Class="Area" GroupingClass="True" Display="Hide">
					<Object Type="Group" Name="%varExName%" Class="Server" GroupingClass="True" Display="Hide">

						<!--Retrieve local system time from remote server and calculate 48 hrs difference-->
						<Object Type="WMI" Name="RetrieveRemoteTime" Key1="%varExName%" Key3="Win32_OperatingSystem" SecurityContext="EXLOGON">
							<Rule Name="fWmiEventLogException" Query="../Exception/@Message" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%HUBNAME%"/>
							<Setting Key1="LocalDateTime" Substitution="WMICURRENTTIME" Format="CIMDateTime"/>
							<Object Type="If" Name="ApplicationEventLog" Key1="true()">
								<Setting Key1="date-add(date-parse(substring('%WMICURRENTTIME%',1,19), 'MM/dd/yyyy HH:mm:ss'),get-timespan(-(48*3600)))" Substitution="STARTTIME" SubstitutionFormat="(\d{2})/(\d{2})/(\d{4}).(\d{2}):(\d{2}):(\d{2})----$3$1$2$4$5$6.000000+000" Display="Hide"/>

								<Object Type="WMI" Key1="%varExName%" Key3="Win32_NTLogEvent" Key4="LogFile='Application' AND SourceName='MSExchangeTransport' AND (EventCode='5006' or EventCode='5015' or EventCode='5020') AND TimeWritten &gt; '%STARTTIME%'" Sort="TimeWritten DESC" Range="1">
									<Rule Name="fUnreachableEventException" Query="count(../Exception) &gt; 0" Error="Error" Title="Error accessing WMI repository" Text="An exception occurred while querying the Windows Management Instrumentation (WMI) service on server {2}, Exception message: {1}" P1="../Exception/@Message" S2="%HUBNAME%"/>
									<Setting Key1="TimeWritten" Format="(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.\d{6}([\+|\-])(\d{3})----$1/$2/$3 $4:$5:$6 GMT $7 $8" Substitution="TIMEWRITTEN" Display="Hide"/>
									<Setting Key1="EventCode" Substitution="EVENTCODE"/>
									<Setting Key1="Message" Format="([\r\n])---- " Substitution="MESSAGE" Display="Hide">
										<Rule Name="szUnreachableEvent" Query="$." AlwaysEvaluate="True" Error="Error" ReportIssue="RootCause" Sev="1" Title="'{0}' Event ID {3} found" Text="'{0}' Event ID {3} was found on {4} at {2} with description '{1}'." S0="MSExchangeTransport" S1="%MESSAGE%" S2="TIMEWRITTEN" S3="%EVENTCODE%" S4="%varExName%"/>
									</Setting>
									<Rule Name="iUnreachableEventCount" Query="count($szUnreachableEvent)" AlwaysEvaluate="True"/>
								</Object>
							</Object>
						</Object>

						<Object Type="MonadCommand" Name="Identity" Key1="get-message -Queue %varUnreachableQueueName% -IncludeRecipientInfo:$TRUE">
							<Setting Key1="Identity" Substitution="IDENTITY"/>
							<Setting Key1="FromAddress" Substitution="FROMADDRESS"/>
							<Setting Key1="Status"/>
							<Setting Key1="Subject"/>
							<Setting Key1="InternetMessageId"/>
							<Setting Key1="MessageSourceName" Substitution="MESSAGESOURCENAME"/>
							<Setting Key1="SourceIP"/>
							<Setting Key1="SCL"/>
							<Setting Key1="DateReceived"/>
							<Setting Key1="ExpirationTime"/>
							<Setting Key1="LastError" Substitution="LASTERROR"/>
							<Setting Key1="RetryCount"/>
							<Setting Key1="Recipients">
								<Rule Name="szUnreachableMsgRecipients" Query="join(',',$.)" AlwaysEvaluate="True"/>
								<Rule Name="iUnreachableMsgRecipientCount" Query="count($.)" Error="Error" Sev="1" ReportIssue="RootCause" Title="Message '{1}' cannot be routed to {3} recipients" Text="Message '{1}' from sender '{2}' cannot be routed to {3} recipients with last error '{5}'. The following is the list of recipients: {4}. Ensure that a valid route exists to each recipient listed." S1="%IDENTITY%" S2="%FROMADDRESS%" P3="count($.)" P4="$szUnreachableMsgRecipients" S5="%LASTERROR%" AlwaysEvaluate="True"/>
							</Setting>
						</Object>

					</Object>

					<Rule Name="szE12UnreachableQCheck" Query="'E12UnreachableQCheck'">
						<Variable Name="varPreviousName" Scope="Children"/>
					</Rule>
					<Rule Name="szExErrorStateText" Query="if($iUnreachableEventCount &gt; 0,string(@Title),$szExNoErrorStateText)" Title="Unreachable queue issues found." AlwaysEvaluate="True">
						<Variable Name="varErrorStateText" Scope="Global"/>
					</Rule>
					<Rule Name="szExNoErrorStateText" Query="string(@Title)" Title="No unreachable queue issues were identified."/>
					<Rule Name="szE12UnreachableQCheckResult" Query="string(@Title)" Title="Unreachable Queue Analysis Results">
						<Variable Name="varDisplayTitle" Scope="Global"/>
					</Rule>

					<Rule NextStep="DisplayResultsStep" Name="fDisplayE12UnreachableQCheckStep" Query="@S1='0'" Priority="1" S1="%varContinueRun%" AlwaysEvaluate="True"/>
				</Object>
			</Object>
		</Object>
	</Object>
	
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>tW8u6dHy7waN+UYN/VU0Ro2oblw=</DigestValue></Reference></SignedInfo><SignatureValue>
    aZKIcjige/lW8mEx1ndDF99NAZx1PmvBcP1gR9SrvJrA3G2ZcmZksV1IgY6mZX9RLHLBvrpY
    kg1b5nJlc/sBf/mWa6LwM6jZHr390wpYAZ0pZswEBpcqZHQv4e5nVKpK7KpNilnHbQbgSiSQ
    5xDypQQVu9tN4W0Z0YpdBYenKy4HuvixHWcTDco6xxXx/K/iqPCSPMB+hVzoMhYf8JJzVzx6
    bIwNjTkEB+Qx5fw1n46vuWDFYl3bBWepDr2xyvCJACDFrvZO8q5C8zhlN456inTgvlIxbty9
    V+PK3uYlbxNXk83uZlbKAgaeAdVuySnk0STVF82Jd00w7igWYAVdeg==
  </SignatureValue><KeyInfo>
      <KeyValue>
        <RSAKeyValue>
          <Modulus>
            vXK0ieccn4XHdLhgXAM2PZz9mXqaKUYisKeHU+3uRjrHWwULV6i3ygXM00x3R3CFs+XL32fn
            o/10J5Nnn9eKA0QwxvfJusk6HQhWRE8XCA35tBloqiQc+wVXhenFTgchN6frziwvtkLNIQWn
            1ubTKFfHG3rOKTYHzZ5VzLvxIuuoI6QNKcL70MNaPmM9xyxJC3t5hfCI73G9Q1rjo7MN81X7
            JeDiINPnml6UpTMtKH9XG1VqDDJE72Zsb/A4nO8CrZqh3ZgHEA48GGnieU5GFOC5jNB1bZys
            AJwtQvVRuFr0eEWD6S58K7tdzRlhKK2UQwrFakL/tTKupCki3hbo0w==
          </Modulus>
          <Exponent>AQAB</Exponent>
        </RSAKeyValue>
      </KeyValue>
      <X509Data>
        <X509Certificate>
          MIIEejCCA2KgAwIBAgIKYQYngQAAAAAACDANBgkqhkiG9w0BAQUFADB5MQswCQYDVQQGEwJV
          UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj
          cm9zb2Z0IENvcnBvcmF0aW9uMSMwIQYDVQQDExpNaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBD
          QTAeFw0wODEwMjIyMTI0NTVaFw0xMDAxMjIyMTM0NTVaMIGDMQswCQYDVQQGEwJVUzETMBEG
          A1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0
          IENvcnBvcmF0aW9uMQ0wCwYDVQQLEwRNT1BSMR4wHAYDVQQDExVNaWNyb3NvZnQgQ29ycG9y
          YXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9crSJ5xyfhcd0uGBcAzY9
          nP2ZepopRiKwp4dT7e5GOsdbBQtXqLfKBczTTHdHcIWz5cvfZ+ej/XQnk2ef14oDRDDG98m6
          yTodCFZETxcIDfm0GWiqJBz7BVeF6cVOByE3p+vOLC+2Qs0hBafW5tMoV8cbes4pNgfNnlXM
          u/Ei66gjpA0pwvvQw1o+Yz3HLEkLe3mF8Ijvcb1DWuOjsw3zVfsl4OIg0+eaXpSlMy0of1cb
          VWoMMkTvZmxv8Dic7wKtmqHdmAcQDjwYaeJ5TkYU4LmM0HVtnKwAnC1C9VG4WvR4RYPpLnwr
          u13NGWEorZRDCsVqQv+1Mq6kKSLeFujTAgMBAAGjgfgwgfUwEwYDVR0lBAwwCgYIKwYBBQUH
          AwMwHQYDVR0OBBYEFCPRcypMvfvlIfpxHpkV0Rf5xKaKMA4GA1UdDwEB/wQEAwIHgDAfBgNV
          HSMEGDAWgBTMHc52AHBbr/HaxE6aUUQuo0Rj8DBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8v
          Y3JsLm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9DU1BDQS5jcmwwSAYIKwYBBQUH
          AQEEPDA6MDgGCCsGAQUFBzAChixodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpL2NlcnRz
          L0NTUENBLmNydDANBgkqhkiG9w0BAQUFAAOCAQEAQynPY71s43Ntw5nXbQyIO8ZIc3olzizi
          N3udNJ+9I86+39hceRFrE1EgAWO5cvcI48Z9USoWKNTR55sqzxgN0hNxkSnsVr351sUNL69l
          LW1NRSlWcoRPP9JqHUFiqXlcjvDHd4rLAiguncecK+W5Kgnd7Jfi5XqNXhCIU6HdYE93mHFg
          qFs5kdOrEh8F6cNFqdPCUbmvuNz8BoQA9HSj2//MHaAjBQfkJzXCl5AZqoJgJ+j7hCse0QTL
          js+CDdeoTUNAddLe3XfvilxrD4dkj7S6t7qrZ1QhRapKaOdUXosUXGd47JBcAxCRCJ0kIJfo
          3wARcKn5snJwt67iwp8WAg==
        </X509Certificate>
      </X509Data>
      <X509Data>
        <X509Certificate>
          MIIEEjCCAvqgAwIBAgIPAMEAizw8iBHRPvZj7N9AMA0GCSqGSIb3DQEBBAUAMHAxKzApBgNV
          BAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jv
          c29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5MB4X
          DTk3MDExMDA3MDAwMFoXDTIwMTIzMTA3MDAwMFowcDErMCkGA1UECxMiQ29weXJpZ2h0IChj
          KSAxOTk3IE1pY3Jvc29mdCBDb3JwLjEeMBwGA1UECxMVTWljcm9zb2Z0IENvcnBvcmF0aW9u
          MSEwHwYDVQQDExhNaWNyb3NvZnQgUm9vdCBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUA
          A4IBDwAwggEKAoIBAQCpAr3BcOY78k4bKJ+XeF4w6qKpjSVf+P6VTKO3/p2iID58UaKboo9g
          MmvRQmR57qx2yVTa8uuchhyPn4Rms8VremIj1h083g8BkuiWxL8tZpqaaCaZ0Dosvwy1WCbB
          RucKPjiWLKkoOajsSYNC44QPu5psVWGsgnyhYC13TOmZtGQ7mlAcMQgkFJ+p55ErGOY9mGMU
          YFgFZZ8dN1KH96fvlALGG9O/VUWziYC/OuxUlE6u/ad6bXROrxjMlgkoIQBXkGBpN7tLEgc8
          Vv9b+6RmCgim0oFWV++2O14WgXcE2va+roCV/rDNf9anGnJcPMq88AijIjCzBoXJsyB3E4Xf
          AgMBAAGjgagwgaUwgaIGA1UdAQSBmjCBl4AQW9Bw72lyniNRfhSyTY7/y6FyMHAxKzApBgNV
          BAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jv
          c29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5gg8A
          wQCLPDyIEdE+9mPs30AwDQYJKoZIhvcNAQEEBQADggEBAJXoC8CN85cYNe24ASTYdxHzXGAy
          n54Lyz4FkYiPyTrmIfLwV5MstaBHyGLv/NfMOztaqTZUaf4kbT/JzKreBXzdMY09nxBwarv+
          Ek8YacD80EPjEVogT+pie6+qGcgrNyUtvmWhEoolD2Oj91Qc+SHJ1hXzUqxuQzIH/YIX+OVn
          bA1R9r3xUse958Qw/CAxCYgdlSkaTdUdAqXxgOADtFv0sd3IV+5lScdSVLa0AygS/5DW8AiP
          friXxas3LOR65Kh343agANBqP8HSNorgQRKoNWobats14dQcBOSoRQTIWjM4bk0cDWK3CqKM
          09VUP0bNHFWmcNsSOoeTdZ+n0qA=
        </X509Certificate>
      </X509Data>
      <X509Data>
        <X509Certificate>
          MIIEYDCCA0ygAwIBAgIKLqsR3FD/XJ3LwDAJBgUrDgMCHQUAMHAxKzApBgNVBAsTIkNvcHly
          aWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jw
          b3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5MB4XDTA3MDgyMjIy
          MzEwMloXDTEyMDgyNTA3MDAwMFoweTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0
          b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEj
          MCEGA1UEAxMaTWljcm9zb2Z0IENvZGUgU2lnbmluZyBQQ0EwggEiMA0GCSqGSIb3DQEBAQUA
          A4IBDwAwggEKAoIBAQC3eX3WXbNFOag0rDHa+SU1SXfA+x+ex0Vx79FG6NSMw2tMUmL0mQLD
          TdhJbC8kPmW/ziO3C0i3f3XdRb2qjw5QxSUr8qDnDSMf0UEk+mKZzxlFpZNKH5nNsy8iw0ot
          fG/ZFR47jDkQOd29KfRmOy0BMv/+J0imtWwBh5z7urJjf4L5XKCBhIWOsPK4lKPPOKZQhRcn
          h07dMPYAPfTG+T2BvobtbDmnLjT2tC6vCn1ikXhmnJhzDYav8sTzILlPEo1jyyzZMkUZ7rtK
          ljtQUxjOZlF5qq2HyFY+n4JQiG4FsTXBeyS9UmY9mU7MK34zboRHBtGe0EqGAm6GAKTAh99T
          AgMBAAGjgfowgfcwEwYDVR0lBAwwCgYIKwYBBQUHAwMwgaIGA1UdAQSBmjCBl4AQW9Bw72ly
          niNRfhSyTY7/y6FyMHAxKzApBgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQg
          Q29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9z
          b2Z0IFJvb3QgQXV0aG9yaXR5gg8AwQCLPDyIEdE+9mPs30AwDwYDVR0TAQH/BAUwAwEB/zAd
          BgNVHQ4EFgQUzB3OdgBwW6/x2sROmlFELqNEY/AwCwYDVR0PBAQDAgGGMAkGBSsOAwIdBQAD
          ggEBAHurrn5KJvLOvE50olgndCp1s4b9q0yUeABN6crrGNxpxQ6ifPMCQ8bKh8z4U8zCn71W
          b/BjRKlEAO6WyJrVHLgLnxkNlNfaHq0pfe/tpnOsj945jj2Yarw4bdKIryP93+nWaQmRiL3+
          4QC7NPP3fPkQEi4F6ymWk0JrKHG3OI/gBw3JXWjNvYBBa2aou7e7jjTK8gMQfHr10uBC33v+
          4eGs/vbf1Q2zcNaS40+2OKJ8LdQ92zQLYjcCn4FqI4n2XGOPsFq7OddgjFWEGjP1O5igggyi
          X4uzLLehpcur2iC2vzAZhSAUDSq8UvRB4F4w45IoaYfBcOLzp6vOgEJydg4=
        </X509Certificate>
      </X509Data>
    </KeyInfo><Object id="ts-countersig"><X509Data><X509Certificate>MIIEnTCCA4WgAwIBAgIKYUl87QAAAAAABTANBgkqhkiG9w0BAQUFADB5MQswCQYDVQQGEwJVUzET
MBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0
IENvcnBvcmF0aW9uMSMwIQYDVQQDExpNaWNyb3NvZnQgVGltZXN0YW1waW5nIFBDQTAeFw0wNjA5
MTYwMTU1MjJaFw0xMTA5MTYwMjA1MjJaMIGmMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu
Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMScw
JQYDVQQLEx5uQ2lwaGVyIERTRSBFU046MTBEOC01ODQ3LUNCRjgxJzAlBgNVBAMTHk1pY3Jvc29m
dCBUaW1lc3RhbXBpbmcgU2VydmljZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOq6
BWPI2XmuhEQ+pbPE7UyeJN85dh4J1jJKWHjSK9mlB5Dv5z37vSZ8o/vlfX4yz9k9izk38vjYOzQW
1JKC+zTsaIVyGo/guEzguIXzMwoCwaJ2czVMXfG34Up9HbiUeNv/HoUVQkZxzn8nVxLRg087z/re
9ovtPwDj1d5h+ReNS6SBPPVpQOrhib8HT7p0e+kM5Ufqq2zx1WeBCPgWyn0Tu3PiCUz6YvvtoDma
Ov7rEchhHmJY2ApUg9U7S0viVb0vYBqOkgVD2l3rggojlwmgBTFli5NOHkEhopKQ/UVERW81sUU3
rWmpZfk0Q7EXwjs54RCM8hqH41RQHzudMa0CAwEAAaOB+DCB9TAdBgNVHQ4EFgQUfnLwLj9WKeAl
92i4AfxL4X7P4z4wHwYDVR0jBBgwFoAUb+hOP5e5NKtLho+8nOqsO0FDxtAwRAYDVR0fBD0wOzA5
oDegNYYzaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3BraS9jcmwvcHJvZHVjdHMvdHNwY2EuY3Js
MEgGCCsGAQUFBwEBBDwwOjA4BggrBgEFBQcwAoYsaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3Br
aS9jZXJ0cy90c3BjYS5jcnQwEwYDVR0lBAwwCgYIKwYBBQUHAwgwDgYDVR0PAQH/BAQDAgbAMA0G
CSqGSIb3DQEBBQUAA4IBAQBpeoIJDBbR3s9GiS6/0TR6gX8nKEEq89Mhkg6XrV9TXin57cFUSqh9
9xPQCxT5TfKGFQBu44MdKEWnLDky3W+aN1ruI1KPVAONP6ecZDj2NsgUQ7Y6PpjJDcNxgSjzZqcx
4lxdj/lSUuFc65OQnWkJTInR0XZMNA1q4XxEpytbg1R/RSQZJcSKRsUl4xmAaSkU9hfG8CIsgUZe
K/T5psZ3PiNv+aZkhY6iYg2pLR6o5ZA+f/+wjvyX7PH9BK/NSc5adKz68xMfGznOo7TWvPS07sit
8lYe+zzxyNYqRLy/nD99ZhjNsiBjCspAPWUyGXyyuD3BJkhOIhmZbowwwfGR</X509Certificate></X509Data><X509Data><X509Certificate>MIIEnTCCA4WgAwIBAgIQaguZT8AAJasR20UfWHpnojANBgkqhkiG9w0BAQUFADBwMSswKQYDVQQL
EyJDb3B5cmlnaHQgKGMpIDE5OTcgTWljcm9zb2Z0IENvcnAuMR4wHAYDVQQLExVNaWNyb3NvZnQg
Q29ycG9yYXRpb24xITAfBgNVBAMTGE1pY3Jvc29mdCBSb290IEF1dGhvcml0eTAeFw0wNjA5MTYw
MTA0NDdaFw0xOTA5MTUwNzAwMDBaMHkxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9u
MRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xIzAhBgNV
BAMTGk1pY3Jvc29mdCBUaW1lc3RhbXBpbmcgUENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
CgKCAQEA3Ddu+6/IQkpxGMjOSD5TwPqrFLosMrsST1LIg+0+M9lJMZIotpFk4B9QhLrCS9F/Bfjv
db6Lx6jVrmlwZngnZui2t++Fuc3uqv0SpAtZIikvz0DZVgQbdrVtZG1KVNvd8d6/n4PHgN9/TAI3
lPXAnghWHmhHzdnAdlwvfbYlBLRWW2ocY/+AfDzu1QQlTTl3dAddwlzYhjcsdckO6h45CXx2/p1s
bnrg7D6Pl55xDl8qTxhiYDKe0oNOKyJcaEWL3i+EEFCy+bUajWzuJZsT+MsQ14UO9IJ2czbGlXqi
zGAG7AWwhjO3+JRbhEGEWIWUbrAfLEjMb5xD4GrofyaOawIDAQABo4IBKDCCASQwEwYDVR0lBAww
CgYIKwYBBQUHAwgwgaIGA1UdAQSBmjCBl4AQW9Bw72lyniNRfhSyTY7/y6FyMHAxKzApBgNVBAsT
IkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNVBAsTFU1pY3Jvc29mdCBD
b3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJvb3QgQXV0aG9yaXR5gg8AwQCLPDyIEdE+
9mPs30AwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFG/oTj+XuTSrS4aPvJzqrDtBQ8bQMBkG
CSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MA0G
CSqGSIb3DQEBBQUAA4IBAQCUTRExwnxQuxGOoWEHAQ6McEWN73NUvT8JBS3/uFFThRztOZG3o1YL
3oy2OxvR+6ynybexUSEbbwhpfmsDoiJG7Wy0bXwiuEbThPOND74HijbB637pcF1Fn5LSzM7djsDh
vyrNfOzJrjLVh7nLY8Q20Rghv3beO5qzG3OeIYjYtLQSVIz0nMJlSpooJpxgig87xxNleEi7z62D
Ok+wYljeMOnpOR3jifLaOYH5EyGMZIBjBgSW8poCQy97Roi6/wLZZflK3toDdJOzBW4MzJ3cKGF8
SPEXnBEhOAIch6wGxZYyuOVAxlM9vamJ3uhmN430IpaczLB3VFE61nJEsiP2</X509Certificate></X509Data><CounterSignature xmlns="http://schemas.microsoft.com/xmldsig/timestamp/2003" ts-format="cms-timestamp-message">MIIGuAYJKoZIhvcNAQcCoIIGqTCCBqUCAQMxCTAHBgUrDgMCGjCCARMGCSqGSIb3DQEHAaCCAQQE
ggEAaZKIcjige/lW8mEx1ndDF99NAZx1PmvBcP1gR9SrvJrA3G2ZcmZksV1IgY6mZX9RLHLBvrpY
kg1b5nJlc/sBf/mWa6LwM6jZHr390wpYAZ0pZswEBpcqZHQv4e5nVKpK7KpNilnHbQbgSiSQ5xDy
pQQVu9tN4W0Z0YpdBYenKy4HuvixHWcTDco6xxXx/K/iqPCSPMB+hVzoMhYf8JJzVzx6bIwNjTkE
B+Qx5fw1n46vuWDFYl3bBWepDr2xyvCJACDFrvZO8q5C8zhlN456inTgvlIxbty9V+PK3uYlbxNX
k83uZlbKAgaeAdVuySnk0STVF82Jd00w7igWYAVdeqCCA2yhggNoMIICUAIBATCB1qGBrKSBqTCB
pjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAc
BgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEnMCUGA1UECxMebkNpcGhlciBEU0UgRVNOOjEw
RDgtNTg0Ny1DQkY4MScwJQYDVQQDEx5NaWNyb3NvZnQgVGltZXN0YW1waW5nIFNlcnZpY2WiJQoB
ATAJBgUrDgMCGgUAAxUAotV9Y88zGxd74UcIj+q+xziL4B2ggcEwgb6kgbswgbgxCzAJBgNVBAYT
AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy
b3NvZnQgQ29ycG9yYXRpb24xDDAKBgNVBAsTA0FPQzEnMCUGA1UECxMebkNpcGhlciBOVFMgRVNO
OjIyQTEtMjA4RS04N0IwMSswKQYDVQQDEyJNaWNyb3NvZnQgVGltZSBTb3VyY2UgTWFzdGVyIENs
b2NrMA0GCSqGSIb3DQEBBQUAAgUAzmZaTDAiGA8yMDA5MDkyNDIwNTEyNFoYDzIwMDkwOTI1MjA1
MTI0WjB0MDoGCisGAQQBhFkKBAExLDAqMAoCBQDOZlpMAgEAMAcCAQACAhDOMAcCAQACAjCCMAoC
BQDOZ6vMAgEAMDYGCisGAQQBhFkKBAIxKDAmMAwGCisGAQQBhFkKAwGgCjAIAgEAAgMHoSChCjAI
AgEAAgMHoSAwDQYJKoZIhvcNAQEFBQADggEBAKRPPdqj6Ijbn0ecUGeey1x63TyMNdA3B0LHNcVb
yfwFtxsrA4KhzOOVxi7A5m4+neMTsVJc1QAx/oO7sg5XtgzqJ4K1aR5NzQevqezy7b14qHZTZvyS
C/ztAsOc346BK/qUm0xowwHBspJXwbRzTri6yz9SNIpNAmzyrS7o+VDVCxgd7SObBZtcf5kSm56b
DR17I0nTDfMzvzk27+gCGiVbvTwItXhQfuUjDi33S8pP2nPYwnL29lmf6eLCiAvX2s8YMfO61o8M
PJrgAglw7yuT6yYT3tkHRZpiz32bFWdZYFzCbgMsxY80lJQ1wfg51IZ7r9lp7jbs1ruUFn77RgEx
ggIMMIICCAIBATCBhzB5MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE
BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSMwIQYDVQQDExpNaWNy
b3NvZnQgVGltZXN0YW1waW5nIFBDQQIKYUl87QAAAAAABTAHBgUrDgMCGqBdMBgGCSqGSIb3DQEJ
AzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA5MDkyNTA1NTA1MlowIwYJKoZIhvcNAQkE
MRYEFGjLyeWmV56B41fXI4XSLWFjpGEgMA0GCSqGSIb3DQEBBQUABIIBAFnxjGLLBN3iO8GR8JJ4
xLj2kWwnLCmeic1GD6WZSHSEnEomgcvEc+8Csfnx46GZwnA45Ep7Nb54M2JRUD75cigwgH1qbDhm
fNAVm2h6CPczImL8gBaDY14k3vzSY/kwnJhs1kPH/DQwfQSK06tVIZI9Bv1RgdCX68tSlv6Rtwpa
Sos1ElBEK8WpcZfrXU85zqIM8JfOPBA3aOz6oDOxwrtEa7mbNn/AWjDfMU9L438Ion55kZdsP5nE
ejlZ3gn6buJvooICmj0M9L+gHbAYFP5O/14E2aAi4wApakdZksg4QIUTKJIpcFnZPTmYkXBvtvz8
Gv4uQ5WlCobkblJN8yU=</CounterSignature></Object></Signature></Wizard>