{"id":148,"date":"2019-02-18T07:00:09","date_gmt":"2019-02-18T12:00:09","guid":{"rendered":"https:\/\/blog.markdepalma.com\/?p=148"},"modified":"2019-02-19T15:41:57","modified_gmt":"2019-02-19T20:41:57","slug":"test-mailflow-cmdlet-failing-with-failure","status":"publish","type":"post","link":"https:\/\/blog.markdepalma.com\/?p=148","title":{"rendered":"Test-MailFlow cmdlet failing with *FAILURE*"},"content":{"rendered":"\n<p style=\"text-align:left\">I recently started looking into using the Test-Mailflow cmdlet to develop an email flow monitoring script in LogicMonitor. I had never tried using it in my current environment before and when I tried executing the cmdlet it just timed out with this output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[PS] C:\\Windows\\system32&gt;Test-Mailflow -Identity mailbox01<br> RunspaceId         : 808205bb-e671-4a65-94ca-1828bf0f7ab8<br> TestMailflowResult : *FAILURE*<br> MessageLatencyTime : 00:00:00<br> IsRemoteTest       : False<br> Identity           :<br> IsValid            : True<\/pre>\n\n\n\n<p>I tried adding -Verbose and -Debug switches and did not get anything useful. I checked to make sure all system mailboxes (<strong><em>Get-Mailbox -Arbitration<\/em><\/strong>) were in place and verified the test messages were going out via the transport logs. I dug a little more into how the cmdlet actually works and found that it sends an email with a delivery receipt which led me to look into that. I eventually found that we had our &#8216;<strong>DSNConversionMode<\/strong>&#8216; set to &#8216;<strong>DoNotConvert&#8217; <\/strong>in our transport configuration:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[PS] C:\\Windows\\system32&gt;Get-TransportConfig | fl DSNConversionMode<br> DSNConversionMode : DoNotConvert<\/pre>\n\n\n\n<p>After changing it back to the default <strong>(UseExchangeDSNs)<\/strong> the cmdlet started working. During testing I was sending email from my mailbox to a system mailbox with the &#8216;<strong>Request a Delivery Receipt<\/strong>&#8216; option checked. Exchange is expecting the default format in the delivery receipt DSN email and when it is modified Exchange cannot process it.<\/p>\n\n\n\n<p><strong>Delivery receipt with DSNConversionMode set to DoNotConvert:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"887\" height=\"498\" src=\"https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-8.png\" alt=\"\" class=\"wp-image-150\" srcset=\"https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-8.png 887w, https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-8-300x168.png 300w, https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-8-768x431.png 768w, https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-8-624x350.png 624w\" sizes=\"auto, (max-width: 887px) 100vw, 887px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Delivery receipt with DSNConversionMode set to UseExchangeDSNs: <\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-9.png\"><img loading=\"lazy\" decoding=\"async\" width=\"896\" height=\"354\" src=\"https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-9.png\" alt=\"\" class=\"wp-image-151\" srcset=\"https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-9.png 896w, https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-9-300x119.png 300w, https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-9-768x303.png 768w, https:\/\/blog.markdepalma.com\/wp-content\/uploads\/2019\/02\/image-9-624x247.png 624w\" sizes=\"auto, (max-width: 896px) 100vw, 896px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I recently started looking into using the Test-Mailflow cmdlet to develop an email flow monitoring script in LogicMonitor. I had never tried using it in my current environment before and when I tried executing the cmdlet it just timed out with this output: [PS] C:\\Windows\\system32&gt;Test-Mailflow -Identity mailbox01 RunspaceId : 808205bb-e671-4a65-94ca-1828bf0f7ab8 TestMailflowResult : *FAILURE* MessageLatencyTime : [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69,72],"tags":[45],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-exchange","category-powershell","tag-exchange"],"_links":{"self":[{"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=148"}],"version-history":[{"count":5,"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=\/wp\/v2\/posts\/148\/revisions"}],"predecessor-version":[{"id":163,"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=\/wp\/v2\/posts\/148\/revisions\/163"}],"wp:attachment":[{"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.markdepalma.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}