<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>EXO Voice</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/exovoice/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/exovoice/feed.xml</link>
    <description>Exchange Online</description>
    <lastBuildDate>Mon, 23 Jul 2018 09:13:19 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Use PowerShell formatting features to your advantage!</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/use-powershell-formatting-features-in-your-advantage</link>
      <pubDate>Wed, 23 May 2018 16:49:13 GMT</pubDate>
      <dc:creator><![CDATA[Victor Legat]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3365</guid>
      <description><![CDATA[While troubleshooting customers' cases my colleague Tudor Chirita and I have seen many situations...]]></description>
      <content:encoded><![CDATA[While troubleshooting customers' cases my colleague <strong>Tudor Chirita</strong> and <strong>I</strong> have seen many situations where data collected was incomplete, unreadable/unusable or simple hard to follow.

We intend to present you some formatting options that can be used to have a more friendly experience.

The most used formatting options are: <strong>Format-Table</strong> and <strong>Format-List</strong>. Almost everybody is using them with their aliases: FT and FL
<ul>
 	<li>Format-Table</li>
</ul>
<p style="padding-left: 60px"><code>C:\&gt; Get-Mailbox | Format-Table</code></p>
<p style="padding-left: 60px">Name Alias ServerName ProhibitSendQuota
---- ----- ---------- -----------------
user1 user1 db5pr0101mb2040 99 GB (106,300,440,576 bytes)
user2 user2 vi1pr0101mb2014 49.5 GB (53,150,220,288 bytes)
user3 user3 he1pr0102mb2748 99 GB (106,300,440,576 bytes)
user4 user4 db5pr01mb1560 99 GB (106,300,440,576 bytes)
.............................................................</p>
If their properties have large text we can adapt format with <strong>FT -Wrap -AutoSize</strong>
<ul>
 	<li>Format-List</li>
</ul>
<p style="padding-left: 60px"><code>C:\&gt; Get-Mailbox Admin | Format-List</code></p>
<p style="padding-left: 60px">........................................
AcceptMessagesOnlyFromSendersOrMembers : {}
AddressListMembership : {\Staff GAL, \Mailboxes(VLV), \All Mailboxes(VLV), \All Recipients(VLV)...}
AdministrativeUnits : {}
Alias : admin
ArbitrationMailbox :
BypassModerationFromSendersOrMembers : {}
OrganizationalUnit : eurpr01a001.prod.outlook.com/Microsoft Exchange Hosted Organizations/vilega.onmicrosoft.com
CustomAttribute1 :
CustomAttribute10 :
CustomAttribute11 :
CustomAttribute12 :
CustomAttribute13 :
CustomAttribute14 :
CustomAttribute15 :
CustomAttribute2 :
CustomAttribute3 :
CustomAttribute4 :
CustomAttribute5 :
CustomAttribute6 :
CustomAttribute7 :
CustomAttribute8 :
CustomAttribute9 :
ExtensionCustomAttribute1 : {}
ExtensionCustomAttribute2 : {}
ExtensionCustomAttribute3 : {}
ExtensionCustomAttribute4 : {}
ExtensionCustomAttribute5 : {}
DisplayName : VictorL
EmailAddresses : {SPO:SPO_74020321-9dc9-4a7a-beba-33d0d7b74f03@SPO_e0ef2476-0aff-4b94-a7cb-68dc9a0555b8, smtp:postmaster@it4you.ro, smtp:admin@it4you.ro,
smtp:admin@vilega.mail.onmicrosoft.com...}
........................................</p>
As you can see some properties have truncated values. Example: AddressListMembership and EmailAddresses.

By default, PowerShell displays only the first 4 values of a property. This setting is stored in a variable called <strong>$FormatEnumerationLimit</strong>
E.g.:
<p style="padding-left: 60px"><code>C:\&gt; $FormatEnumerationLimit
4</code>

PowerShell can be configured not to truncate the output by setting this variable to -1.
E.g.:

<p style="padding-left: 60px"><code>$FormatEnumerationLimit = -1</code></p>
Another way to see all values of EmailAddresses property is to use <strong>Select-Object</strong> command with <strong>ExpandProperty</strong> option:
<p style="padding-left: 60px"><code>C:\&gt; Get-Mailbox Admin | Select-Object -ExpandProperty EmailAddresses
SPO:SPO_74020321-9dc9-4a7a-beba-33d0d7b74f03@SPO_e0ef2476-0aff-4b94-a7cb-68dc9a0555b8
smtp:postmaster@it4you.ro
smtp:admin@it4you.ro
smtp:admin@vilega.mail.onmicrosoft.com
SIP:admin@vilega.onmicrosoft.com
SMTP:admin@vilega.onmicrosoft.com</code>

<strong>Select-Object </strong>can also to used with  parameter <strong>ExcludeProperty </strong>to exclude some properties that could clutter the output.
When analyzing Exchange Online migration reports you can get:

<p style="padding-left: 60px"><code>$stats = Get-MoveRequestStatistics  -IncludeReport -Diagnostic -DiagnosticArgument Verbose
$stats | fl</code>

The output is large because the properties Report and DiagnosticInfo contain lots of data. If we want to have a fast overview of the output we can exclude those and analyze them later.

<p style="padding-left: 60px"><code>$stats | select -ExcludeProperty Report,DiagnosticInfo</code></p>
Now we can see the status of the migration and other parameters and if needed we can investigate separately the too large properties:
<p style="padding-left: 60px"><code>$stats.report.ToString()</code></p>
When using Format-Table, Format-List or Select-Object we can choose which properties to see by specifying property name or part of the name and wildcard character "<strong>*</strong>"
<p style="padding-left: 60px"><code>C:\&gt; Get-MailboxFolderStatistics admin | FT Name, items*</code></p>
<p style="padding-left: 60px">Name ItemsInFolder ItemsInFolderAndSubfolders
---- ------------- --------------------------
Top of Information Store 1 555
Archive 0 0
Calendar 20 31
Calendar1 0 0
Contacts 5 96
{A9E2BC46-B3A0-4243-B315-60D991004455} 3 3
...............................................................................</p>
Reading a large output of a  CmdLet can be gradually done in PowerShell console (not in ISE) by using <strong>"| more"</strong> or <strong>"Out-Host -Paging"</strong> like below:
<p style="padding-left: 60px"><code>Get-Command –Command  | select name, module | more
Get-Command –Command  | select name, module | Out-Host -Paging
get-help Get-MoveRequestStatistics -full |more
get-help Get-MoveRequestStatistics -full |Out-Host -Paging</code><code></code>

Navigate through result:  <strong>&lt;Space&gt;</strong> <strong>next page;  &lt;Enter&gt;next line; &lt;Q&gt; Quit</strong>

To get the result straight into the clipboard  you can use <strong> |clip</strong>
E.g.:

<p style="padding-left: 60px"><code>get-mailbox admin | select ExchangeGUID | clip</code></p>
<strong>Sorting</strong>
To sort the results  you can use <strong>"Sort"</strong> and the name property you want sort by. Default sorting is done <strong>Ascending</strong>; if you want to sort descending you have to use <strong>"-Descending" </strong>parameter.
<p style="padding-left: 60px"><code>Get-MailboxFolderStatistics admin |select name,folderpath,foldertype |sort folderpath</code></p>
<p style="padding-left: 60px">Name FolderPath FolderType
---- ---------- ----------
Archive /Archive Archive
Calendar /Calendar Calendar
Calendar Logging /Calendar Logging CalendarLogging
Calendar1 /Calendar/Calendar1 User Created
..................................................................................</p>
&nbsp;

<strong>Grouping the result</strong>

<span>The </span><strong>Group-Object</strong><span> cmdlet displays objects in groups based on the value of a specified property. </span><strong>Group-Object</strong><span> returns a table with one row for each property value and a column that displays the number of items with that value.</span>
<p style="padding-left: 60px"><code>Get-Mailbox -ResultSize Unlimited |Group-Object RecipientTypeDetails</code></p>
<p style="padding-left: 60px">Count Name Group
----- ---- -----
23 UserMailbox {admin2, admin3, admin4, cloud1, cloud3, cloud4, cloud5, cloud6,...
6 SharedMailbox {cloud2, journal_mbx, shared1, shared2, shared3, shared4}
1 DiscoveryMailbox {Discovery Search Mailbox}
1 SchedulingMailbox {IT}
2 RoomMailbox {room1, room4}</p>
&nbsp;

<strong>Show Hidden Parameter (-force)</strong>

PowerShell cannot define private parameters. These can only be hidden. To see all parameters (including hidden ones) of an object you can use <strong>* -force</strong>
E.g.: Showing all parameters of the last error received in current session of PowerShell vs default view of the error:
<p style="padding-left: 60px"><code>$e= $error[0]</code></p>
<p style="padding-left: 60px"><code>$e.Exception | fl</code>
The operation couldn't be performed because object 'John Doe' couldn't be found on 'VI1PR01A001DC01.EURPR01A001.prod.outlook.com'.</p>
<p style="padding-left: 60px"><code>$e.Exception | fl * -f</code>
SerializedRemoteException : Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException: The operation couldn't be performed because
object 'dfadfad' couldn't be found on 'VI1PR01A001DC01.EURPR01A001.prod.outlook.com'.
at Microsoft.Exchange.Configuration.Tasks.Task.ThrowError(Exception exception, ErrorCategory errorCategory, Object
target, String helpUrl)
at Microsoft.Exchange.Configuration.Tasks.GetObjectWithIdentityTaskBase`2.InternalProcessRecord()
at Microsoft.Exchange.Configuration.Tasks.GetRecipientObjectTask`2.InternalProcessRecord()
at Microsoft.Exchange.Management.RecipientTasks.GetRecipientWithAddressListBase`2.InternalProcessRecord()
at Microsoft.Exchange.Configuration.Tasks.Task.b__92_1()
at Microsoft.Exchange.Configuration.Tasks.Task.InvokeRetryableFunc(String funcName, Action func, Boolean
terminatePipelineIfFailed)
SerializedRemoteInvocationInfo : System.Management.Automation.InvocationInfo
ErrorRecord : The operation couldn't be performed because object 'John Doe' couldn't be found on
'VI1PR01A001DC01.EURPR01A001.prod.outlook.com'.
WasThrownFromThrowStatement : False
Message : The operation couldn't be performed because object 'John Doe' couldn't be found on
'VI1PR01A001DC01.EURPR01A001.prod.outlook.com'.
Data : {}
InnerException :
TargetSite :
StackTrace :
HelpLink :
Source :
HResult : -2146233087</p>
&nbsp;

<b><span>Exporting</span></b>

<span>When it comes to exporting data in order to either analyze later or do the formatting in another program, there are a few options available:</span>
<ul>
 	<li>Export-Clixml - this cmdlet allows a serialized object to be exported instead of just a text file. You can then use the Import-Clixml cmdlet to re-create the saved object based on the contents of that file.</li>
</ul>
<p style="padding-left: 60px"><code>Get-MailboxStatistics -Identity $mailbox -IncludeMoveReport | Export-Clixml C:\temp\Mailbox_statistics.xml
$Stats = Import-Clixml C:\temp\Mailbox_statistics.xml</code>

&nbsp;
<ul>
 	<li>Export-Csv - this cmdlet cmdlet creates a CSV file of the objects that you submit. Each object is represented as a line or row of the CSV.</li>
</ul>
<span><strong>Note:</strong> Do not format objects before sending them to the <b><i>Export-CSV</i></b> cmdlet. If you do, the format properties are represented in the CSV file, instead of the properties of the original objects. To export only selected properties of an object, use the <b><i>Select-Object</i></b> cmdlet.</span>

<span> Notable parameters:
-Path: Specifies the path to the CSV output file.
-Append: Adds the new script data to the end of the output file, instead of replacing the existing file contents.
-Delimiter: Specifies a delimiter to separate the property values. The default is a comma
-NoTypeInformation: omits the type information from the CSV file.</span>
<ul>
 	<li>By default, PowerShell sends its command output to the PowerShell console. However, you can direct the output to a text file.</li>
</ul>
<p style="padding-left: 30px">Use the <strong>Out-File</strong> cmdlet, which sends command output to a text file.</p>
<p style="padding-left: 60px"><code>$obj | Out-File C:\temp\props.txt</code></p>

<div style="list-style-type: none">
<div>"<strong>&gt;</strong>" Sends output to the specified file.</div>
</div>
<p style="padding-left: 60px"><code>Get-Process &gt; Process.txt</code></p>

<ul>
 	<li>The <strong>Out-GridView </strong>cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table.</li>
</ul>
<p style="padding-left: 60px"><code>Get-Mailbox | Out-GridView</code></p>
<p style="padding-left: 60px">The command uses the PassThru parameter of Out-GridView, which lets you send multiple items down the pipeline. The example below will show all soft deleted mailboxes and let the user select one or more mailbox(es) to recover and store it/them in <span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;line-height: 24px;text-align: left;text-decoration: none;text-indent: 0px">$MailboxToRecover</span>
<code>$MailboxToRecover = Get-Mailbox -SoftDeletedMailbox -ResultSize Unlimited | Out-GridView -PassThru</code></p>

<ul>
 	<li>The <strong>Tee-Object</strong> cmdlet saves command output in a file or variable and also sends it down the pipeline.</li>
</ul>
<p style="padding-left: 60px"><code>get-mailbox admin | select * | Tee-Object C:\temp\mymbx.txt</code></p>
&nbsp;

<strong>Hide Output</strong>

Sometime could be useful to hide <span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;line-height: 24px;text-align: left;text-decoration: none;text-indent: 0px">output from being displayed on the screen console</span>. There are multiple ways to accomplish this:
<ul>
 	<li>redirect the output to <strong>$null</strong></li>
</ul>
<p style="padding-left: 60px"><code>Add-MailboxPermission shared1 -User admin -AccessRights FullAccess</code> &gt; $null</p>

<ul>
 	<li>explicit cast the result object to <strong>[void]</strong></li>
</ul>
<p style="padding-left: 60px"><code>[void](Add-MailboxPermission shared1 -User admin -AccessRights FullAccess)</code></p>

<ul>
 	<li>The <strong>Out-Null</strong> cmdlet sends its output to NULL, in effect, removing it from the pipeline and preventing the output to be displayed at the screen.</li>
</ul>
<p style="padding-left: 60px"><code>Add-MailboxPermission shared1 -User admin -AccessRights FullAccess</code> | Out-Null</p>
&nbsp;

<strong>How to sort properties of a cmdlet</strong>

Cmdlet properties can also be sorted as desired. In this example, the properties of Get-Mailbox are sorted alphabetically for an easier view.

<p style="padding-left: 60px"><code>$obj = get-mailbox user1
$obj |select ($obj |gm |? MemberType -eq Property | sort name).name
$obj |select ($obj |gm -MemberType Property| sort name).name
$obj | fl -property ($obj| gm | sort name).name
$obj | %{
$newobj = new-object psobject;
$_.psobject.properties | Sort Name | %{
Add-Member -Inp $newobj NoteProperty $_.Name $_.Value};
$newobj
} | fl</code>

&nbsp;

<strong>References:</strong>

<span style="font-family: Calibri"><a href="https://docs.microsoft.com/en-us/powershell/scripting/getting-started/cookbooks/using-format-commands-to-change-output-view?view=powershell-6">https://docs.microsoft.com/en-us/powershell/scripting/getting-started/cookbooks/using-format-commands-to-change-output-view?view=powershell-6</a></span><span style="color: #000000;font-family: Calibri"> </span>

<span style="font-family: Calibri"><a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_redirection?view=powershell-6">https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_redirection?view=powershell-6</a></span><span style="color: #000000;font-family: Calibri"> </span>

<span style="font-family: Calibri"><a href="https://docs.microsoft.com/en-us/powershell/scripting/getting-started/cookbooks/redirecting-data-with-out---cmdlets?view=powershell-6">https://docs.microsoft.com/en-us/powershell/scripting/getting-started/cookbooks/redirecting-data-with-out---cmdlets?view=powershell-6</a></span><span style="color: #000000;font-family: Calibri"> </span>

<span style="font-family: Calibri"><a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_hidden?view=powershell-6">https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_hidden?view=powershell-6</a></span><span style="color: #000000;font-family: Calibri"> </span>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>How to set up IIS to send emails using Office 365</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/how-to-set-up-iis-to-send-emails-using-office-365</link>
      <pubDate>Thu, 17 May 2018 17:07:00 GMT</pubDate>
      <dc:creator><![CDATA[Cristian Nitu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3915</guid>
      <description><![CDATA[Sometimes organizations need to set up a multifunction device or application to send email through...]]></description>
      <content:encoded><![CDATA[Sometimes organizations need to set up a multifunction device or application to send email through Office 365 and they discover that the device or application can’t connect directly to Office 365. In these cases, they can to set up Internet Information Services (IIS) to work as an intermediary.

Office 365 customers might want to do this in the following scenarios:
<ul>
 	<li>The on-premises messaging system no longer exists</li>
 	<li>The on-premise hardware devices (e.g. scanner, printer, multi-functional printer, etc.) do not support TLS 1.2. (<a href="https://support.microsoft.com/en-us/help/4057306/preparing-for-tls-1-2-in-office-365">https://support.microsoft.com/en-us/help/4057306/preparing-for-tls-1-2-in-office-365</a>)</li>
 	<li>The on-premise Line-Of-Business applications (LOB) (e.g. Your resource management, Ticket/order processing, in-house developed applications, other 3rd party applications, etc.) must send email messages to remote domains and to Exchange Online mailboxes</li>
 	<li>To secure and restrict applications and devices that can relay emails through Office 365</li>
 	<li>The LOB application or the hardware device does not store any SMTP log needed in compliance or troubleshooting scenarios</li>
</ul>
When implementing this solution, customers must keep in mind that under no circumstances does Office 365 allows any form of unsolicited marketing/BULK/SPAM emails to be sent from the service. Therefore, we discourage the delivery of unsolicited bulk messages though Office 365 and advise our <em>Customers who need to send legitimate bulk commercial email (for example, customer newsletters) to use third-party providers that specialize in these services.</em>

In this article my colleague <strong>Alexandru Liviu Nita</strong> and <strong>I</strong> will try to provide guidance on how to choose, deploy and troubleshoot different Relay solutions that can be used with Office 365.

&nbsp;
<h2><strong>Which solution should you choose
</strong></h2>
Office 365 currently supports several methods of SMTP Relay and this article will try to help you choose and implement the appropriate one:
<ul>
 	<li><strong>Client SMTP Submission: </strong>You configure a user, device, or internal line-of-business (LOB) application to send mails as a single SMTP address for a domain you own to Office 365 &amp; Internet recipients</li>
 	<li><strong>Direct Send: </strong>You configure a user, device, or line-of-business (LOB) application to directly send emails to Office 365 recipients</li>
 	<li><strong>SMTP Relay: </strong>You configure a user, device, or line-of-business (LOB) application to send email as multiple senders who may not have Office 365 mailboxes to Office 365 &amp; Internet recipients<strong></strong></li>
</ul>
<table width="855" border="1">
<tbody>
<tr>
<td width="156" style="text-align: left"></td>
<td width="156"><strong>SMTP Client Submission</strong></td>
<td width="150"><strong>Direct Send</strong></td>
<td width="162"><strong>SMTP Relay</strong></td>
</tr>
<tr>
<td width="156"><strong>Features</strong></td>
<td width="156"></td>
<td width="150"></td>
<td width="162"></td>
</tr>
<tr>
<td width="156">Send to recipients in your domain(s)</td>
<td width="156">Yes</td>
<td width="150">Yes</td>
<td width="162">Yes</td>
</tr>
<tr>
<td width="156">Relay to Internet via Office 365</td>
<td width="156">Yes</td>
<td width="150">No. Direct delivery only.</td>
<td width="162">Yes</td>
</tr>
<tr>
<td width="156">Bypasses antispam</td>
<td width="156">Yes, if the mail is destined for an Office 365 mailbox.</td>
<td width="150">No. Suspicious emails might be filtered. We recommend a custom Sender Policy Framework (SPF) record.</td>
<td width="162">No. Suspicious emails might be filtered. We recommend a custom SPF record.</td>
</tr>
<tr>
<td width="156">Supports mail sent from applications hosted by a third party</td>
<td width="156">Yes</td>
<td width="150">No</td>
<td width="162">No</td>
</tr>
<tr>
<td width="156"><strong>Requirements</strong></td>
<td width="156"></td>
<td width="150"></td>
<td width="162"></td>
</tr>
<tr>
<td width="156">Open network port</td>
<td width="156">Port 587 or port 25</td>
<td width="150">Port 25</td>
<td width="162">Port 25</td>
</tr>
<tr>
<td width="156">Office 365 connector required</td>
<td width="156">No</td>
<td width="150">No</td>
<td width="162">Yes</td>
</tr>
<tr>
<td width="156">TLS Support</td>
<td width="156">Required</td>
<td width="150">Recommended</td>
<td width="162">Recommended</td>
</tr>
<tr>
<td width="156">Requires authentication</td>
<td width="156">Office 365 user name and password required</td>
<td width="150">None</td>
<td width="162">Requires unshared static public IP addresses (unless a certificate is used).</td>
</tr>
<tr>
<td width="156"><strong>Limitations</strong></td>
<td width="156"></td>
<td width="150"></td>
<td width="162"></td>
</tr>
<tr>
<td width="156">Throttling limits</td>
<td width="156">10,000 recipients per day. 30 messages per minute.</td>
<td width="150">Standard throttling is in place to protect Office 365.</td>
<td width="162">Reasonable limits are imposed. The service can't be used to send spam or bulk mail. For more information about reasonable limits, see <a href="https://technet.microsoft.com/library/jj200746(v=exchg.150).aspx">High-risk delivery pool for outbound messages</a>.</td>
</tr>
</tbody>
</table>
&nbsp;
<h2><strong>Which changes you need to implement</strong></h2>
<h3><strong> </strong><strong></strong><strong>SMTP Client Submission</strong></h3>
<p style="padding-left: 30px">This is the recommended method for sending emails through Office 365.</p>
<p style="padding-left: 30px">In this implementation, the device or application uses an Exchange Online account to send email to (Office 365 and Internet) recipients just like an email client.</p>
<p style="padding-left: 30px">The sending address must also be either an Exchange Online-licensed user in Office 365 or an alternative email address of an Exchange Online-licensed user. For example, if the address that is used for sending from is printer@tailspintoys.com and the account that is used to relay through is myapps@yourdomain.com (an Office 365 user), then printer@tailspintoys.com must be an alternate email address to <u>myapps@yourdomain.com</u>.</p>
<p style="padding-left: 30px">Starting June 1<sup>st </sup>2018, the following changes will begin rolling out for SMTP Authenticated Submission protocol:</p>
<p style="padding-left: 60px">1. Sent email will now be stored in the Sent Items folder of the mailbox.</p>
<p style="padding-left: 60px">2. Only three concurrent connections to our service per mailbox will be allowed. Additional connections will be rejected with the error: 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded.</p>
<p style="padding-left: 60px"><a href="https://blogs.technet.microsoft.com/exchange/2018/04/20/changes-coming-to-the-smtp-authenticated-submission-client-protocol/">https://blogs.technet.microsoft.com/exchange/2018/04/20/changes-coming-to-the-smtp-authenticated-submission-client-protocol/</a></p>
<p style="padding-left: 30px">If the sending email address doesn't match the login credentials, then 'Send As' permissions are required. Using a single mailbox with Send As permissions for all your users is not supported because of complexity and potential issues.</p>

<h4 style="padding-left: 30px"><strong></strong></h4>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/Overview-for-SMTP-Client-Submission-with-IIS.png"><img width="700" height="334" class="alignnone wp-image-3945" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/Overview-for-SMTP-Client-Submission-with-IIS-1024x488.png" /></a></p>

<h4 style="padding-left: 30px"><strong>Configuration Changes Required</strong></h4>
<p style="padding-left: 60px"><strong>On-premise</strong></p>
<p style="padding-left: 90px">1. Install IIS SMTP server</p>
<p style="padding-left: 90px">2. Configure the outbound connection</p>
<p style="padding-left: 90px">3. Configure IIS authentication</p>
<p style="padding-left: 90px">4. Configure IIS relay restrictions</p>
<p style="padding-left: 90px">5. Configure Delivery Settings</p>
<p style="padding-left: 60px"><strong>Cloud</strong></p>
<p style="padding-left: 90px">No configuration needed (if an existing cloud user is used for authentication)</p>
<p style="padding-left: 60px"><strong>DNS</strong></p>
<p style="padding-left: 90px">No configuration needed</p>
&nbsp;
<h3><strong>Direct Send</strong></h3>
<p style="padding-left: 30px">This is the simplest method to set up as there is no Office 365 configuration needed.</p>
<p style="padding-left: 30px">Use this implementation if the device or application is only sending emails to your own Office 365 users and SMTP Client Submission is not an option.</p>
<p style="padding-left: 30px">Direct Send allows each user in the organization to send emails using their own address. So if you want your device or application to send messages from each user’s email address and do not want multiple user credentials to be configured, Direct Sent should be used.</p>
<p style="padding-left: 30px">Use Direct Send if your device or application does not meet the requirements of SMTP Client Submission, such as TLS support.</p>
<p style="padding-left: 30px">Office 365 does not allow you to send bulk email or newsletters via SMTP Client Submission. Direct Send allows you to send a higher volume of messages. However, there is a risk of your email being marked as spam by Office 365. You might want to enlist the help of a bulk email provider to assist you. There are best practices for bulk email, and bulk email providers can help ensure that your domains and IP addresses are not blocked by others on the Internet.</p>
<p style="padding-left: 30px">Make sure the Outbound Public IP is not listed on SpamHaus or Microsoft Internal lists. In case the IP is listed, delist the IP first or use SMTP Client Submission.</p>

<h4 style="padding-left: 30px"><strong></strong></h4>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/Overview-for-Direct-Send-with-IIS.png"><img width="700" height="276" class="alignnone wp-image-3935" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/Overview-for-Direct-Send-with-IIS-1024x403.png" /></a></p>

<h4 style="padding-left: 30px"><strong>Configuration Changes Required</strong></h4>
<p style="padding-left: 60px"><strong>On-premise</strong></p>
<p style="padding-left: 90px">1. Install IIS SMTP server</p>
<p style="padding-left: 90px">2. Define a remote domain in IIS</p>
<p style="padding-left: 90px">3. Configure the domain to allow relay</p>
<p style="padding-left: 90px">4. Configure the outbound connection</p>
<p style="padding-left: 90px">5. Configure IIS authentication</p>
<p style="padding-left: 90px">6. Configure IIS relay restrictions</p>
<p style="padding-left: 60px"><strong>Cloud</strong></p>
<p style="padding-left: 90px">No configuration needed</p>
<p style="padding-left: 60px"><strong>DNS</strong></p>
<p style="padding-left: 90px">The on-premise IP should to be added to the SPF (ex. v=spf1 ip4:10.5.3.2 include:spf.protection.outlook.com –all)</p>

<h3></h3>
&nbsp;
<h3><strong>SMTP Relay</strong></h3>
<p style="padding-left: 30px">SMTP Relay is very similar to Direct Send except that it can be used to send emails also to external recipients</p>
<p style="padding-left: 30px">SMTP Relay can’t be used to send email directly to Office 365 from a third-party hosted service, such as Microsoft Azure.</p>
<p style="padding-left: 30px">Use this implementation if the device or application will send emails both to internal users and external recipients and SMTP Client Submission is not an option.</p>
<p style="padding-left: 30px">You want your device or application to send from each user’s email address and do not want multiple user credentials to be configured. SMTP Relay allow each user in the organization to send email using their own address.</p>
<p style="padding-left: 30px">Use SMTP Relay if your device or application does not meet the requirements of SMTP Client Submission, such as TLS support.</p>
<p style="padding-left: 30px">Office 365 does not allow you to send bulk email or newsletters via SMTP client submission. SMTP Relay allows you to send a higher volume of messages. However, there is a risk of your email being marked as spam by Office 365. You might want to enlist the help of a bulk email provider to assist you. There are best practices for bulk email, and bulk email providers can help ensure that your domains and IP addresses are not blocked by others on the Internet.</p>
<p style="padding-left: 30px"><span style="float: none;background-color: transparent;color: #333333;cursor: text;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif;font-size: 16px;font-style: normal;font-variant: normal;font-weight: 400;letter-spacing: normal;line-height: 24px;text-align: left;text-decoration: none;text-indent: 0px">Make sure the </span>Outbound Public IP is not listed on SpamHaus or Microsoft Internal lists. In case the IP is listed, delist the IP first or use SMTP Client Submission.</p>
<p style="padding-left: 30px">In case SMTP Relay is configured to use a certificate to send emails through Office 365, the Common-Name (CN) or Subject Alternate Name (SAN) in the certificate should contain a domain name that was registered in Office 365.</p>
<p style="padding-left: 30px"><a href="https://support.microsoft.com/en-us/help/3169958/important-notice-for-office-365-email-customers-who-have-configured-co">https://support.microsoft.com/en-us/help/3169958/important-notice-for-office-365-email-customers-who-have-configured-co</a></p>

<h4 style="padding-left: 30px"><strong></strong></h4>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/Overview-for-SMTP-Relay-with-IIS.png"><img width="700" height="334" class="alignnone wp-image-3925" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/Overview-for-SMTP-Relay-with-IIS-1024x488.png" /></a></p>

<h4 style="padding-left: 30px"><strong>Configuration Changes Required</strong></h4>
<p style="padding-left: 60px"><strong>On-premise</strong></p>
<p style="padding-left: 90px">1. Install IIS SMTP server</p>
<p style="padding-left: 90px">2. Configure IIS to allow relay</p>
<p style="padding-left: 90px">3. Configure the outbound connection</p>
<p style="padding-left: 90px">4. Configure IIS authentication</p>
<p style="padding-left: 90px">5. Configure IIS relay restrictions</p>
<p style="padding-left: 60px"><strong>Cloud</strong></p>
<p style="padding-left: 90px">Create an Inbound On-Premise Type Connector in Exchange Admin Center to authenticate the mail sent from the device or application(https://technet.microsoft.com/en-us/library/dn751020(v=exchg.150).aspx#Anchor_5)</p>
<p style="padding-left: 60px"><strong>DNS</strong></p>
<p style="padding-left: 90px">The on-premise IP should to be added to the SPF record (ex. v=spf1 ip4:10.5.3.2 include:spf.protection.outlook.com –all)</p>
<strong> </strong>
<h2><strong>Which IIS settings you need to configure</strong></h2>
<h3><strong>SMTP Client Submission</strong></h3>
<h4>Relay Restrictions</h4>
<ul>
 	<li>Open IIS 6.0 Manager, right click <strong>Default SMTP Virtual Server</strong>, and then click <strong>Properties</strong>.</li>
 	<li>Click the <strong>Access tab</strong>, and then click <strong>Relay</strong>.</li>
 	<li>In the Select which computers may relay through this virtual server area, click <strong>Only the list below</strong>, and then enter the IP addresses of the on-premises LOB devices and application servers that will relay through the SMTP server</li>
</ul>
<p style="padding-left: 30px"><strong><a href="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Relay-Restrictions.png"><img width="701" height="363" class="alignnone wp-image-4015" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Relay-Restrictions.png" /></a> </strong></p>

<h4>Change Outbound Port</h4>
<ul>
 	<li>Click <strong>Properties </strong>of the SMTP Virtual Server</li>
 	<li>On the <strong>Access</strong> tab, click <strong>Delivery tab, </strong>and<strong> Outbound Connections</strong></li>
 	<li>Change <strong>TCP port </strong>from <strong>25</strong> to <strong>587</strong></li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Change-Outbound-Port.png"><img width="700" height="396" class="alignnone wp-image-3965" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Change-Outbound-Port.png" /></a></p>

<h4>Configure Smart Host</h4>
<ul>
 	<li>Click the <strong>Delivery tab</strong>, click <strong>Advanced</strong></li>
 	<li>Under <strong>Smart host</strong>, enter the fully qualified domain name (FQDN) of the SMTP server of the on-line Exchange mailbox (<strong>smtp.office365.com</strong>).</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Configure-Smart-Host1.png"><img width="700" height="364" class="alignnone wp-image-4055" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Configure-Smart-Host1.png" /></a></p>

<h4>Configure Recipient Domain Options</h4>
1. Configure IIS with SCS (for all domains)
<ul>
 	<li>On the <strong>Delivery tab</strong>, click <strong>Outbound Security</strong></li>
 	<li>Select <strong>Basic Authentication</strong>.</li>
 	<li>In the User name and password boxes enter an Office 365 account (and it’s password)</li>
 	<li>Select the <strong>TLS encryption </strong>check box, and then click OK.</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Configure-Recipient-Domain-Options-1.png"><img width="700" height="359" class="alignnone wp-image-3975" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Configure-Recipient-Domain-Options-1.png" /></a></p>
2. Configure IIS with SCS (for one domain)
<ul>
 	<li>Define a remote domain in IIS:
<ul>
 	<li> In IIS Manager, expand <strong>Default SMTP Virtual Server</strong>, <strong>Domains</strong>.</li>
 	<li><strong>Right-click Domains</strong>, click <strong>New</strong>, click <strong>Domain</strong>, and then click <strong>Remote</strong>.</li>
 	<li>In the <strong>Name</strong> box, type the name of your domain. For example, type yourdomain.com. Then, click <strong>Finish</strong></li>
</ul>
</li>
</ul>
<p style="padding-left: 60px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Configure-Recipient-Domain-Options-2a.png"><img width="700" height="255" class="alignnone wp-image-3985" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Configure-Recipient-Domain-Options-2a-1024x373.png" /></a></p>

<ul>
 	<li>Set the routing settings for yourdomain.com
<ul>
 	<li>Set the routing settings for yourdomain.com</li>
 	<li>In IIS Manager, expand <strong>Default SMTP Virtual Server</strong>, <strong>Domains</strong>.</li>
 	<li><strong>Click Domains</strong>, right-click yourdomain.com, and then click <strong>Properties</strong>.</li>
 	<li>Check <strong>Allow incoming mail to be relayed to this domain</strong>.</li>
 	<li>Set <strong>smtp.office365.com</strong> as the <strong>smart host.</strong></li>
 	<li>Open <strong>Outbound Security </strong>and enter an Exchange Online account credentials.</li>
 	<li>Check <strong>TLS encryption.</strong></li>
</ul>
</li>
</ul>
<p style="padding-left: 60px"><em> <a href="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Configure-Recipient-Domain-Options-2b.png"><img width="700" height="549" class="alignnone wp-image-3995" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/CS-Configure-Recipient-Domain-Options-2b.png" /></a></em></p>
&nbsp;
<h3><strong>SMTP Relay/Direct Send</strong></h3>
<h4>Configure IIS for relaying</h4>
<ul>
 	<li>Click the <strong>Delivery tab</strong>, click <strong>Advanced</strong></li>
 	<li>Under <strong>Smart host</strong>, enter the SMTP end-point for the tenant domain. This will be the MX endpoint for the Office 365 tenant. (i.e <strong>Yourdomain-com.mail.protection.outlook.com</strong>)</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/DS-Configure-IIS-for-relaying.png"><img width="700" height="362" class="alignnone wp-image-4045" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/DS-Configure-IIS-for-relaying.png" /></a></p>

<h4>Configure Relay Restrictions</h4>
<ul>
 	<li>Open IIS 6.0 Manager, right click <strong>Default SMTP Virtual Server</strong>, and then click <strong>Properties</strong>.</li>
 	<li>Click the <strong>Access tab</strong>, and then click <strong>Relay</strong>.</li>
 	<li>In the Select which computers may relay through this virtual server area, click <strong>Only the list below</strong>, and then enter the IP addresses of the on-premises LOB devices and application servers that will relay through the SMTP server</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/DS-Configure-Relay-Restrictions.png"><img width="700" height="363" class="alignnone wp-image-4035" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/DS-Configure-Relay-Restrictions.png" /></a></p>

<h4>Configure Outbound Security</h4>
<ul>
 	<li>On the <strong>Delivery tab</strong>, click <strong>Outbound Security</strong></li>
 	<li>Select <strong>Anonymous</strong>.</li>
 	<li>Select the <strong>TLS encryption </strong>check box, and then click OK.</li>
</ul>
<p style="padding-left: 30px"><a href="https://msdnshared.blob.core.windows.net/media/2018/05/DS-Configure-Outbound-Security.png"><img width="700" height="361" class="alignnone wp-image-4025" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/DS-Configure-Outbound-Security.png" /></a></p>
&nbsp;
<h3><strong>Troubleshoot SMTP Client Submission</strong></h3>
<ul>
 	<li>Test the user name and password by logging on to Outlook Web App (OWA), and try to send a test email to make sure the account is not blocked</li>
</ul>
<p style="padding-left: 30px">In case “550 5.1.8 Bad outbound sender” error is received, delist the user form the Action Center (<a href="https://technet.microsoft.com/en-gb/library/dn458545(v=exchg.150).aspx">https://technet.microsoft.com/en-gb/library/dn458545(v=exchg.150).aspx</a>)</p>

<ul>
 	<li>Check TCP Configuration (IP, DNS Server and Gateway) on the IIS Server.</li>
 	<li>Test Office 365 connectivity from the IIS Server:
<ul>
 	<li>Enable the Telnet Client tool on the IIS Server. (https://social.technet.microsoft.com/wiki/contents/articles/22715.how-to-enable-telnet-in-windows-server-2012.aspx)</li>
 	<li>Run the tool from the command line by typing <strong>telnet</strong></li>
 	<li>Type <strong>open smtp.office365.com 587</strong> (or substitute 25 for 587 if that port is instead used).</li>
 	<li>If you connected successfully to an Office 365 server, expect to receive a response line similar to this: 220 DB3PR08CA0008.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 18 Apr 2016 06:22:08 +0000</li>
 	<li>If the connection is not successful, then the network firewall or Internet Service Provider (ISP) may block port 587 or 25. Correct this to be able send email from IIS</li>
 	<li>If the response does not contain ‘outlook.office365.com Microsoft ESMTP MAIL Service’ check firewall configuration</li>
 	<li> Type <strong>ehlo yourdomain.com</strong> and then <strong>starttls</strong> and check for the following response 220 2.0.0 SMTP server ready</li>
</ul>
</li>
 	<li>Use PowerShell to send an email:
<ul>
 	<li>Open PowerShell and run $PSVersionTable</li>
 	<li>Make sure PSVersion is at least 3.0</li>
 	<li>Run the following command and enter the User and the Password used by the IIS: <strong>$O365Sender = Get-Credential</strong></li>
 	<li>Run the following command to add a recipient: <strong>$O365Recipient = Read-Host 'Please type the Email address of the recipient‘</strong></li>
 	<li>Depending of the port use run the right command to send an email:</li>
</ul>
</li>
</ul>
<p style="padding-left: 60px"><strong>$d=date; Send-mailmessage -to $O365Recipient -from $O365Sender.UserName -smtpserver smtp.office365.com -subject "SMTP - Client submission - 25" -body "This is the body of test message. The message was sent on: $d " -Credential $O365Sender -UseSsl -BodyAsHtml -port 25; write-host "Sending Message...</strong></p>
<p style="padding-left: 60px"><strong>$d=date; Send-mailmessage -to $O365Recipient -from $O365Sender.UserName -smtpserver smtp.office365.com -subject "SMTP - Client submission - 587" -body "This is the body of test message. The message was sent on: $d " -Credential $O365Sender -UseSsl -BodyAsHtml -port 587; write-host "Sending Message..."</strong></p>
<p style="padding-left: 60px">If you want to test with your own content you can use the following commands:</p>
<p style="padding-left: 60px"><strong>$Path=[Environment]::GetFolderPath("Desktop")</strong>
<strong>$BodyFile = "$Path\content.htm"</strong>
<strong>$File = Get-Content $BodyFile -Encoding UTF8 </strong>
<strong>$Body = $File | Out-String </strong>
<strong>$d=date; Send-mailmessage -to $O365Recipient -from $O365Sender.UserName -smtpserver smtp.office365.com -subject "SMTP - Client submission - 587" -body $([string] $body) -Credential $O365Sender -UseSsl -BodyAsHtml -port 587; write-host "Sending Message..."</strong></p>
&nbsp;
<h3><strong>Troubleshoot Direct Send</strong></h3>
<ul>
 	<li>Emails send from the device are marked as junk by Office 365
<ul>
 	<li>Make sure the IP is added to the SPF record</li>
 	<li>Check if empty messages are also marked as spam</li>
</ul>
</li>
 	<li>Emails are not sent to recipients who are not in the same organization
<ul>
 	<li>By design. Use SMTP Relay instead</li>
</ul>
</li>
 	<li>Test Office 365 connectivity from the network:
<ul>
 	<li>Determine the MX endpoint for the Office 365 tenant, which ends with "mail.protection.outlook.com."  (https://support.office.com/en-us/article/Gather-the-information-you-need-to-create-Office-365-DNS-records-77F90D4A-DC7F-4F09-8972-C1B03EA85A67#ID0EAADAAA=Step_2)</li>
 	<li>Enable the Telnet Client tool on the IIS Server. (<a href="https://social.technet.microsoft.com/wiki/contents/articles/22715.how-to-enable-telnet-in-windows-server-2012.aspx">https://social.technet.microsoft.com/wiki/contents/articles/22715.how-to-enable-telnet-in-windows-server-2012.aspx</a>)</li>
 	<li>Run the tool from the command line by typing telnet</li>
 	<li>Type <strong>open yourdomain-com.mail.protection.outlook.com 25 </strong>(where yourdomain-com.mail.protection.outlook.com is the MX endpoint determined at the first step)</li>
 	<li>If you connected successfully to an Office 365 server, expect to receive a response line similar to this: 220 BN1BFFO11FD038.mail.protection.outlook.com Microsoft ESMTP MAIL Service ready at Mon, 18 Apr 2016 07:36:51 +0000</li>
 	<li>If the connection is not successful, then the network firewall or Internet Service Provider (ISP) may block port 25. Correct this to be able send email from IIS Server</li>
 	<li>If the response does not contain ‘mail.protection.outlook.com Microsoft ESMTP MAIL Service’ check firewall configuration</li>
 	<li>Type the following command: <strong>EHLO yourdomain.com</strong>, and then press Enter. You should receive the following response:</li>
</ul>
</li>
</ul>
<p style="padding-left: 90px">250-DB3FFO11FD036.mail.protection.outlook.com Hello [IP address]</p>
<p style="padding-left: 90px">250-SIZE 157286400</p>
<p style="padding-left: 90px">250-PIPELINING</p>
<p style="padding-left: 90px">250-DSN</p>
<p style="padding-left: 90px">250-ENHANCEDSTATUSCODES</p>
<p style="padding-left: 90px">250-STARTTLS</p>
<p style="padding-left: 90px">250-8BITMIME</p>
<p style="padding-left: 90px">250-BINARYMIME</p>
<p style="padding-left: 90px">250 CHUNKING</p>

<ul>
 	<li style="list-style-type: none">
<ul>
 	<li>Type the following command using the correct sender address: <strong>mail from: sender@yourdomain.com</strong>, and then press Enter. You should receive the following response: 250 2.1.0 Sender OK</li>
 	<li>Type the following command using the correct recipient address: <strong>rcpt to: recipient@yourdomain.com</strong>, and then press Enter. You should receive the following response: 250 2.1.5 Recipient OK</li>
 	<li>In case the following error is generated "<strong>5.7.1 Service unavailable, Client host [IP address] blocked using Spamhaus. To request removal from this list see <a href="https://www.spamhaus.org/lookup.lasso">https://www.spamhaus.org/lookup.lasso</a> (AS16012612)</strong>", you need to delist the IP address.</li>
 	<li>In case either of the following errors are generated:
<ul>
 	<li style="list-style-type: none">
<ul>
 	<li><strong> </strong><strong>550 5.7.1 Service unavailable; Client host [IP address] blocked using FBLW15; To request removal from this list please forward this message to <u>delist@messaging.microsoft.com</u></strong></li>
 	<li><strong> </strong><strong>550 5.7.606-649 Access denied, banned sending IP [IP address]; To request removal from this list please visit https://sender.office.com/ and follow the directions. For more information please go to <a href="https://go.microsoft.com/fwlink/?LinkID=526653">https://go.microsoft.com/fwlink/?LinkID=526653</a>.</strong></li>
 	<li>You will need to delist the IP address from : <a href="https://sender.office.com/">https://sender.office.com</a></li>
</ul>
</li>
</ul>
</li>
 	<li>In case the following error is generated “<strong>550 5.7.64 TenantAttribution; Relay Access Denied</strong>” make sure that the recipient is the same organization.</li>
 	<li>Type the following command: <strong>DATA</strong>, and then press Enter. You should receive the following response: 354 Start mail input; end with &lt;CRLF&gt;.&lt;CRLF&gt;</li>
 	<li>Type the following command: <strong>Subject: Telnet test message</strong> and Press Enter two times</li>
 	<li>Type a period (<strong>.</strong>) at the next blank line, and then press Enter. You should receive the following response: 250 OK.</li>
 	<li>Confirm with the recipient that the email was received.</li>
</ul>
</li>
 	<li>If you want to test with your own content you can use the following PowerShell commands:</li>
</ul>
<p style="padding-left: 60px"><strong>$Path=[Environment]::GetFolderPath("Desktop")</strong>
<strong>$BodyFile = "$Path\content.htm"</strong>
<strong>$File = Get-Content $BodyFile -Encoding UTF8 </strong>
<strong>$Body = $File | Out-String </strong>
<strong>$O365Sender = Read-Host 'Please type the Email address of the sender‘</strong>
<strong>$O365Recipient = Read-Host 'Please type the Email address of the recipient‘</strong>
<strong>$d=date; Send-mailmessage -to $O365Recipient -from $O365Sender -smtpserver yourdomain-com.mail.protection.outlook.com -subject "SMTP - Direct Send - 25" -body $([string] $body) -BodyAsHtml -port 25;write-host "Current date is $d; Sending Message..."</strong></p>
&nbsp;
<h3><strong>Troubleshoot SMTP Relay</strong></h3>
<ul>
 	<li>Emails send from the device are marked as junk by Office 365</li>
 	<li>Make sure the IP is added to the SPF record</li>
 	<li>Test Office 365 connectivity from the network:
<ul>
 	<li>Determine the MX endpoint for the Office 365 tenant, which ends with "mail.protection.outlook.com."  (https://support.office.com/en-us/article/Gather-the-information-you-need-to-create-Office-365-DNS-records-77F90D4A-DC7F-4F09-8972-C1B03EA85A67#ID0EAADAAA=Step_2)</li>
 	<li>Enable the Telnet Client tool on the IIS Server. (<a href="https://social.technet.microsoft.com/wiki/contents/articles/22715.how-to-enable-telnet-in-windows-server-2012.aspx">https://social.technet.microsoft.com/wiki/contents/articles/22715.how-to-enable-telnet-in-windows-server-2012.aspx</a>)</li>
 	<li>Run the tool from the command line by typing <strong>telnet</strong></li>
 	<li>Type <strong>open yourdomain-com.mail.protection.outlook.com 25 </strong>(where yourdomain-com.mail.protection.outlook.com is the MX endpoint determined at the first step)</li>
 	<li>If you connected successfully to an Office 365 server, expect to receive a response line similar to this: 220 BN1BFFO11FD038.mail.protection.outlook.com Microsoft ESMTP MAIL Service ready at Mon, 18 Apr 2016 07:36:51 +0000</li>
 	<li>If the connection is not successful, then the network firewall or Internet Service Provider (ISP) might have blocked port 25. Correct this to be able send email from your organization</li>
 	<li>If the response does not contain ‘mail.protection.outlook.com Microsoft ESMTP MAIL Service’ check firewall configuration</li>
 	<li>Type the following command: <strong>EHLO yourdomain.com</strong>, and then press Enter. You should receive the following response:</li>
</ul>
</li>
</ul>
<p style="padding-left: 90px">250-DB3FFO11FD036.mail.protection.outlook.com Hello [IP address]</p>
<p style="padding-left: 90px">250-SIZE 157286400</p>
<p style="padding-left: 90px">250-PIPELINING</p>
<p style="padding-left: 90px">250-DSN</p>
<p style="padding-left: 90px">250-ENHANCEDSTATUSCODES</p>
<p style="padding-left: 90px">250-STARTTLS</p>
<p style="padding-left: 90px">250-8BITMIME</p>
<p style="padding-left: 90px">250-BINARYMIME</p>
<p style="padding-left: 90px">250 CHUNKING</p>

<ul>
 	<li style="list-style-type: none">
<ul>
 	<li>Type the following command using the correct sender address: <strong>mail from: sender@yourdomain.com</strong>, and then press Enter. You should receive the following response: 250 2.1.0 Sender OK</li>
 	<li>Type the following command using the correct recipient address: <strong>rcpt to: recipient@yourdomain.com</strong>, and then press Enter. You should receive the following response: 250 2.1.5 Recipient OK</li>
 	<li>In case the following error is generated "<strong>5.7.1 Service unavailable, Client host [IP address] blocked using Spamhaus. To request removal from this list see <a href="https://www.spamhaus.org/lookup.lasso">https://www.spamhaus.org/lookup.lasso</a> (AS16012612)</strong>", you need to delist the IP address.</li>
 	<li>In case either of the following errors are generated:
<ul>
 	<li><strong> </strong><strong>550 5.7.1 Service unavailable; Client host [IP address] blocked using FBLW15; To request removal from this list please forward this message to <u>delist@messaging.microsoft.com</u></strong></li>
 	<li><strong> </strong><strong>550 5.7.606-649 Access denied, banned sending IP [IP address]; To request removal from this list please visit https://sender.office.com/ and follow the directions. For more information please go to <a href="https://go.microsoft.com/fwlink/?LinkID=526653">https://go.microsoft.com/fwlink/?LinkID=526653</a>.</strong></li>
 	<li>You will need to delist the IP address from : <a href="https://sender.office.com/">https://sender.office.com</a></li>
</ul>
</li>
 	<li>In case the following error is generated “<strong>550 5.7.64 TenantAttribution; Relay Access Denied</strong>” make sure that the cloud connector has the correct IP(If an IP scoped connector is used). The IP can be seen in the output: “250-DB3FFO11FD036.mail.protection.outlook.com Hello [IP address]</li>
 	<li>Type the following command: <strong>DATA</strong>, and then press Enter. You should receive the following response: 354 Start mail input; end with &lt;CRLF&gt;.&lt;CRLF&gt;</li>
 	<li>Type the following command: <strong>Subject: Telnet test message</strong> and Press Enter two times.</li>
 	<li>Type a period (<strong>.</strong>) at the next blank line, and then press Enter. You should receive the following response: 250 OK.</li>
 	<li>Check with the recipient if the email was received.</li>
</ul>
</li>
 	<li>If you want to test with your own content you can use the following PowerShell commands:</li>
</ul>
<p style="padding-left: 60px"><strong>$Path=[Environment]::GetFolderPath("Desktop")</strong>
<strong>$BodyFile = "$Path\content.htm"</strong>
<strong>$File = Get-Content $BodyFile -Encoding UTF8 </strong>
<strong>$Body = $File | Out-String </strong>
<strong>$O365Sender = Read-Host 'Please type the Email address of the sender‘</strong>
<strong>$O365Recipient = Read-Host 'Please type the Email address of the recipient‘</strong>
<strong>$d=date; Send-mailmessage -to $O365Recipient -from $O365Sender -smtpserver yourdomain-com.mail.protection.outlook.com -subject "SMTP - SMTP Relay- 25" -body $([string] $body) -BodyAsHtml -port 25;write-host "Current date is $d; Sending Message..."</strong></p>
&nbsp;
<h3><strong>IIS Specific Troubleshooting</strong></h3>
<ul>
 	<li>Make sure that IIS uses the correct certificate (in case the inbound connector uses certificate)
<ul>
 	<li>Confirm that only the certificate to be used by the SMTP server is in the Local_Machine\Personal certificates repository. Additional certificates can be added later.</li>
 	<li>Confirm that the fully qualified domain name (FQDN) that’s configured under the SMTP Virtual Server properties matches the certificate's subject name.</li>
 	<li>Configure the FQDN of the SMTP Virtual Server. Confirm that the certificate is found by the SMTP service. To do this, follow these steps:
<ul>
 	<li>Locate <strong>SMTP Virtual Server Properties</strong>.</li>
 	<li>On the <strong>Delivery</strong> tab, click <strong>Advanced</strong>, and then type the FQDN in the <strong>Fully-qualified domain name</strong> box.</li>
 	<li>Restart the SMTP service</li>
</ul>
</li>
 	<li>Confirm that the certificate is found by the SMTP service. To do this, follow these steps:
<ul>
 	<li>Locate <strong>SMTP Virtual Server Properties</strong>.</li>
 	<li>On the <strong>Access</strong> tab, the <strong>Secure communications</strong> section should display the following:  A TLS certificate is found with expiration date: day/month/year.</li>
 	<li>Compare the shown date with the actual certificate expiration date.</li>
</ul>
</li>
</ul>
</li>
 	<li>Enable SMTP Logs:
<ul>
 	<li>Internet Information Service (IIS) Manager. Right click "<strong>Default SMTP Virtual Server</strong>" and choose "<strong>Properties</strong>". Check "<strong>Enable logging</strong>“</li>
 	<li>Click "<strong>Properties ...</strong>" to check all options.</li>
</ul>
</li>
 	<li>On the IIS server run a telnet test (<strong>telnet localhost 25</strong>)</li>
 	<li>Test outbound mail flow with a file in the Pickup folder
<ul>
 	<li>Create the file using a text editor such as Microsoft Notepad, and then type the message information into the file. Example:
from:testuser@internaldomain.com
to:tbill@externaldomainname.com
subject:This is a test.
this is a test.</li>
 	<li><span style="text-decoration: underline"></span><span style="text-decoration: underline"></span><span style="text-decoration: underline"></span>Save the file without an extension to c:\Inetpub\mailroot\Pickup\ do so in Notepad, insert quotation marks (" ") around the file name, and then save the file. When the file name includes quotation marks, Notepad saves the document as a .txt file by default. The name of the file is irrelevant, you can name the file to suit your needs.</li>
 	<li>If the configuration of the SMTP service is correct, the message is delivered to the e-mail address in the "to" line in the .txt file. If the file is stuck in the Queue folder or present in the Badmail folder, there is a problem with the SMTP service configuration.</li>
 	<li>Check c:\Inetpub\mailroot\Badmail
<ul>
 	<li>Emails that could not be delivered to the intended recipient are left in the Badmail folder</li>
 	<li>Common causes of messages ending up in the Badmail folder are incorrect or invalid email addresses and DNS issues</li>
 	<li>Open the .bad file for more details</li>
</ul>
</li>
 	<li>Check SMTP Logs
<ul>
 	<li>Check the SMTP log files at C:\WINDOWS\system32\LogFiles\SMTPSVC1</li>
 	<li>Check for any error on email submission.</li>
</ul>
</li>
</ul>
</li>
 	<li>This is a simple set of PowerShell commands that may help you, as it will export the IIS logs to a csv file:</li>
</ul>
<p style="padding-left: 60px">$ts = Get-Date -Format yyyyMMdd_hhmmss;
$Path=[Environment]::GetFolderPath("Desktop")
$StartDate = [DateTime]::Today.AddDays(-1)
$EndDate = [DateTime]::now
$IISLogsFolder = "C:\Windows\System32\LogFiles\SMTPSVC1"
$IISFiles = Get-ChildItem $IISLogsFolder\*.log |Where-Object {($_.CreationTime -gt $StartDate) -and ($_.CreationTime -lt $EndDate)}
$IISLogsT1 = Get-Content $IISFiles
$IISLogsT2 =$IISLogsT1 | where {$_ -notLike "#[D,S-V]*" }
$IISLogsT2[0] = $IISLogsT2[0] -Replace '#Fields: ', ''
$IISLogs = $IISLogsT2 | where {$_ -notLike "#[F]*" }
$IISLogsOut = $IISLogs | Where {($_ -like "*OutboundConnection*") -or ($_ -like "*computer*")}
$IISLogs | ConvertFrom-Csv -Delimiter ' ' |Export-Csv $Path\$ts.IISLogs.csv -NoTypeInformation
$IISLogsOut | ConvertFrom-Csv -Delimiter ' ' |Export-Csv $Path\$ts.IISLogs_OutboundConnections.csv -NoTypeInformation</p>
&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Email Encryption in Office 365</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/email-encryption-in-office-365</link>
      <pubDate>Mon, 14 May 2018 18:25:51 GMT</pubDate>
      <dc:creator><![CDATA[Manuel Alex Pereira]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3755</guid>
      <description><![CDATA[&nbsp;
In current times to be compliant with secure data and access, companies are challenged day...]]></description>
      <content:encoded><![CDATA[<a href="https://msdnshared.blob.core.windows.net/media/2018/05/Header1.png"><img width="1845" height="218" class="alignnone size-full wp-image-3775" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/Header1.png" /></a>
&nbsp;
<p align="center"><span style="margin: 0px;line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10pt"><span style="color: #000000">In current times to be compliant with secure data and access, companies are challenged day by day to the possible threat of information leakage. </span></span></p>
<p align="center"><span style="margin: 0px;line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10pt"><span style="color: #000000">And sharing the data, although often necessary for work projects, also needs to be secured.</span></span></p>
<span style="margin: 0px;line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10pt"><span style="color: #000000"> </span></span>
<span style="margin: 0px;line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10pt"><span style="color: #000000">Encryption is the most effective way to achieve data security. Encryption is the process of encoding a message or information making it restricted for specific people. To read an encrypted file, you must have access to a secret key or password that enables you to decrypt it. In other words, a “permission”. In an IT perspective, data encryption translates data into another form, or code, so that only people with said access can read it.</span></span>

<span style="margin: 0px;line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10pt"><span style="color: #000000">How does this relate to Office 365? Compliance is an on-going process and a shared responsibility. Data Loss can be a loss of a deal to the competition; Leak of the company’s customer data; Internal procedures and or legal related cases; Company user's private data; Etc. And most of the time, it will affect the company negatively in one way or the other.</span></span>

<span style="margin: 0px;line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10pt"><span style="color: #000000">Azure Information Protection (AIP) is cloud service which purpose is to allow an organization to classify, label, and protect its documents and emails in compliance with private data. Rules and conditions can be defined either by an administrator or, users if allowed.</span></span>

<span style="margin: 0px;line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10pt;margin-bottom: -7%"><span style="color: #000000">Azure Rights Management Services (RMS) is a Microsoft security tool that provides persistent data protection by enforcing data access policies (also known as Templates). Together with encryption, these authorization policies are what allows the cloud-based service to help secure files and emails, working across a variety of devices - phones, tablets, and PCs. Information can be protected even outside an organization because that protection remains attached to data, even when it leaves an organization’s boundaries. As a very simple example:</span></span>

<table width="100%" border="1">
<tbody>
<tr>
<td>
<p class="MsoNormal" style="margin-left: .01in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> (…) employees might email a document to a partner company or, save a document to their cloud drive. The persistent protection that Azure RMS provides not only helps to secure your company data, but might also be legally mandated for compliance, legal discovery requirements, or simply for good information management practices. (…)
</span></p>
<p align="right" class="MsoNormal" style="margin-bottom: .0001pt;text-align: right;line-height: normal"><a href="https://docs.microsoft.com/en-us/azure/information-protection/understand-explore/what-is-azure-rms"><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">https://docs.microsoft.com/en-us/azure/information-protection/understand-explore/what-is-azure-rms</span></em></a><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt;color: #282828"> </span></em></p>
<strong><em><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">Note:</span></em></strong><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt"> Keep in mind that users with access can still take a photo with their cell phones or take notes of the information that they see on their computers, where the file is protected.</span></em></td>
</tr>
</tbody>
</table>

<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">
</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">AIP protection technology makes use of Azure RMS encryption, access policies and identity. These policies or Templates stay with the documents even when they leave the organization. So, how does it integrate with Exchange? Through Information Rights Management (IRM), which is the RMS enabled Application for Exchange. IRM is the component in the RMS-enabled application that enforces said rights on Exchange Online or SharePoint Online.   </span></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white">In the Beginning…</span></strong><strong><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333"> </span></strong></p>
<p class="MsoNormal" style="margin-left: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #222222">Rights management started as an add-on to the windows server. On premises, the service has the name of Active Directory Rights Management (or AD RMS for short) and encryption features were allowed for integrate with Exchange Server (2010 onwards), SharePoint and Windows File Server Resource Manager under the name of Information Rights Management (or IRM). At the time, only Office files were supported for the service.   </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white">How does it Work</span></strong><strong><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333"> </span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white">Simply put, a file or email is encrypted by getting a publishing license from the RMS service. When the user accesses their mail client (web or desktop client) and tries to see the RMS Templates, Exchange’s IRM would query RMS which in turn would query the Active Directory to see if the user has permission.</span></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white"> </span></strong></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><strong><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white">Going to cloud:</span></em></strong><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white"> </span></strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white">With the need of service integration, flexibility and remote access, disaster recovery, collaboration (between same or different companies), document control and security (among others) for companies, Microsoft released a cloud solution and subscription-based service in June 2011 (i.e. Office 365) which only allowed for integration with on-premises (AD RMS) encryption service for exchange online at the time.</span></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white">Later in 2013 Azure RMS was released, making use of the Azure Active Directory, associated with the Office 365 directory. Azure RMS would allow integration with the on-premises solutions, allowing for customers already using the service on premises (with respective templates and permissions) to be able to use them in Azure RMS for the cloud-based users as well.</span></p>
<p class="MsoNormal" style="margin: 12.0pt 0in .0001pt 0in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">As an example, IRM is to RMS what Microsoft Office Outlook is to Exchange. </span></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">“Ok, Azure RMS and IRM. But what About OME?”</span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">OME stands for “Office Message Encryption” and started as an Office integration with document protection. OME is currently the external “branding” part of the IRM as it is tightly integrated with it and with document protection (email attachments). OME also evolved, allowing company marketing on Exchange’s encrypted emails across different organizations.</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white"> </span></strong></p>
<p class="MsoNormal" style="margin-bottom: .0001pt"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">Cloud Services features and integration with Exchange Online:</span></strong></p>
<p class="MsoNormal"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">Azure RMS divides into Labeling/Classification and Protection. To explain the “Azure Protection” evolution on Exchange Online, we need to consider that, when on cloud, Azure RMS had several builds, initially similar to the On-premises solutions, but with its own “cloud” properties. We can presently consider two main versions of Azure RMS, Version 2 being the most recent.</span></p>
<p class="MsoNormal" style="margin-top: 12.0pt"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">Currently, version 2 holds a lot of the main features with more security policies features, more device and OS compatibility and more customizations. </span></p>
<p class="MsoNormal" style="margin: 12.0pt 0in .0001pt 0in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">Still, there are some differences that an Exchange Administrator should consider when deploying, specially, if the organization had the system previously enabled (or even an On-premises deployment in Hybrid Environments):</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> </span></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white"> </span></strong></p>
<ul>
 	<li><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">With Azure RMS on Exchange Online, email encryption improved considerably, both in terms of user use as admin control:</span></li>
</ul>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">-Besides licensing, Version 2 activation requires only one action (either on portal or via powershell:</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">            <strong><em>Set-IrmConfiguration -AzureRMSLicensingEnabled $True -InternalLicensingEnable $True</em></strong>)</span></p>
<p class="MsoNormal" style="text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">            </span><strong><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">NOTE:</span></strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt"> Version 1 would require more configuration steps on PowerShell (like importing the “trusted published domain” (TPD) policy and setting service location)</span></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">-On version 2, to update template permissions/settings, you just save changes on Azure portal to update (“Publish” button no longer used, as templates are published automatically when saving)</span></p>
<p class="MsoNormal" style="margin-left: .5in"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">               NOTE:</span></strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt"> Version 1 required having to re-import the TPD each time changes were made to the templates</span></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">-Version 2 is compatible with version 1 if it has been set*. If this isn’t true, actions like “Apply previous Version of OME” on a transport rule in Exchange Online will not work</span></p>
<p class="MsoNormal" style="margin-left: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">              *<strong>Important:</strong> The only version 1 templates that will not work with version 2 are the “Scoped Templates”. Version 2’s scope policies are defined in the main portal,                    not on the template.</span></p>
<p class="MsoNormal" style="margin-left: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">-Version 2 also improved by being compatible with more email providers, not only Outlook.com or Hotmail.com but also with gmail, yahoo, etc.</span></p>

<ul>
 	<li><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">The next topic to approach is licensing. Licenses in Office 365 contain plans, and these are essential for the services to work properly. Azure Information Protection is no different, as there are certain features that depend on the plan. </span></li>
</ul>
<p class="MsoNormal" style="margin-left: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">            For the service to work, according to Azure Information Protection Documentation:</span>
<ul></ul>
<table width="100%" border="1">
<tbody>
<tr>
<td>
<p class="MsoNormal"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;margin-left: .01in">“(…) To use this data protection solution, your organization must have a service plan that includes the Azure Rights Management service from Azure Information Protection. Without this, the Azure Rights Management service cannot be activated. You must have one of the following:</span></p>
<p class="MsoNormal" style="text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">                        An Azure Information Protection plan</span></p>
<p class="MsoNormal" style="text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">                        An Office 365 plan that includes Rights Management (E3 and up)”</span></p>
</td>
</tr>
</tbody>
</table>

<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">
</span></p>

<p class="MsoNormal" style="margin-left: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> Regarding Exchange Online, E3 contains the “Azure Rights Management” plan, which grants access to Azure RMS protection features, like email or document encryption. For the labeling or other specific features, an Azure Information Plan (it can be plan 1 or plan 2, depending on Feature) is needed.</span>
<span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">You can verify each plan features via the link </span><a href="https://azure.microsoft.com/en-us/pricing/details/information-protection/"><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">https://azure.microsoft.com/en-us/pricing/details/information-protection/</span></em></a><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt"> </span></em></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> </span></p>
<table width="100%" border="1">
<tbody>
<tr>
<td>
<p class="MsoNormal" style="margin-bottom: .0001pt"><strong><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;margin-left: .01in">Very Important:</span></strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> “(…) Some Azure Information Protection features require a subscription to Office 365 ProPlus, which is not included with Office 365 Business Essentials, Office 365 Business Premium, Office 365 Enterprise E1, Office 365 Education, or Office 365 Enterprise F1.” </span></p>
&nbsp;
<p style="text-align: right"><span style="line-height: 107%;font-family: 'Calibri',sans-serif;font-size: 11.0pt"><a href="https://technet.microsoft.com/library/exchange-online-service-description.aspx"><em><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">https://technet.microsoft.com/library/exchange-online-service-description.aspx</span></em></a> </span></p>
</td>
</tr>
</tbody>
</table>

<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> </span></p>
<ul>
 	<li><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">On Premises, Azure Information Protection Offers two solutions in case of Hybrid Deployments:</span></li>
</ul>
<p class="MsoNormal" style="margin-left: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> If you have an AD RMS on premises, you can migrate your templates to Azure RMS, making them accessible to cloud users. You can also choose to manage your key or have Microsoft manage it.</span>
<span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">You can check it on </span><a href="https://docs.microsoft.com/en-us/azure/information-protection/get-started/requirements-servers"><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">https://docs.microsoft.com/en-us/azure/information-protection/get-started/requirements-servers</span></em></a><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt"> </span></em></p>
<p class="MsoNormal" style="margin-left: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> Alternately, customers not having an AD RMS on premises can still use Azure Information Protection by deploying the Azure RMS Connector (keep in mind that the connector should not be installed in a computer which has IIS services installed and configured on it, like a web app for example).</span>
<span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">More information on </span><a href="https://docs.microsoft.com/en-us/azure/information-protection/deploy-use/deploy-rms-connector"><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">https://docs.microsoft.com/en-us/azure/information-protection/deploy-use/deploy-rms-connector</span></em></a><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 8.0pt"> </span></em></p>
<p class="MsoNormal" style="margin-left: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> These options will extend some Azure RMS features to Exchange on premises servers, although with some limitations. </span></p>
<table width="100%" border="1">
<tbody>
<tr>
<td><strong><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">Note:</span></strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> </span><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">Currently, on premises OWA users do not have access to the “Protect” option as Exchange Online OWA users. They are still able to open encrypted messages but, for version 2 template selection, they should use Outlook Client with Azure Information Protection Tool installed. This is one of said examples.</span></td>
</tr>
</tbody>
</table>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">
</span></p>
<span style="line-height: 100%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">Not less important, here are some additional considerations in Exchange:</span>
<p class="MsoNormal" style="text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">-Keep in mind that RMS protected emails need to be taken into consideration when performing context search or eDiscovery</span></p>
<p class="MsoNormal" style="text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">-The “Do Not Forward” and “Encrypt” templates are policies that come from Exchange Online side when IRM is enabled. </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">These are not directly managed by the Azure Information Protection</span></p>
<p class="MsoNormal" style="text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">-On OWA, email protection is applied via the “Protect” button</span></p>
<p class="MsoNormal" style="text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">-For Outlook, The Azure Information Protection tool installation is needed to be able to have the “Protect” icon</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">-Currently, Outlook does not support the “Encrypt” template which can only be opened in OWA. </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">If an email with this template is received, Outlook will open the message on OWA automatically</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">            </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">
<p class="MsoNormal" style="margin-bottom: .0001pt"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">For assistance on configuring the services, there is a script made by Microsoft's Exchange Escalation Team which can be used:</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt"><em><span style="line-height: 107%;font-family: 'Segoe UI',sans-serif;font-size: 8.0pt">(Credit to my colleagues Daniel and Victor): </span></em><a href="https://blogs.technet.microsoft.com/exovoice/2018/02/26/office-message-encryption-configuration-and-troubleshooting/"><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">https://blogs.technet.microsoft.com/exovoice/2018/02/26/office-message-encryption-configuration-and-troubleshooting/</span></em></a><em><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt"> </span></em></p>
<p class="MsoNormal" style="margin-bottom: .0001pt;text-indent: .5in"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">            </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt"><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt">In conclusion, in Exchange Online when the user accesses their mail client (web or desktop client) and tries to see the RMS Templates, Exchange’s IRM will query RMS which in turn would query Azure Active Directory to see if the user has permission or is within the RMS template scope, which gives the user permissions to use it or to decrypt it. It’s the policy within the file that it’s queried, not the content.
Exchange Online and Azure RMS integration has brought Organization control to help secure email messages, documents, and sensitive data that is shared outside company walls.</span></p>
<p class="MsoNormal" style="margin: 0in 0in .0001pt .5in"><strong><span style="font-family: 'Segoe UI',sans-serif;font-size: 10.0pt;color: #333333;background: white"> </span></strong></p>
<a href="https://msdnshared.blob.core.windows.net/media/2018/05/Footer2.png"><img width="1845" height="218" class="alignnone size-full wp-image-3865" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/05/Footer2.png" /></a></td>
</tr>
</tbody>
</table>]]></content:encoded>
    </item>
    <item>
      <title>How to copy single items from one mailbox to another by using EWS Editor</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/how-to-copy-single-items-from-one-mailbox-to-another-by-using-ews-editor</link>
      <pubDate>Wed, 18 Apr 2018 16:10:17 GMT</pubDate>
      <dc:creator><![CDATA[Silvia Marinova]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3645</guid>
      <description><![CDATA[Imagine that you need to need to copy particular mailbox items (such as - mails, contacts, notes,...]]></description>
      <content:encoded><![CDATA[Imagine that you need to need to copy particular mailbox items (such as - mails, contacts, notes, etc.)  from one mailbox to another but you can’t export a .PST file because your organization doesn’t use Outlook and you can’t forward such objects to their new destination.

An easy way for you to do so as administrator would be to use <strong>EWS Editor. </strong>You can manage various items as I’ve mentioned above – all you have to do is navigate to the folder containing them, identify the items and perform the desired actions.

&nbsp;

<strong>The steps below describe how to copy single calendar items from one mailbox to another. </strong>

&nbsp;

First thing’s first – we need to have permissions over the mailbox objects which we will be handing. Easiest way to get them is to use impersonation.

&nbsp;

How to assign impersonation permissions:

&nbsp;

<a href="https://msdn.microsoft.com/en-us/library/office/bb204095%28v=exchg.140%29.aspx?f=255&amp;MSPPError=-2147217396">https://msdn.microsoft.com/en-us/library/office/bb204095%28v=exchg.140%29.aspx?f=255&amp;MSPPError=-2147217396</a>

&nbsp;

If you are an Exchange Online customer, you need to connect to the service through PowerShell and execute the cmdlet below:

&nbsp;

<strong>New-ManagementRoleAssignment –Name:impersonationAssignmentName –Role:ApplicationImpersonation –User:ACCOUNT</strong>

&nbsp;

<strong></strong>

&nbsp;

Ensure that you have the permissions:

&nbsp;

<strong>Get-ManagementRoleAssignment –Role:ApplicationImpersonation</strong>

&nbsp;

After you have the rights to impersonate the mailbox objects, you can copy the data. Below you will see a step by step guide on how to do this by using the <strong>EWS Editor</strong> tool.
<ol>
 	<li>Download the EWS editor from our open-source tools site ( <a href="https://ewseditor.codeplex.com/">https://ewseditor.codeplex.com/</a> ), unzip it and double-click <strong>EWSEditor.exe</strong> to start it.</li>
 	<li>Click File and then click New Exchange Service.</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2018/03/110.jpg"><img width="655" height="457" class="alignnone size-full wp-image-3655" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/110.jpg" /></a>

3. Select ‘Service URL’ and click ‘365 Default’, choose ‘Use the following credentials instead of the default Windows credentials.’, enter the credentials of the Office 365 account which you use for impersonation and hit OK:

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/24.jpg"><img width="817" height="468" class="alignnone size-full wp-image-3665" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/24.jpg" /></a>

&nbsp;

4.Click Yes to add the mailbox root to the tree view.

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/34.jpg"><img width="458" height="212" class="alignnone size-full wp-image-3675" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/34.jpg" /></a>

5. Right click your top folder and choose Add Root Folder.

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/43.jpg"><img width="725" height="246" class="alignnone size-full wp-image-3685" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/43.jpg" /></a>

6. Select ‘Identify folder by well known name’ and then enter in the SMTP address of the mailbox from which you want to copy the content:

<strong>NOTE: Make sure there isn’t a space at the end so it doesn’t fail.</strong>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/54.jpg"><img width="487" height="456" class="alignnone size-full wp-image-3695" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/54.jpg" /></a>

7. Expand the hierarchy of the mailbox and search for Top of Information Store and expand it.

<strong>Note: The name of the folder can vary depending on the language set for the mailbox.</strong>

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/63.jpg"><img width="320" height="140" class="alignnone size-full wp-image-3705" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/63.jpg" /></a>

8. Double click the ‘Calendar’ folder (or the location you need), new window will pop-up and show you the calendar objects:

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/72.jpg"><img width="807" height="518" class="alignnone size-full wp-image-3715" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/72.jpg" /></a>

9. Select the meeting you would like to copy to your personal calendar,  right click ‘Copy Item’

<strong>Note: You can manipulate just 1 object at the time.</strong>

<strong></strong>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/81.jpg"><img width="714" height="482" class="alignnone size-full wp-image-3725" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/81.jpg" /></a>

&nbsp;

10. Within the new window select from the drop down menu ‘Calendar ‘ for a ‘Root Folder’ (or another location) and insert the address of the mailbox to which you want to copy the data, then hit OK

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/91.jpg"><img width="485" height="455" class="alignnone size-full wp-image-3735" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/91.jpg" /></a>

&nbsp;

<strong>A window notification will be letting you know if the result of the action is successful or not</strong>

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2018/03/102.jpg"><img width="747" height="278" class="alignnone size-full wp-image-3745" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/102.jpg" /></a>

&nbsp;

And that's all - you have copied the item!]]></content:encoded>
    </item>
    <item>
      <title>Office Message Encryption Configuration and Troubleshooting</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/office-message-encryption-configuration-and-troubleshooting</link>
      <pubDate>Mon, 26 Feb 2018 11:04:18 GMT</pubDate>
      <dc:creator><![CDATA[Victor Legat]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3525</guid>
      <description><![CDATA[With Office 365 Message Encryption, an organization can send and receive encrypted email messages...]]></description>
      <content:encoded><![CDATA[With <strong>Office 365 Message Encryption</strong>, an organization can send and receive encrypted email messages between people inside and outside its organization.
We have this functionality for a while in Office 365. This is also called Office 365 Message Encryption version 1 (<strong>OMEv1</strong>).
In the last fall we received a new version of Office 365 Message Encryption, version 2 (<strong>OMEv2</strong>) which is based on Azure Information Protection (<strong>AIP</strong>) and allows organization not only to encrypt but also to protect emails &amp; documents on the entire life of them. OMEv2 also adds the capability to work with partners and external recipients.

New information about OME setup and capabilities you can find in the following articles: 
- <a href="https://support.office.com/en-us/article/Set-up-new-Office-365-Message-Encryption-capabilities-built-on-top-of-Azure-Information-Protection-7ff0c040-b25c-4378-9904-b1b50210d00e">Set up new Office 365 Message Encryption capabilities built on top of Azure Information Protection</a>
- <a href="https://Azure Information Protection Documentation">https://docs.microsoft.com/en-us/information-protection/</a>

My colleague <strong>Daniel David</strong> and <strong>I</strong> started writing this blog post and building a script as we found as some of the capabilities are sometimes misunderstood and/or misconfigured.

Currently both versions can be used independently or mixed if they are configured correctly.

With the script we wrote we tried to address OME configurations in all these situations.
<strong>You can find the script on TechNet Gallery</strong>: <a href="https://gallery.technet.microsoft.com/Office-Message-Encryption-592d4872">Office Message Encryption Configuration and Troubleshooting</a>


Important: the script is provided with the following Disclaimer:
<a href="https://msdnshared.blob.core.windows.net/media/2018/02/Disclaimer.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/02/Disclaimer-1024x241.png" alt="" width="1024" height="241" class="aligncenter size-large wp-image-3545" /></a>

You can find bellow the main menu:
<a href="https://msdnshared.blob.core.windows.net/media/2018/02/Main-Menu1.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/02/Main-Menu1.png" alt="" width="1009" height="530" class="aligncenter size-full wp-image-3615" /></a>

<strong>You have the possibility of checking:
- the current configuration
- enable/disable OME versions
- view and export templates/labels details
- check known issues
- export and check logs
- open or refresh cache IRM folder or registry</strong>

Bellow there are few screenshots from the execution of the script:

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/Disable.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/02/Disable.png" alt="" width="916" height="208" class="aligncenter size-full wp-image-3555" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/templates.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/02/templates-1024x552.png" alt="" width="1024" height="552" class="aligncenter size-large wp-image-3625" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/status1.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/02/status1-1024x192.png" alt="" width="1024" height="192" class="aligncenter size-large wp-image-3575" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/status2.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/02/status2-1024x192.png" alt="" width="1024" height="192" class="aligncenter size-large wp-image-3585" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/2018/02/status3.png"><img src="https://msdnshared.blob.core.windows.net/media/2018/02/status3.png" alt="" width="686" height="717" class="aligncenter size-full wp-image-3595" /></a>


]]></content:encoded>
    </item>
    <item>
      <title>How to add a new a alias to an existing Office 365 group</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/how-to-add-a-new-a-alias-to-an-existing-office-365-group</link>
      <pubDate>Thu, 11 Jan 2018 11:55:12 GMT</pubDate>
      <dc:creator><![CDATA[Cristian Nitu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3495</guid>
      <description><![CDATA[Some time ago I worked with an organization that had difficulties in receiving emails on a newly...]]></description>
      <content:encoded><![CDATA[Some time ago I worked with an organization that had difficulties in receiving emails on a newly added address. The Organization used “Set-UnifiedGroup” cmdlet to successfully add a new alias to an existing Office 365 group, but external senders were receiving the following NDR: “550 5.4.1 [newaddress@contoso.com]: Recipient address rejected: Access denied” upon sending an email to the new address.

So, I've decided to write a script and help this organization.

<strong>Scenario:</strong>
<ul>
 	<li>You want to add a new alias to an existing Office 365 Group.</li>
 	<li>You want external senders to be able to send emails to the new alias.</li>
</ul>
<strong>Current limitations:</strong>
<ul>
 	<li>It is not possible to add a new alias to an existing Office 365 Group in EAC.</li>
 	<li>The new alias is not replicated to <a href="https://technet.microsoft.com/en-us/library/dn600322(v=exchg.150).aspx">DBEB </a>(resulting in a rejection if an email is sent to the new address).</li>
</ul>
<strong>Workaround:</strong>
<ul>
 	<li>Use the Set-UnifiedGroup PowerShell cmdlet to add an alias to an existing Office 365 group (ex. Set-UnifiedGroup -Identity current_group_address@contoso.com -EmailAddresses: @{add="smtp:newaddress@contoso.com"}</li>
 	<li>Force the replication in DBEB by changing the primary address in Exchange Online (ex. Set-UnifiedGroup -PrimarySmtpAddress newaddress@contoso.com)</li>
</ul>
<strong>DISCLAIMER:</strong><strong> </strong>

<em>This application is a sample application. The sample is provided “as is” without warranty of any kind. Microsoft further disclaims all implied warranties including without limitation any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the samples remains with you. In no event shall Microsoft or its suppliers be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, data loss or other pecuniary loss arising out of the use of or inability to use the samples, even if Microsoft has been advised of the possibility of such damages. Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.</em>

<strong> Prerequisites:</strong>
<ul>
 	<li>To be able to run the script you need to install on the computer the prerequisites described in the following article <a href="https://technet.microsoft.com/en-us/library/dn975125.aspx">Connect to Office 365 PowerShell</a></li>
</ul>
<strong>Script logic</strong>:
<ul>
 	<li>Before taking any actions, the script tries to do some basic verifications:
<ul>
 	<li>Checks if the Current Group Address really exists in Exchange Online</li>
 	<li>Checks if the Current Group Address is the primary address (as at the end we will set it back)</li>
 	<li>Checks the domain of the New Group Address</li>
 	<li>Checks if the New Group Address already exists in Exchange Online</li>
 	<li>Checks if the New Group Address already exists in Azure AD</li>
</ul>
</li>
 	<li>Adds the New Group Address to the Office 365 group</li>
 	<li>Sets the New Group Address as primary address in order to replicate it in DBEB</li>
 	<li>Reverts the primary address to Current Group Address</li>
</ul>
<strong>Script Sample</strong>:

#------------------------------------------------------------------------------
#
# Copyright © 2017 Microsoft Corporation.  All rights reserved.
#
# THIS CODE AND ANY ASSOCIATED INFORMATION ARE PROVIDED “AS IS” WITHOUT
# WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THE ENTIRE RISK OF USE, INABILITY TO USE, OR
# RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE USER.
#
#------------------------------------------------------------------------------
#
# PowerShell Source Code
#
# NAME:
#    Office365_add_alias.ps1
#
# VERSION:
#    1.0
#
#------------------------------------------------------------------------------
[CmdletBinding()]
param
(
[Parameter(Mandatory = $True, Position = 0)]
[ValidateNotNullOrEmpty()]
[string]$CurrentGroupAddress,

[Parameter(Mandatory = $True, Position = 1)]
[ValidateNotNullOrEmpty()]
[string]$NewGroupAddress
)

#region Set Up Variables
$Matcheduser = $Null
$Matchedgroup = $Null
$MatchedOldGroup = $Null
$Objid = $Null
$CheckDomain = $Null
$AllUsers = $Null
$AllGroups = $Null
$MatchedUnifiedOldGroup = $Null
$MatchedRecipient = $Null
$MatchedMSODS = $Null
$MatchedEXO = $Null
$UserMatchFound = $false
$GroupMatchFound = $false
$MSODSEmailAddress = $Null
$CounterEXO = 6
$CounterMSODS = 6
$CheckEXO = $Null
$CheckMSODS = $Null
#endregion

#region Connect to Office 365
try
{
# Connect to Azure AD
Write-Host "Please enter your Office 365 credentials" -ForeGroundColor Green
$O365Cred = Get-Credential
Import-Module MSOnline
Write-Host "`nConnecting to Azure AD..."
Connect-MsolService –Credential $O365Cred

# Connect to Exchange Online
Write-Host "`nConnecting to Exchange Online..."
$O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $O365Cred -Authentication "Basic" -AllowRedirection
Import-PSSession $O365Session -DisableNameChecking -AllowClobber | ft

}
catch
{
Write-Host "`nUnable to connect to Office 365`n" -Foregroundcolor Red
Read-Host “Press ENTER to exit...”
Exit
}
#endregion

#region Checking if the old address exists
Write-Host "Checking the address $CurrentGroupAddress in Exchange Online"
$MatchedUnifiedOldGroup = Get-UnifiedGroup -Identity $CurrentGroupAddress -ErrorAction SilentlyContinue | select Name, EmailAddresses
if ($MatchedUnifiedOldGroup -eq $Null)
{
Write-Host "`tI was not able to find $CurrentGroupAddress in Exchange Online `n"-Foregroundcolor Red
Read-Host “Press ENTER to exit...”
Exit
}
else
{
Write-Host "`tDone. The address $CurrentGroupAddress was found in Exchange Online`n" -Foregroundcolor Yellow
}
Write-Host "Checking the address $CurrentGroupAddress in Azure AD"
$MatchedOldGroup = Get-MsolGroup -All -SearchString $CurrentGroupAddress | select ObjectId,proxyAddresses
if ($MatchedOldGroup -eq $Null)
{
Write-Host "`tI was not able to find $CurrentGroupAddress. Are you sure this is the primary address of the group?`n"-Foregroundcolor Red
$Objid = (Get-UnifiedGroup $CurrentGroupAddress).ExternalDirectoryObjectId
$MSODSEmailAddress = Get-MsolGroup -ObjectId $objid |select EmailAddress
Write-Host "Based on Exchange Online info $($MSODSEmailAddress.EmailAddress) might be the primary address. Would you like me to use this address instead of $($CurrentGroupAddress)? (Default is No)" -Foregroundcolor Yellow
$Readhost = Read-Host "Enter your choice ( y / n ) "
Write-Host "`n"
Switch ($ReadHost)
{
Y {$CurrentGroupAddress = $MSODSEmailAddress.EmailAddress}
N {Read-Host “Press ENTER to exit...”;  Exit}
Default {Read-Host “Press ENTER to exit...”;  Exit}
}
}
else
{
Write-Host "`tDone. The address $CurrentGroupAddress was found `n" -Foregroundcolor Yellow
}
#endregion

#region Verify the new address
Write-Host "Checking if the address $NewGroupAddress is part of an accepted domain"
$CheckDomain = Get-AcceptedDomain -Identity ($NewGroupAddress.Split("@"))[1] -ErrorAction SilentlyContinue
If ($CheckDomain -eq $Null)
{
Write-Host "`tDomain does not exists or is not correct`n" -Foregroundcolor Red
Read-Host “Press ENTER to exit...”
Exit
}
else
{
Write-Host "`tDone. The domain was found `n" -Foregroundcolor Yellow
}
#endregion

#region Checking if new address exists in MSODS
Write-Host "Checking if any user in Azure AD contains $NewGroupAddress (this may take a while)..."
$AllUsers = Get-MsolUser –All | Select userPrincipalName,proxyAddresses
$AllGroups = Get-MsolGroup –All | Select ObjectId,proxyAddresses

#loop all users
ForEach ($User in $AllUsers)
{
#loop proxyAddresses
ForEach ($UPA in $User.ProxyAddresses)
{
If ($UPA –Match $NewGroupAddress)
{
$UserMatchFound = $True
$Matcheduser = $User
}
}

}
write-host "`tDone. `n" -Foregroundcolor Yellow
write-host "Checking if any group in Azure AD contains $NewGroupAddress (this may take a while)..."

#loop all groups
ForEach ($Group in $AllGroups)
{

#loop proxyAddresses
ForEach ($GPA in $Group.ProxyAddresses)
{
If ($GPA –Match $NewGroupAddress)
{
$GroupMatchFound = $True
$Matchedgroup = $Group
}
}

}
write-host "`tDone.`n" -Foregroundcolor Yellow

If ($UserMatchFound -or $GroupMatchFound)
{
$MatchedMSODS = $true
If ($UserMatchFound)
{
Write-Host "`nThe new address exists in Azure AD"
Write-Host "The user $($Matcheduser.userPrincipalName) contains the following addresses: $($Matcheduser.ProxyAddresses)`n" -Foregroundcolor Red
Read-Host “Press ENTER to exit...”
Exit
}
Else
{
Write-Host "`nThe new address exists in Azure AD"
Write-Host "`The group $($Matchedgroup.ObjectId) contains the following addresses: $($Matchedgroup.ProxyAddresses)`n" -Foregroundcolor Red
Read-Host “Press ENTER to exit...”
Exit
}
}
Else
{
write-host "`tDone. No user or group found in Azure AD`n" -Foregroundcolor Yellow
}

#endregion

#region Checking if new address exists in EXO
Write-Host "Checking the address $NewGroupAddress in Exchange Online "
$MatchedUnifiedGroup = Get-UnifiedGroup -Identity $NewGroupAddress -ErrorAction SilentlyContinue | select Name, EmailAddresses
$MatchedRecipient = Get-Recipient -Identity $NewGroupAddress -ErrorAction SilentlyContinue | select Name, EmailAddresses
if (($MatchedUnifiedGroup -ne $Null) -or ($MatchedRecipient -ne $Null))
{
$MatchedEXO = $true
If ($MatchedRecipient -ne $Null)
{
Write-Host "`tDone. receipint $($MatchedRecipient.name) contains the following addresses: $($MatchedRecipient.EmailAddresses) `n" -Foregroundcolor Yellow
}
Else
{
Write-Host "`tDone. Unified Group $($MatchedUnifiedGroup.Name) contains the following addresses: $($MatchedUnifiedGroup.EmailAddresses)  `n" -Foregroundcolor Yellow
}
Write-Host "The new address already exists`n" -Foregroundcolor Red
Read-Host “Press ENTER to exit...”
Exit
}
Else
{
Write-Host "`tDone. No user or group was found in Exchange Online`n" -Foregroundcolor Yellow
}
#endregion

#region Adding the new address
Write-Host "Finished all checks. Moving forward...`n" -Foregroundcolor Green
if (!$MatchedMSODS -and !$MatchedEXO)
{
$Objid = (Get-UnifiedGroup $CurrentGroupAddress).ExternalDirectoryObjectId
Write-Host "Adding $NewGroupAddress in Exchange Online"

# add the new address
Set-UnifiedGroup -Identity $CurrentGroupAddress -EmailAddresses: @{add="smtp:$NewGroupAddress"}

do
{
sleep 10
$CounterEXO--
$CheckEXO = Get-UnifiedGroup -Identity $NewGroupAddress
}
while (($CounterEXO -ge 0) -and ($CheckEXO -eq $Null))

if ($CheckEXO -eq $Null)
{
Write-Host "I was not able to add the new address`n" -Foregroundcolor Red
Read-Host “Press ENTER to exit...”
Exit
}
Else
{
Write-Host "`tDone.`n" -Foregroundcolor Yellow
}

Write-Host "Adding $NewGroupAddress in Azure AD"

# Changing the primary address to force the sync
Get-UnifiedGroup $CurrentGroupAddress | Set-UnifiedGroup -PrimarySmtpAddress $NewGroupAddress

do
{
sleep 10
$CounterMSODS--
$CheckMSODS = Get-MsolGroup -All -SearchString $NewGroupAddress | select emailaddress
Write-Host "`tPlease wait..."
}
while (($CounterMSODS -ge 0) -and ($CheckMSODS -eq $Null))

if ($CheckMSODS  -eq $Null)
{
Write-Host "I was not able to sync the new address`n" -Foregroundcolor Red
Read-Host “Press ENTER to exit...”
Exit
}
Else
{
Write-Host "`tDone.`n" -Foregroundcolor Yellow
}

# Changing back the primary address
Get-UnifiedGroup $NewGroupAddress | Set-UnifiedGroup -PrimarySmtpAddress $CurrentGroupAddress
Write-Host "`nAll Done! Wait 15 mins before doing a test!`n" -Foregroundcolor Yellow
Read-Host “Press ENTER to exit...”
Remove-PSSession $O365Session
}
#endregion

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Archive public folder emails older than 2 years</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/archive-public-folder-emails-older-than-2-years</link>
      <pubDate>Wed, 20 Dec 2017 18:12:09 GMT</pubDate>
      <dc:creator><![CDATA[Catalin Streang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3485</guid>
      <description><![CDATA[As we all know, retention policies aren't supported for public folder mailboxes. In case you want to...]]></description>
      <content:encoded><![CDATA[As we all know, retention policies aren't supported for public folder mailboxes. In case you want to archive/move your old public folder emails to a public folder, specially created for archiving, this script might turn to be useful. First, it prompts you to create the public folder (archive) and then, it is recursively returning the public folder structure and looks in each folder for any items older than two years.

&nbsp;

<span style="text-decoration: underline">Prerequisites:</span>

-The script requires EWS Managed API 2.2, which can be downloaded here: <a href="https://www.microsoft.com/en-gb/download/details.aspx?id=42951">https://www.microsoft.com/en-gb/download/details.aspx?id=42951</a>

-The "Default" user for each public folder (Get-PublicFolderClientPermission \PF -User Default) needs to have at least 'Author' permissions (which are actually the default), or of course, you can assign specific permissions to the mailbox that you are using to access the public folder structure.

-The mailbox that you are using to access the public folder structure needs to have owner permissions on the public folder root ("\) to be able to create the public folder archive.

&nbsp;

&nbsp;
<pre>DISCLAIMER: This application is a sample application. The sample is provided "as is" without warranty of any kind. Microsoft further disclaims all implied warranties including without limitation any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the samples remains with you. in no event shall Microsoft or its suppliers be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss arising out of the use of or inability to use the samples, even if Microsoft has been advised of the possibility of such damages). Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.



Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll"

$service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService -ArgumentList Exchange2013_SP1

#Provide the credentials
$credential = Get-Credential -Message "Type the credentials of the mailbox with access to the public folders that you want to process for archiving"
$service.Credentials = new-object Microsoft.Exchange.WebServices.Data.WebCredentials -ArgumentList $credential.UserName, $credential.GetNetworkCredential().Password

#Exchange Online URL
$service.Url= new-object Uri("https://outlook.office365.com/EWS/Exchange.asmx")

$RootFolderId = New-Object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::PublicFoldersRoot, $credential.UserName)


#Create the archive/public folder (you need owner permissions on the Root folder "\")
$TargetFolderName = Read-Host "Type the name of the public folder archive"

$TargetFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)

$TargetFolder.DisplayName = $TargetFolderName

$TargetFolder.Save($RootFolderId)


#Get the Public folder structure
 GetPublicFolder -FolderId $RootFolderId



function GetPublicFolder ()

{

param (
 $FolderId = "$( throw 'FolderId is a mandatory Parameter' )"
       )

$FolderView = New-Object Microsoft.Exchange.WebServices.Data.FolderView(100)

$FolderView.Traversal = [Microsoft.Exchange.WebServices.Data.FolderTraversal]::Shallow

$pspropset = New-Object Microsoft.Exchange.WebServices.Data.PropertySet ([Microsoft.Exchange.WebServices.Data.BasePropertySet]::IdOnly,

[Microsoft.Exchange.WebServices.Data.FolderSchema]::FolderClass,

[Microsoft.Exchange.WebServices.Data.FolderSchema]::DisplayName,

[Microsoft.Exchange.WebServices.Data.FolderSchema]::ChildFolderCount)


$PR_Folder_Path = New-Object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition (26293,[Microsoft.Exchange.WebServices.Data.MapiPropertyType]::String)

$SearchFilter = New-Object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo ([Microsoft.Exchange.WebServices.Data.FolderSchema]::FolderClass, "IPF.Note")

$pspropset.Add($PR_Folder_Path)

$FolderView.PropertySet = $pspropset


$FindFolderResults = $service.FindFolders($FolderId,$SearchFilter,$FolderView)



if($FindFolderResults.TotalCount)

{

foreach ($Folder in $FindFolderResults.Folders) 
{
Write-Host "Checking if there are messages older than 2 years in the public folder $($Folder.ExtendedProperties.Value)" -ForegroundColor White

PublicFolderEmails -FolderId $Folder.Id


if($Folder.ChildFolderCount){ GetPublicFolder -FolderId $Folder.Id }

}

}
}



function PublicFolderEmails
{

param (
 $FolderId = "$( throw 'FolderId is a mandatory Parameter' )"
 )


$ItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1000)

$pspropset = New-Object Microsoft.Exchange.WebServices.Data.PropertySet ([Microsoft.Exchange.WebServices.Data.BasePropertySet]::IdOnly,
                                                                         [Microsoft.Exchange.WebServices.Data.ItemSchema]::DateTimeReceived,
                                                                         [Microsoft.Exchange.WebServices.Data.ItemSchema]::DateTimeSent)

$ItemView.PropertySet = $pspropset

$FindItemResults = $service.FindItems($FolderId,$ItemView)



if ($FindItemResults.TotalCount)  {

foreach($Item in $FindItemResults.Items)

{


if([datetime]$Item.DateTimeReceived -le (get-date).adddays(-730) -or [datetime]$Item.DateTimeSent -le (get-date).adddays(-730))

{
#Move the items older than 2 years in the target/archive public folder

$Message = [Microsoft.Exchange.WebServices.Data.EmailMessage]::Bind($service,$Item.Id)

$Message.Move($TargetFolder.Id)

}

}

}

}</pre>
&nbsp;

<strong>Note: </strong><em>In case you want to create a folder within the primary mailbox structure (of the account used to access the public folders) and move the public folder emails older than two years there, you can do that as well. However, the script has to be slightly changed.</em>

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>How to remove the MobilePhone from my Public Folder contacts?</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/how-to-remove-the-mobilephone-from-my-public-folder-contacts</link>
      <pubDate>Fri, 08 Dec 2017 12:06:41 GMT</pubDate>
      <dc:creator><![CDATA[Catalin Streang]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3456</guid>
      <description><![CDATA[In case you want to remove the "MobilePhone" property for all your public folder contacts, you can...]]></description>
      <content:encoded><![CDATA[In case you want to remove the <em>"MobilePhone"</em> property for all your public folder contacts, you can use this script. The same reasoning applies for other properties, with the mention that you need to load the corresponding extended property for them.

&nbsp;

<span style="text-decoration: underline">Prerequisites:</span>

-The script requires EWS Managed API 2.2, which can be downloaded here: <a href="https://www.microsoft.com/en-gb/download/details.aspx?id=42951">https://www.microsoft.com/en-gb/download/details.aspx?id=42951</a>
-You need to be connected to Exchange Online when you run the script (copy/paste it into a Notepad file and save it with the extension ".ps1"): <a href="https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx">https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx</a>

&nbsp;
<pre>DISCLAIMER: This application is a sample application. The sample is provided "as is" without warranty of any kind. Microsoft further disclaims all implied warranties including without limitation any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the samples remains with you. in no event shall Microsoft or its suppliers be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss arising out of the use of or inability to use the samples, even if Microsoft has been advised of the possibility of such damages). Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.



$PF = Read-Host -Prompt "Public Folder identity (e.g. \PF1, \PF1\SubPF1)"

Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll"

$service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService -ArgumentList Exchange2013_SP1

#Provide the credentials
 $credential = Get-Credential -Message "Type the credentials of the mailbox that you intend to use to connect to the public folder"

$service.Credentials = new-object Microsoft.Exchange.WebServices.Data.WebCredentials -ArgumentList $credential.UserName, $credential.GetNetworkCredential().Password

#Exchange Online URL
 $service.Url= new-object Uri("https://outlook.office365.com/EWS/Exchange.asmx")


function Convert($c)
{
$aiItem = New-Object Microsoft.Exchange.WebServices.Data.AlternatePublicFolderId

$aiItem.FolderId = $c

$aiItem.Format = [Microsoft.Exchange.WebServices.Data.IdFormat]::HexEntryId

$convertedId = $service.ConvertId($aiItem, [Microsoft.Exchange.WebServices.Data.IdFormat]::EwsId)

$folderid = new-object Microsoft.Exchange.WebServices.Data.FolderId($convertedId.FolderId)

return $folderid;
}

$SourcePF = Convert (Get-PublicFolder $PF).EntryId

$psPropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)

$MobilePhone = new-object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(0x3A1C, [Microsoft.Exchange.WebServices.Data.MapiPropertyType]::String)

$psPropertySet.Add($MobilePhone)


$ItemView = new-object Microsoft.Exchange.WebServices.Data.ItemView(1000)

do

{

$FindItemResults = $service.FindItems($SourcePF,$ItemView)

if($FindItemResults.TotalCount){

write-host "$($FindItemResults.TotalCount) contact(s) has/have been found in the source folder" -ForegroundColor White

[void]$service.LoadPropertiesForItems($FindItemResults,$psPropertySet)


foreach($Item in $FindItemResults.Items)
{

if ($Item.ItemClass -match "IPM.Contact" -and $Item.ExtendedProperties.Value)
{

$Contact = [Microsoft.Exchange.WebServices.Data.Contact]::Bind($service,$Item.Id,$psPropertySet);

Write-Host "Removing the MobilePhone for the contact: $($Contact.DisplayName)" -ForegroundColor White

$Contact.RemoveExtendedProperty($MobilePhone)

$Contact.Update([Microsoft.Exchange.WebServices.Data.ConflictResolutionMode]::AlwaysOverwrite)

}

}

}

else { Write-Host "The Public Folder is empty!" -ForegroundColor Yellow; break; }

$ItemView.offset += $FindItemResults.Items.Count

}

while($FindItemResults.MoreAvailable -eq $true)</pre>
&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Disable automatic forwarding in Office 365 and Exchange Server to prevent information leakage</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/disable-automatic-forwarding-in-office-365-and-exchange-server-to-prevent-information-leakage</link>
      <pubDate>Thu, 07 Dec 2017 12:43:09 GMT</pubDate>
      <dc:creator><![CDATA[Silvia Marinova]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3375</guid>
      <description><![CDATA[This article is describing a brief guide on how to prevent internal users from auto-forwarding...]]></description>
      <content:encoded><![CDATA[This article is describing a brief guide on how to prevent internal users from auto-forwarding emails to external mailbox users and on how to disable automatic email forwarding in Office 365 and Exchange Server.

<u>Allowing users to use mail auto-forwarding brings the risk of information leakage. Additionally, users can select the option to not keep a copy of the message in the mailbox which could also result in data loss.</u>

&nbsp;

<strong>How to remove the automatic email forwarding options from Outlook on the web (OWA) in Exchange Server and Exchange Online</strong>

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/124.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/12/124.png" alt="" width="779" height="494" class="alignnone size-full wp-image-3405" /></a>

&nbsp;
<h6>Automatic email forwarding options in Outlook Web App in Exchange Server and Exchange Online</h6>
&nbsp;

In Exchange administrators control which actions can be performed by the users through Role Based Access Control. To remove the option shown in the picture above you need to modify the Default Role Assignment Policy. The Default Role Assignment Policy contains a Management Role called MyBaseOptions which is holding the parameters responsible for the forwarding and letting users perform the desired changes through the graphical interface of OWA by running Set-Mailbox on the background :

&nbsp;

<strong>DeliverToMailboxAndForward
</strong>The DeliverToMailboxAndForward parameter specifies the message delivery behavior when a forwarding address is specified by the ForwardingAddress or ForwardingSmtpAddress parameters.

<strong>ForwardingAddress</strong>
The ForwardingAddress parameter specifies a forwarding address for messages that are sent to this mailbox. A valid value for this parameter is a recipient in your organization. You can use any value that uniquely identifies the recipient.

<strong>ForwardingSmtpAddress</strong>
The ForwardingSmtpAddress parameter specifies a forwarding SMTP address for messages that are sent to this mailbox. Typically, you use this parameter to specify external email addresses that aren't validated.

&nbsp;

As you can’t modify the build-in role MyBaseOptions, you need to create a new role to replace it with.
<ol>
 	<li>Create a new management role based on the MyBaseOptions role:<strong>
New-ManagementRole MyBaseOptions-DisableForwarding -Parent MyBaseOptions</strong></li>
 	<li>Remove the forwarding parameters from the MyBaseOptions-DisableForwarding role<strong>
Set-ManagementRoleEntry MyBaseOptions-DisableForwarding\Set-Mailbox -RemoveParameter -Parameters DeliverToMailboxAndForward,ForwardingAddress,ForwardingSmtpAddress</strong>
<h5>Note: If you want to retrieve the parameters that will be left available for the Set-Mailbox cmdlet after the modification of the role which you’ve created:</h5>
<h5><strong>(Get-ManagementRoleEntry MyBaseOptions-DisableForwarding\Set-Mailbox).parameters</strong></h5>
<a href="https://msdnshared.blob.core.windows.net/media/2017/12/218.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/12/218.png" alt="" width="833" height="333" class="alignnone size-full wp-image-3415" /></a>
<h6></h6>
</li>
 	<li>As you have created the role, you have 2 options – modifying the default policy for all users or creating a different policy and assign it to a targeted group of people.
3.1. Modify the Default Role Assignment Policy for all users by replacing MyBaseOptions with MyBaseOptions-DisableForwarding.The easiest way to do this is from  <strong>Exchange Admin Center &gt; Permissions &gt; User Roles &gt; edit the Default Role Assignment Policy &gt; clear MyBaseOptions and then select MyBaseOptions-DisableForwarding</strong>.3.2. Create a new role assignment policy which will contain the MyBaseOptions-DisableForwarding role<strong>
New-RoleAssignmentPolicy -Name DisabledForwardingRoleAssignmentPolicy -Roles MyBaseOptions-DisableForwarding,MyContactInformation,MyRetentionPolicies,MyMailSubscriptions,MyTextMessaging,MyVoiceMail,MyDistributionGroupMembership,MyDistributionGroups, MyProfileInformation</strong>After creating the new policy, you can apply it to targeted user for example:<strong>
Set-Mailbox –Identity <a href="mailto:user@domain.com">user@domain.com</a> -RoleAssignmentPolicy DisabledForwardingRoleAssignmentPolicy</strong>Note: Give it some time to replicate after the change.

The expected result of both of the actions is the following:</li>
</ol>
<a href="https://msdnshared.blob.core.windows.net/media/2017/12/38.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/12/38.png" alt="" width="411" height="497" class="alignnone size-full wp-image-3425" /></a>

<strong>
Removing </strong><strong>any existing auto-forwarding left from before the implementation of the new role </strong>

&nbsp;

As the forwarding can be set to both internal and external recipients you might want to export a list of the mailboxes which had configured the settings before the Role Assignment Policy modifications. This will allow you to remove only the forwarding to external addresses with precision:

<strong>
Get-Mailbox -ResultSize Unlimited -Filter {(RecipientTypeDetails -ne "DiscoveryMailbox") -and ((ForwardingSmtpAddress -ne $null) -or (ForwardingAddress -ne $null))} | Select Identity | Export-Csv c:\ForwardingSetBefore.csv -append</strong>

If you want to remove any kind of forwarding regardless the location:

<strong>
Get-Mailbox -filter {(RecipientTypeDetails -ne "DiscoveryMailbox") -and ((ForwardingSmtpAddress -ne $null) -or (ForwardingAddress -ne $null))} | Set-Mailbox -ForwardingSmtpAddress $null -ForwardingAddress $null</strong>

<strong></strong>

<strong>Disable forwarding set through Inbox Rules</strong>

As the Inbox Rule are frequently created by the users and can’t be blocked on server side (unless you disable the creation of Inbox rules which allow forwarding and redirection as described <a href="https://blogs.technet.microsoft.com/exchange/2017/12/22/the-many-ways-to-block-automatic-email-forwarding-in-exchange-online/">HERE</a>), you need to disable this on a Remote Domain level.
The cmdlet below will disable the forwarding to all external domains. If you want to restrict this for particular domains only replace you can do so as well.

<strong>
Set-RemoteDomain Default -AutoForwardEnabled $false</strong>

Or you can clear the selection for the Default Remote Domain settings from <strong>Exchange Admin Center &gt;  Mail Flow &gt; Remote Domains</strong>

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/47.png"><img src="https://msdnshared.blob.core.windows.net/media/2017/12/47.png" alt="" width="389" height="645" class="alignnone size-full wp-image-3435" /></a>

As that setting will be applicable for all newly sent emails but will not eliminate the rules, you can use the cmdlet below will export a list of the mailboxes which have forwarding, redirection or message deletion rules configured, review them and remove them upon demand as well:

&nbsp;

<strong>foreach ($a in (Get-Mailbox -ResultSize Unlimited |select PrimarySMTPAddress)) {Get-InboxRule -Mailbox $a.PrimarySMTPAddress | ?{($_.ForwardTo -ne $null) -or ($_.ForwardAsAttachmentTo -ne $null) -or ($_.DeleteMessage -eq $true) -or ($_.RedirectTo -ne $null)} |select Name,Identity,ForwardTo,ForwardAsAttachmentTo, RedirectTo, DeleteMessage | Export-Csv c:\temp\InboxRules.csv -append }</strong>

&nbsp;

<strong>Remove-InboxRule -Mailbox <a href="mailto:user@domain.com">user@domain.com</a> -Identity "RuleName"</strong>

&nbsp;

<strong>Note</strong>: In case you are facing an issue with corrupted or hidden Inbox rules, yet you still want to remove them, please consult the following <a href="https://blogs.msdn.microsoft.com/hkong/2015/02/27/how-to-delete-corrupted-hidden-inbox-rules-from-a-mailbox-using-mfcmapi/">article</a>.

&nbsp;

Another option which you might consider, as it will be notifying your users as well,  is to configure a transport rule to handle the blocking of any auto-forward message types:

<a href="https://msdnshared.blob.core.windows.net/media/2017/12/54.jpg"><img src="https://msdnshared.blob.core.windows.net/media/2017/12/54.jpg" alt="" width="571" height="506" class="alignnone size-full wp-image-3436" /></a>

<strong>Note</strong>: Applying the following action 'Enable Client Rules Forwarding Block Advanced Action' from Secure Score in Office 365 Security and Compliance Center will create a new transport rule for your organization.
It will stop external messages leaving your Tenant, that are of the type AutoForward, mitigating the use of Client created external mail forwarding rules and malicious Remote Domain entries as a data exfiltration vector.
If The Sender is located 'Inside the organization'
If The Recipient is located 'Outside the organization'
If The message type is 'Auto-Forward'
Reject the message with the explanation 'External Mail Forwarding via Client Rules is not permitted'

The steps mentioned above aren't going to be reflected in the Secure Score. In order for you to obtain the Action Score Points you need to apply the rule from Secure Score.

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>One of the required migration features (PAW) isn't enabled</title>
      <link>https://docs.microsoft.com/archive/blogs/exovoice/one-of-the-required-migration-features-paw-isnt-enabled</link>
      <pubDate>Mon, 20 Nov 2017 15:08:21 GMT</pubDate>
      <dc:creator><![CDATA[Cristian Dimofte [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/exovoice/?p=3355</guid>
      <description><![CDATA[Check the article I've wrote on answers.microsoft.com about this.

&nbsp;

&nbsp;]]></description>
      <content:encoded><![CDATA[Check the article I've wrote on <a href="https://answers.microsoft.com/en-us/msoffice/forum/msoffice_o365admin-mso_exchon-mso_o365b/one-of-the-required-migration-features-paw-isnt/7f5666a0-f569-4106-8110-fc8a269ecd9a?tm=1511183097910">answers.microsoft.com</a> about this.

&nbsp;

&nbsp;]]></content:encoded>
    </item>
  </channel>
</rss>