{"id":2305,"date":"2018-12-05T10:55:07","date_gmt":"2018-12-05T10:55:07","guid":{"rendered":"http:\/\/galhano.com\/blog\/?p=2305"},"modified":"2026-01-20T10:39:30","modified_gmt":"2026-01-20T10:39:30","slug":"use-the-exchange-management-shell-to-set-up-mail-forwarding","status":"publish","type":"post","link":"http:\/\/galhano.com\/blog\/?p=2305","title":{"rendered":"Use the Exchange Management Shell to set up mail forwarding"},"content":{"rendered":"<p>This example delivers email to the mailbox of Douglas Kohn and, at the same time, forwards all mail sent to Douglas Kohn to douglaskohn.parents@fineartschool.net.<\/p>\n<pre>[ps]\nSet-Mailbox -Identity \"Douglas Kohn\" -DeliverToMailboxAndForward $true -ForwardingSMTPAddress \"douglaskohn.parents@fineartschool.net\"\n[\/ps]<\/pre>\n<p>This example forwards all email sent to the mailbox of Ken Sanchez, an employee of Contoso Suites, to one of his coworkers, pilarp@contoso.com.<\/p>\n<pre>[ps]\nSet-Mailbox -Identity \"Ken Sanchez\" -ForwardingSMTPAddress \"pilarp@contoso.com\"\n [\/ps]<\/pre>\n<p>For detailed syntax and parameter information, see <a class=\"\" href=\"http:\/\/technet.microsoft.com\/library\/a0d413b9-d949-4df6-ba96-ac0906dedae2.aspx\" data-linktype=\"external\">Set-Mailbox<\/a>.<\/p>\n<p><b>Note:<\/b><br \/>\n-ForwardingsmtpAddress to multiple addresses Shell script<\/p>\n<p>The parameter &#8220;ForwardingSmtpAddress&#8221; only allow to setup one SMTP address.<br \/>\nTo work around this issue, you can setup the mailbox forwarding to a distribution group, you need to add the users you want to forward message to this distribution group.<\/p>\n<p>link:<br \/>\nhttps:\/\/docs.microsoft.com\/en-us\/exchange\/recipients\/user-mailboxes\/email-forwarding?view=exchserver-2019<\/p>\n<p>on office365 account, go to portal.office.com &gt; outlook &gt; definitions<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>REMOVE<\/p>\n<p>[ps]<br \/>\nSet-Mailbox &#8220;email xpto&#8221; -ForwardingAddress $NULL -ForwardingSmtpAddress $NULL<br \/>\n[\/ps]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This example delivers email to the mailbox of Douglas Kohn and, at the same time, forwards all mail sent to Douglas Kohn to douglaskohn.parents@fineartschool.net. [ps] Set-Mailbox -Identity &#8220;Douglas Kohn&#8221; -DeliverToMailboxAndForward $true -ForwardingSMTPAddress &#8220;douglaskohn.parents@fineartschool.net&#8221; [\/ps] This example forwards all email sent to the mailbox of Ken Sanchez, an employee of Contoso Suites, to one of his [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,22,161],"tags":[],"class_list":["post-2305","post","type-post","status-publish","format-standard","hentry","category-exchange","category-microsoft","category-powershell","author-admin"],"_links":{"self":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2305"}],"version-history":[{"count":9,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2305\/revisions"}],"predecessor-version":[{"id":2383,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2305\/revisions\/2383"}],"wp:attachment":[{"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2305"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/galhano.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}