<?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>Mike Lee’s Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/mikelee/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/mikelee/feed.xml</link>
    <description>Microsoft | SharePoint, Exchange, Outlook, Hybrid</description>
    <lastBuildDate>Wed, 19 Jun 2019 17:46:20 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Script to check if a reg key is set on multiple servers</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/script-to-check-if-a-reg-key-is-set-on-multiple-servers</link>
      <pubDate>Tue, 18 Jun 2019 21:12:49 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=2105</guid>
      <description><![CDATA[Summary
If your servers require a reg key and unsure if its properly configured. You can use this...]]></description>
      <content:encoded><![CDATA[<h1>Summary</h1>
If your servers require a reg key and unsure if its properly configured. You can use this script to check if the key is present or is set to the correct value across multiple servers.
<h1>The Script</h1>
<pre><span>#Simple Server list
$servers = Get-Content C:\servers.txt
 
# Loop through all servers and check key 
foreach ($server in $servers) {
 
$REG = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $server)
$REGKEY = $REG.OpenSubKey("SYSTEM\CurrentControlSet\Control\Lsa")
$val = $REGKEY.GetValue("DisableLoopBackCheck")
 
# If the key is missing or not set it will be displayed in red
# If the key is set it will be displayed in green
 
if (!$val){
 
Write-Host $server "is not set"  -ForegroundColor Red
break
}
 
if ($val -ne "1"){
Write-Host $server "is not set properly"  -ForegroundColor Red
}
 
else{
Write-Host $server "is set" -ForegroundColor Green
}
}</span></pre>
<h1>What the Script Does</h1>
In the sample above it will check the “DisableLoopBackCheck” key across a list of servers and if the key does not exist or not set to “1” it will be reported in the output.

&nbsp;

Example:

<img class="jetpack-lazy-image jetpack-lazy-image--handled" alt="" src="https://i2.wp.com/mikesblogs.net/wp-content/uploads/2019/06/061819_1559_Scripttoche1.png?w=1280&amp;ssl=1" />

&nbsp;
You can simply change which key to check and the desired value to make this work for your scenario.

&nbsp;
I hope this helps make your job easier in the future.]]></content:encoded>
    </item>
    <item>
      <title>Script to copy specified IIS logs from multiple Servers</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/script-copy-specified-iis-logs-from-multiple-servers</link>
      <pubDate>Sat, 15 Jun 2019 02:26:47 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=2095</guid>
      <description><![CDATA[Summary
Need to copy a set of IIS logs from multiple servers for data analysis? Are you doing it...]]></description>
      <content:encoded><![CDATA[<h1>Summary</h1>
Need to copy a set of IIS logs from multiple servers for data analysis? Are you doing it manually?  If so, please check out this script as it will help expedite the process.
<h1>The Script:</h1>
<pre><span>#Modify Inputs</span>

<span># Host and Drive to store the IISLogs
$Hostdir = <strong><span style="color: #ff0000">"\\HOSTSERVER\c$" </span></strong></span>

<span># Actual Location of the IIS Logs on the Server
$iislogsfolder = <span style="color: #ff0000"><strong>"c$\inetpub\logs\LogFiles\W3SVC1892304237"</strong></span></span>

<span>#A wild card parameter to determine a file range
$thefiles = <strong><span style="color: #ff0000">"*ex1906*"</span></strong></span>

<span># Create a target folder on host if does not exist
 $TARGETROOT = "$Hostdir\logs"
 if(!(Test-Path -Path  $TARGETROOT)){
 New-Item -ItemType directory -Path  $TARGETROOT
 }</span>

<span># Create an export folder if it does not exist
$target = "$Hostdir\logs\export"
 if(!(Test-Path -Path  $target)){
 New-Item -ItemType directory -Path $target
 }</span>

<span>#Simple Server list
$servers = Get-Content C:\servers.txt</span>

<span># For loop to do the work
foreach ($server in $servers)
{</span>

<span>#make a new folder by server name if it does not exist
 $TARGETDIR = "$target\$Server"
 if(!(Test-Path -Path  $TARGETDIR)){
 New-Item -ItemType directory -Path $TARGETDIR
 }</span>

<span>#Get the files
$iislogLogDir = "\\$server\$iislogsfolder"
$iislogName = Get-ChildItem "$iislogLogDir" -Recurse -Include "$thefiles" | Get-Item</span>

<span>#Start a loop to copy all the files to the host locatiion
foreach ($log in $iislogName) {
copy-Item -path $log $TARGETDIR
}</span>

<span>}
  </span></pre>
<h1>What the Script Does</h1>
You only need to modify the inputs and create a server list. Then the script will do the following:
<ol>
 	<li> Use a list of servers to collect the data from.</li>
 	<li> Create a "logs" folder on the specified drive.</li>
 	<li> Create an "export" sub folder under "logs".</li>
 	<li> Create a sub folder under "export" using  server name of each server.</li>
 	<li> Use the wild card file name you specified to target specific files.</li>
 	<li> Copy each targeted file to the correct serer name folder.</li>
</ol>
&nbsp;

Notes:
<ul>
 	<li> If you want to collet 1 file from each server, just specify use the full date name in the search input (ie <span>190606</span>).</li>
 	<li> You can run this more than once if another file is needed and they will be added to the existing folders.</li>
 	<li> The "export" folder will contain all the files needed. Just compress the folder and your ready to share.</li>
</ul>
&nbsp;

Hope this helps make your job a bit easier in the future.]]></content:encoded>
    </item>
    <item>
      <title>Script to backup event logs using a server list</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/script-to-backup-event-logs-using-a-server-list</link>
      <pubDate>Thu, 06 Jun 2019 07:08:24 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=2085</guid>
      <description><![CDATA[Summary
Have you ever needed to back up event logs for root cause analysis or auditing? Did you...]]></description>
      <content:encoded><![CDATA[<h1>Summary</h1>
Have you ever needed to back up event logs for root cause analysis or auditing? Did you access each server and manually export the requested log file?

If yes, I hope you find this script handy.
<h1>The script</h1>
<pre><span># Specify which Log File</span><span>
</span><span>$EventLogName</span><span> </span><span>=</span><span> “Application”
 
</span><span># Specify drive to store event logs</span><span>
</span><span>$drive</span><span>=</span><span> “c$”
 
</span><span># Specify server to store event logs</span><span>
</span><span>$dest</span><span> </span><span>=</span><span> </span><span>"SERVERNAME"</span><span>
 
</span><span>#Simple Server list</span><span>
</span><span>$servers</span><span> </span><span>=</span><span> </span><span>Get-Content</span><span> C:\servers.txt
</span><span># For loop to do the work</span><span>
</span><span>foreach</span><span> </span><span>(</span><span>$server</span><span> </span><span>in</span><span> </span><span>$servers</span><span>)</span><span>
</span><span>{</span><span>

</span><span># Create a target folder on host if does not exist</span><span>
</span><span>$TARGETROOT</span><span> </span><span>=</span><span> </span><span>"\\$server\$drive\logs"</span><span>
</span><span>if</span><span>(</span><span>!</span><span>(</span><span>Test-Path</span><span> </span><span>-Path</span><span>  </span><span>$TARGETROOT</span><span>)</span><span>)</span><span>{</span><span>
</span><span>New-Item</span><span> </span><span>-ItemType</span><span> directory </span><span>-Path</span><span>  </span><span>$TARGETROOT</span><span>
</span><span>}</span><span>
 
</span><span># This is the WMI call to select the application log from each server</span><span>
</span><span>$logFile</span><span> </span><span>=</span><span> </span><span>Get-WmiObject</span><span> </span><span>-</span><span>EnableAllPrivileges </span><span>-ComputerName</span><span> </span><span>$server</span><span> Win32_NTEventlogFile </span><span>|</span><span> </span><span>Where-Object</span><span> </span><span>{</span><span>$_</span><span>.logfilename </span><span>-eq</span><span> </span><span>$EventLogName</span><span>}</span><span>
 
</span><span># Creating a file name based on server, log and time</span><span>
</span><span>$exportFileName</span><span> </span><span>=</span><span> </span><span>$server</span><span> </span><span>+</span><span> “_” </span><span>+</span><span> </span><span>$EventLogName</span><span> </span><span>+</span><span> “_” </span><span>+</span><span>(</span><span>get-date</span><span> </span><span>-f</span><span> yyyyMMdd</span><span>)</span><span> </span><span>+</span><span> “.evt”
 
</span><span># Perform the backup</span><span>
</span><span>$logFile</span><span>.backupeventlog</span><span>(</span><span>$TARGETROOT</span><span> </span><span>+</span><span> “\” </span><span>+</span><span> </span><span>$exportFileName</span><span>)</span><span>
 
</span><span># Create an export folder if it does not exist</span><span>
</span><span>$target</span><span> </span><span>=</span><span> </span><span>"\\$dest\$drive\logs\export"</span><span>
</span><span>if</span><span>(</span><span>!</span><span>(</span><span>Test-Path</span><span> </span><span>-Path</span><span>  </span><span>$target</span><span>)</span><span>)</span><span>{</span><span>
</span><span>New-Item</span><span> </span><span>-ItemType</span><span> directory </span><span>-Path</span><span> </span><span>$target</span><span>
</span><span>}</span><span>
 
</span><span># Since WMI does the work on the remote machine you can’t copy to file share.</span><span>
 
</span><span># This is a workaround to move to files to a single location after the backup</span><span>
</span><span>Move-Item</span><span> </span><span>$TARGETROOT</span><span>\</span><span>$exportFileName</span><span> </span><span>$target</span><span>
</span><span>}</span>

<span># Since WMI does the work on the remote machine you can’t copy to file share.
# This is a workaround to move to files to a single location after the backup
Move-Item $TARGETROOT\$exportFileName $target</span>
<span>} </span></pre>
<h1>What does it the script do?</h1>
<ol>
 	<li>This script will read a list of servers and backup the specified event logs to a local folder on the source servers.</li>
 	<li>After the backup is complete it will move the event logs files to network share specified by the destination, so all backed up files are stored in a single location.</li>
</ol>
&nbsp;

Server List and Script completion example:

<img width="727" height="349" alt="" src="https://i1.wp.com/mikesblogs.net/wp-content/uploads/2019/06/060619_0200_Scripttobac1.png?w=1280&amp;ssl=1" />

&nbsp;

I hope you find this useful the next time you need to backup event logs from multiple servers.]]></content:encoded>
    </item>
    <item>
      <title>My Blog Site is Moving</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/my-blog-site-is-moving</link>
      <pubDate>Wed, 03 Apr 2019 04:10:52 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=2075</guid>
      <description><![CDATA[Hello All,

Just a quick note that my blog will be moving to a new home.

You will find my new...]]></description>
      <content:encoded><![CDATA[Hello All,

Just a quick note that my blog will be moving to a new home.

You will find my new blogs here:<a href="https://mikesblogs.net"> https://mikesblogs.net</a>

Thanks for visting!

-Mike

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>SharePoint / How is mail deleted from the “DROP” Folder?</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/sharepoint-how-is-mail-deleted-from-the-drop-folder</link>
      <pubDate>Mon, 11 Mar 2019 21:52:22 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=2065</guid>
      <description><![CDATA[Summary
I recently worked on a case that involved slow incoming mail destined to SharePoint...]]></description>
      <content:encoded><![CDATA[<h1>Summary</h1>
I recently worked on a case that involved slow incoming mail destined to SharePoint libraries. We found the problem was caused by a buildup of mail in the "drop" folders across multiple servers. Looking closer at the issue, we found that most of the messages were intended for aliases that no longer existed.

&nbsp;

Example:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2019/03/031119_1642_SharePointH1.png" />

&nbsp;

03/11/2019 12:19:09.61    OWSTIMER.EXE (0x2DB0)    0x2598    SharePoint Foundation    E-Mail    6871    Information    The Incoming E-Mail service has completed a batch. The elapsed time was 00:00:00. The service processed 3 message(s) in total. Errors occurred processing 3 message(s): Message ID: Message ID: Message ID: The following aliases were unknown: <span style="background-color: yellow">docs72<span style="background-color: #ffffff"> </span></span><span style="background-color: lime">docs74<span style="background-color: #ffffff"> </span></span><span style="background-color: aqua">docs73</span>    9dfbc79e-e62a-a083-7f7d-713af476a4e7

&nbsp;

After the drop folder accumulates about 400 files, it prolongs the "<strong>job-email-delivery</strong>" timer job and can cause delivery delays.
<h1></h1>
<h1>What was done?</h1>
To resolve this issue, we provided a few scripts to keep the drop folder clean, by moving messages destined an unknown aliases to a holding folder and managed outside of the drop folder.

&nbsp;

The first script uses a "search string" to match the unknown alias found the ULS events.

&nbsp;

Example:
<pre style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#########################
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Move Mail based on name#
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#########################</span>
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$SrcDir<span style="color: #001000"> </span></span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: darkred">"c:\inetpub\mailroot\drop"</span>
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$DestDir<span style="color: #001000"> </span></span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: darkred">"c:\inetpub\mailroot\badmail\spmail"</span>
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkblue">
if</span>(<span style="color: darkgray">!</span>(<span style="color: blue">Test-Path<span style="color: #001000"> </span></span><span style="color: navy">-Path<span style="color: #001000"> </span></span><span style="color: blueviolet">c:\inetpub\mailroot\badmail\spmail</span>)){
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">New-Item<span style="color: #001000"> </span></span><span style="color: navy">-ItemType<span style="color: #001000"> </span></span><span style="color: blueviolet">directory<span style="color: #001000"> </span></span><span style="color: navy">-Path<span style="color: #001000"> </span></span><span style="color: orangered">$DestDir</span></span><span style="font-family: Lucida Console;font-size: 9pt">}
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">
$SearchString<span style="color: #001000"> </span></span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: darkred">"To: <span style="background-color: yellow">&lt;docs72@sp2016.com</span>&gt;"</span></span>
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Get-Childitem<span style="color: #001000"> </span></span><span style="color: orangered">$SrcDir<span style="color: #001000"> </span></span><span style="color: navy">-filter<span style="color: #001000"> </span></span><span style="color: blueviolet">*.eml<span style="color: #001000"> </span></span><span style="color: darkgray">|<span style="color: #001000"> </span></span><span style="color: blue">?</span> {<span style="color: blue">select-string<span style="color: #001000"> </span></span><span style="color: orangered">$SearchString<span style="color: #001000"> </span></span><span style="color: orangered">$_<span style="color: #001000"> </span></span><span style="color: navy">-quiet</span>} <span style="color: darkgray">|<span style="color: #001000"> </span></span><span style="color: blue">move-item<span style="color: #001000"> </span></span><span style="color: navy">-Destination<span style="color: #001000"> </span></span><span style="color: orangered">$DestDir</span>
</span></pre>
&nbsp;

The 2<sup>nd</sup> script simply moved any message that was not processed after 10 minutes. So, after cleaning up all the known badmail, nothing should last longer than 10 minutes. If so, assume its bad and move it.

&nbsp;

Example:
<pre style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">############################</span>
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Move Mail after 10 minutes#</span>
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">############################</span>
</span>
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$SrcDir </span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: darkred">"c:\inetpub\mailroot\drop"</span>
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$DestDir </span><span style="color: darkgray">= </span><span style="color: darkred">"c:\inetpub\mailroot\badmail\spmail"</span>
</span>
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkblue">if</span>(<span style="color: darkgray">!</span>(<span style="color: blue">Test-Path<span style="color: #001000"> </span></span><span style="color: navy">-Path<span style="color: #001000"> </span></span><span style="color: blueviolet">c:\inetpub\mailroot\badmail\spmail</span>)){
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">New-Item<span style="color: #001000"> </span></span><span style="color: navy">-ItemType<span style="color: #001000"> </span></span><span style="color: blueviolet">directory<span style="color: #001000"> </span></span><span style="color: navy">-Path<span style="color: #001000"> </span></span><span style="color: orangered">$DestDir</span></span><span style="font-family: Lucida Console;font-size: 9pt">}
</span>
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkblue">Foreach</span>(<span style="color: orangered">$file<span style="color: #001000"> </span></span><span style="color: darkblue">in</span> (<span style="color: blue">Get-ChildItem<span style="color: #001000"> </span></span><span style="color: orangered">$SrcDir</span>))
</span><span style="font-family: Lucida Console;font-size: 9pt">{
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkblue">If</span>(<span style="color: orangered">$file<span style="color: darkgray">.</span>LastWriteTime <span style="color: darkgray">-lt</span> (<span style="color: blue">Get-Date</span>)<span style="color: darkgray">.</span>AddMinutes(<span style="color: purple">+10</span>))
</span></span><span style="font-family: Lucida Console;font-size: 9pt">{</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Move-Item<span style="color: #001000"> </span></span><span style="color: navy">-Path<span style="color: #001000"> </span></span><span style="color: orangered">$file<span style="color: darkgray">.</span>fullname <span style="color: navy">-Destination</span> $DestDir</span></span><span style="font-family: Lucida Console;font-size: 9pt">}</span>
<span style="font-family: Lucida Console;font-size: 9pt">}
</span></pre>
<h1></h1>
<h1>How does SharePoint handle it?</h1>
&nbsp;

SharePoint does delete mail directly from the drop folder if it has not been processed after 24 hours via the OWSTIMER process and within the timer job.

&nbsp;

Example:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2019/03/031119_1642_SharePointH2.png" />

&nbsp;

As you can see from <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/procmon">PROCMON</a> , the OWSTIMER deletes the "eml" file directly from the DROP folder. However, since each bad mail will take 24 hours to be deleted, expect a large queue of messages in the drop folder on busy farms.
<h1></h1>
<h1>Conclusion</h1>
If you are in the process of a migration, chances are you will have e-mail destined to folders that no longer exist. Once a large build up of mail is created in the drop folder, expect delays. However, I hope this blog creates awareness and helps you manage the issue more efficiently, if you find yourself in this situation in the future.]]></content:encoded>
    </item>
    <item>
      <title>How to disable the modern experience in SharePoint 2019</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/how-to-disable-the-modern-experience-in-sharepoint-2019</link>
      <pubDate>Wed, 21 Nov 2018 00:34:42 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=2025</guid>
      <description><![CDATA[Summary
SharePoint 2019 delivers an updated modern look and feel for lists and libraries and...]]></description>
      <content:encoded><![CDATA[<h1>Summary</h1>
SharePoint 2019 delivers an updated modern look and feel for lists and libraries and enabled by default.

Modern:                                                                                                                                                              Classic:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/11/112018_1920_Howtodisabl1.png" />        <img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/11/112018_1920_Howtodisabl2.png" />

However, if the classic experience is required for your farm, the modern experience can be disabled.
<h1>How to modify the default experience for list and libraries as a user</h1>
From the user perspective, switching from modern and classic is a simple click.

For example, users will see <img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/11/112018_1920_Howtodisabl3.png" /> all lists and libraries. Once in classic mode, you will then see <img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/11/112018_1920_Howtodisabl4.png" /> to return to modern mode.
<h1>How to modify the default experience for list and libraries as an Admin</h1>
Admins can manage the default experience for list and libraries at the site collection, web or library level.
<h2>To change disable / re-enable the modern user experience at the site collection level</h2>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Site Collection Level
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Add-PSSnapin<span style="color: #001000"> </span></span><span style="color: blueviolet">microsoft.sharepoint.powershell<span style="color: #001000"> </span></span><span style="color: navy">-ea<span style="color: #001000"> </span></span><span style="color: purple">0
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$site<span style="color: #001000"> </span></span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: blue">Get-SPSite<span style="color: #001000"> </span></span><span style="color: blueviolet">https://spwfe</span>
</span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Disable modern Lists and libraies at the Site Collection Level
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$featureguid<span style="color: #001000"> </span></span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: blue">new-object<span style="color: #001000"> </span></span><span style="color: blueviolet">System.Guid<span style="color: #001000"> </span></span><span style="color: darkred">"E3540C7D-6BEA-403C-A224-1A12EAFEE4C4"
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$site<span style="color: darkgray">.</span>Features<span style="color: darkgray">.</span>Add($featureguid<span style="color: darkgray">,</span> $true</span>)
</span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Re-enable the moden expirence at the site collection Level.
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$featureguid<span style="color: #001000"> </span></span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: blue">new-object<span style="color: #001000"> </span></span><span style="color: blueviolet">System.Guid<span style="color: #001000"> </span></span><span style="color: darkred">"E3540C7D-6BEA-403C-A224-1A12EAFEE4C4"
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$site<span style="color: darkgray">.</span>Features<span style="color: darkgray">.</span>Remove($featureguid<span style="color: darkgray">,</span> $true</span>)
</span></p>

<h2>To change disable / re-enable the modern user experience at the web level</h2>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Web Level
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Add-PSSnapin<span style="color: #001000"> </span></span><span style="color: blueviolet">microsoft.sharepoint.powershell<span style="color: #001000"> </span></span><span style="color: navy">-ea<span style="color: #001000"> </span></span><span style="color: purple">0
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$site<span style="color: #001000"> </span></span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: blue">Get-SPWeb<span style="color: #001000"> </span></span><span style="color: blueviolet">https://spwfe</span>
</span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Disable modern Lists and libraies at the Web Level.
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$featureguid<span style="color: #001000"> </span></span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: blue">new-object<span style="color: #001000"> </span></span><span style="color: blueviolet">System.Guid<span style="color: #001000"> </span></span><span style="color: darkred">"52E14B6F-B1BB-4969-B89B-C4FAA56745EF"
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$site<span style="color: darkgray">.</span>Features<span style="color: darkgray">.</span>Add($featureguid<span style="color: darkgray">,</span> $true</span>)
</span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Re-enable the moden expirence at the Web Level
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$featureguid<span style="color: #001000"> </span></span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: blue">new-object<span style="color: #001000"> </span></span><span style="color: blueviolet">System.Guid<span style="color: #001000"> </span></span><span style="color: darkred">"52E14B6F-B1BB-4969-B89B-C4FAA56745EF"
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$site<span style="color: darkgray">.</span>Features<span style="color: darkgray">.</span>Remove($featureguid<span style="color: darkgray">,</span> $true</span>)
</span></p>

<h2>To change disable / re-enable the modern user experience at the library level</h2>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Add-PSSnapin<span style="color: #001000"> </span></span><span style="color: blueviolet">microsoft.sharepoint.powershell<span style="color: #001000"> </span></span><span style="color: navy">-ea<span style="color: #001000"> </span></span><span style="color: purple">0
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$web </span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: blue">Get-SPWeb<span style="color: #001000"> </span></span><span style="color: blueviolet">https://spwfe
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$list </span><span style="color: darkgray">=<span style="color: #001000"> </span></span><span style="color: orangered">$web<span style="color: darkgray">.</span>Lists<span style="color: darkgray">[<span style="color: darkred">"Documents"<span style="color: darkgray">]</span>
</span></span></span></span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Classic setting
</span></span><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$list<span style="color: darkgray">.</span>ListExperienceOptions <span style="color: darkgray">=<span style="color: #005590"> </span></span><span style="color: darkred">"ClassicExperience"
</span></span><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$list<span style="color: darkgray">.</span>Update()
</span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#Modern setting
</span></span><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$list<span style="color: darkgray">.</span>ListExperienceOptions <span style="color: darkgray">= </span><span style="color: darkred">"NewExperience"
</span></span><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$list<span style="color: darkgray">.</span>Update()
</span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkgreen">#User Default
</span></span><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$list<span style="color: darkgray">.</span>ListExperienceOptions <span style="color: darkgray">= </span><span style="color: darkred">"Auto"
</span></span><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$list<span style="color: darkgray">.</span>Update()
</span></p>

<h1>More Information</h1>
I hope you found this tip useful, and if you are interested in the SPO equivalent, see the following articles.

<a href="https://support.office.com/en-us/article/switch-the-default-experience-for-lists-or-document-libraries-from-new-or-classic-66dac24b-4177-4775-bf50-3d267318caa9?ui=en-US&amp;rs=en-US&amp;ad=US">Switch the default experience for lists or document libraries from new or classic</a>

<a href="https://docs.microsoft.com/en-us/sharepoint/change-default-list-and-library-experience?redirectSourcePath=%252fen-us%252farticle%252fchange-the-default-list-and-library-experience-a0d90eaf-5755-4b8d-96ee-9e25bdf9114e">Change the default list and library experience</a>]]></content:encoded>
    </item>
    <item>
      <title>Is SMTP Auth Really Working?</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/is-smtp-auth-really-working</link>
      <pubDate>Sat, 22 Sep 2018 00:28:51 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=1975</guid>
      <description><![CDATA[Summary
Now that SharePoint 2019 supports SMTP authentication you have the option to relay e-mail...]]></description>
      <content:encoded><![CDATA[<h1>Summary</h1>
Now that SharePoint 2019 supports SMTP authentication you have the option to relay e-mail from SharePoint to any SMTP server that supports SMTP authentication. However, if you are using a port that falls back to anonymous, how do you if it's authenticating and not just falling back to anonymous?
<h1>Let's look at the traffic behind the covers</h1>
To answer the question, you really need to inspect the traffic on the wire. Below I have provided 4 scenarios which customers may see when attempting to configure SMTP Auth with on-prem Exchange Servers.
<h3>Scenario 1: Auth working with port 587 over Kerberos</h3>
Here you will find a working configuration where SharePoint is set to use port 587 and SMTP Auth over Kerberos. This worked well without errors and the outcome was expected.

Conversation on the wire:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR1.png" />

<span style="text-decoration: underline">Exchange Receive Connector Permissions:
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR2.png" />

<span style="text-decoration: underline">SharePoint SMTP Auth Settings:
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR3.png" />
<h3>Scenario 2: Auth working with port 25 over NTLM</h3>
Here you will find a working configuration where SharePoint is set to use port 25 and SMTP Auth over NTLM. This worked well without errors and the outcome was expected.

<span style="text-decoration: underline">Conversation on the wire:
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR4.png" />

<span style="text-decoration: underline">SharePoint SMTP Auth Setting:
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR5.png" />

<span style="text-decoration: underline">Exchange Receive Connector Permissions:
</span>

Take special note to this Exchange Receive Connector permission group settings. "Exchange Users" is enabled. SMTP Auth (as a user) <span style="text-decoration: underline"><strong>requires</strong></span> the "<strong>Exchange Users</strong>" permission group, which is <span style="text-decoration: underline">not on by default</span> for the "<strong>Default Frontend SERVERNAME" </strong>receive connector, which listens on port 25.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR6.png" />
<h3>Scenario 3: Somewhat working with port 25 over NTLM</h3>
Here you will find a "somewhat working" configuration where SharePoint is set to use port 25 over NTLM and SMTP Auth. However, the e-mail <span style="text-decoration: underline">was sent</span>, but anonymous was used instead of user authentication as expected. This failure occurred due to a configuration error, which is described below.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR7.png" />

<span style="text-decoration: underline">Errors Text:
</span>

Response: 535 5.7.3 Authentication unsuccessful\r\n

Response code: <span style="color: red"><strong>Authentication credentials invalid (535)</strong></span>

Response parameter: <span style="color: red"><strong>5.7.3 Authentication unsuccessful</strong></span>

&nbsp;

<span style="text-decoration: underline">SharePoint SMTP Auth Setting:
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR8.png" />

<span style="text-decoration: underline">Exchange Receive Connector Permissions:
</span>

Take special note to this Exchange Receive Connector permission group settings, as this <span style="text-decoration: underline">is the default</span> setting. SMTP Auth (as a user) <span style="text-decoration: underline"><strong>requires</strong></span> the "<strong>Exchange Users</strong>" permission group, which is <span style="text-decoration: underline">not on by default</span> for the "<strong>Default Frontend EXCHANGE" </strong>receive connector, which listens on port 25.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR9.png" />
<h3>Scenario 4: Not working with port 587 over Kerberos</h3>
Here you will find a "non-working" configuration where SharePoint is set to use port 587 over Kerberos and SMTP Auth. This resulted in failure after 3 attempts due to a configuration error, which is described below.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR10.png" />

<span style="text-decoration: underline">Errors Text:
</span>

Response: 535 5.7.3 Unable to proxy authenticated session because either the backend does not support it or failed to resolve the user\r\n

Response code: <span style="color: red"><strong>Authentication credentials invalid (535)</strong></span>

Response parameter: <span style="color: red"><strong>5.7.3 Unable to proxy authenticated session because either the backend does not support it or failed to resolve the user</strong></span>

Response: 530 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM\r\n

Response code: <span style="color: red"><strong>Authentication required (530)</strong></span>

Response parameter<span style="color: red"><strong>: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM</strong></span>

<span style="text-decoration: underline">SharePoint SMTP Auth Setting:
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR11.png" />

<span style="text-decoration: underline">Exchange Receive Connector Permissions:
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR12.png" />
<h1>Why is this happening?</h1>
There are several reasons why SharePoint SMTP authentication can fail, and I will list the reasons I'm aware of here.

&nbsp;

<strong>1. Missing UPN:</strong> If the authenticating user does not have a UPN set, authentication will fail with error "<span style="color: red">5.7.3 Unable to proxy authenticated session because either the backend does not support it or failed to resolve the user</span>". If you see this error, check the user configured in the SharePoint outing e-mail settings,  to determine if the UPN is set. There are many ways to accomplish this, but I will show you the PowerShell method.

&nbsp;

Check with Get-ADUser:
<pre style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Get-ADUser </span><span style="color: blueviolet">spadmin</span>
</span>
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">DistinguishedName </span><span style="color: blueviolet">: </span><span style="color: blueviolet">CN=SpAdmin<span style="color: darkgray">,<span style="color: blueviolet">OU=SpService<span style="color: darkgray">,<span style="color: blueviolet">DC=contoso<span style="color: darkgray">,<span style="color: blueviolet">DC=com
</span></span></span></span></span></span></span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Enabled </span><span style="color: blueviolet">: </span><span style="color: blueviolet">True
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">GivenName </span><span style="color: blueviolet">:
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Name </span><span style="color: blueviolet">: </span><span style="color: blueviolet">SpAdmin
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">ObjectClass </span><span style="color: blueviolet">: </span><span style="color: blueviolet">user
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">ObjectGUID </span><span style="color: blueviolet">: </span><span style="color: blueviolet">070d91df-5240-4569-8c1c-415bc9c20872
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">SamAccountName </span><span style="color: blueviolet">: </span><span style="color: blueviolet">SpAdmin
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">SID </span><span style="color: blueviolet">: </span><span style="color: blueviolet">S-1-5-21-1111111111-111111111-111111111-1111
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Surname </span><span style="color: blueviolet">:
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue;background-color: yellow">UserPrincipalName </span><span style="background-color: yellow"><span style="color: blueviolet">:</span></span></span></pre>
Set the UPN for the SMTP Authenticating Account:
<pre style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Set-ADUser </span><span style="color: blueviolet">spadmin </span><span style="color: navy">-UserPrincipalName </span><span style="color: blueviolet">spadmin@contoso.com</span></span></pre>
<p style="background: white">Now Get it account one more time:</p>

<pre style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Get-ADUser </span><span style="color: blueviolet">spadmin</span>
</span>
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">DistinguishedName </span><span style="color: blueviolet">: </span><span style="color: blueviolet">CN=SpAdmin<span style="color: darkgray">,<span style="color: blueviolet">OU=SpService<span style="color: darkgray">,<span style="color: blueviolet">DC=contoso<span style="color: darkgray">,<span style="color: blueviolet">DC=com
</span></span></span></span></span></span></span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Enabled </span><span style="color: blueviolet">: </span><span style="color: blueviolet">True
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">GivenName </span><span style="color: blueviolet">:
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Name </span><span style="color: blueviolet">: </span><span style="color: blueviolet">SpAdmin
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">ObjectClass </span><span style="color: blueviolet">: </span><span style="color: blueviolet">user
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">ObjectGUID </span><span style="color: blueviolet">: </span><span style="color: blueviolet">070d91df-5240-4569-8c1c-415bc9c20872
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">SamAccountName </span><span style="color: blueviolet">: </span><span style="color: blueviolet">SpAdmin
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">SID </span><span style="color: blueviolet">: </span><span style="color: blueviolet">S-1-5-21-1111111111-111111111-111111111-1111
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Surname </span><span style="color: blueviolet">:
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue;background-color: yellow">UserPrincipalName </span><span style="background-color: yellow"><span style="color: blueviolet">: </span><span style="color: blueviolet">spadmin@contoso.com</span></span>
</span></pre>
Note: Now the UPN is set
<div></div>
<div><strong>2. Incorrect Exchange Receive Connector permissions:</strong> As stated above if you are authenticating over SMTP as a user, the "<strong>Exchange Users</strong>" permission group must be enabled on the Exchange Receive Connector properties. If this permission is missing, SMTP authentication will fail with error, "<span style="color: red">Authentication credentials invalid (535)</span>".</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/09/092118_1841_IsSMTPAuthR13.png" />
<div></div>
<div><strong>3. Kerberos requires SPNs:</strong> If the SharePoint Server is missing the SMTPSVC Service Principal Name, authenticating over Kerberos may fail.</div>
&nbsp;

Example of a missing SPN:
<pre style="background: white"><strong><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">setspn </span><span style="color: navy">-l </span><span style="color: blueviolet">contoso\spwfe</span></span></strong></pre>
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Registered </span><span style="color: blueviolet">ServicePrincipalNames </span><span style="color: blueviolet">for </span><span style="color: blueviolet">CN=SPWFE<span style="color: darkgray">,CN=Computers,DC=contoso,DC=com:
</span></span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">TERMSRV/SPWFE
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">TERMSRV/spwfe.contoso.com
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">WSMAN/spwfe
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">WSMAN/spwfe.contoso.com
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">RestrictedKrbHost/SPWFE
</span></span><span style="color: blue;font-family: 'Lucida Console';font-size: 9pt">HOST/SPWFE
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">RestrictedKrbHost/spwfe.contoso.com
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">HOST/spwfe.contoso.com</span></span>

&nbsp;

Set the SPN with NETBIOS Name:
<pre><span style="font-family: Lucida Console;font-size: 9pt"><strong><span style="color: blue">setspn </span><span style="color: navy">-s </span><span style="color: blueviolet">SMTPSVC/spwfe </span><span style="color: blueviolet">contoso\SPWFE</span>
</strong></span></pre>
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Checking </span><span style="color: blueviolet">domain </span><span style="color: blueviolet">DC=contoso<span style="color: darkgray">,<span style="color: blueviolet">DC=com
</span></span></span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Registering </span><span style="color: blueviolet">ServicePrincipalNames </span><span style="color: blueviolet">for </span><span style="color: blueviolet">CN=SPWFE<span style="color: darkgray">,<span style="color: blueviolet">CN=Computers<span style="color: darkgray">,<span style="color: blueviolet">DC=contoso<span style="color: darkgray">,<span style="color: blueviolet">DC=com:
</span></span></span></span></span></span></span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">SMTPSVC/spwfe
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue"></span></span> <span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Updated </span><span style="color: blueviolet">object</span>
</span>

&nbsp;
<p style="background: white">Set the SPN with FQDN:
<span style="font-family: Lucida Console;font-size: 9pt"><strong><span style="color: blue"></span></strong></span></p>

<pre style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><strong><span style="color: blue">setspn </span><span style="color: navy">-s </span><span style="color: blueviolet">SMTPSVC/spwfe.contoso.com </span><span style="color: blueviolet">contoso\SPWFE</span> </strong></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">
</span></span></pre>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Checking </span><span style="color: blueviolet">domain </span><span style="color: blueviolet">DC=contoso<span style="color: darkgray">,<span style="color: blueviolet">DC=com
</span></span></span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Registering </span><span style="color: blueviolet">ServicePrincipalNames </span><span style="color: blueviolet">for </span><span style="color: blueviolet">CN=SPWFE<span style="color: darkgray">,<span style="color: blueviolet">CN=Computers<span style="color: darkgray">,<span style="color: blueviolet">DC=contoso<span style="color: darkgray">,<span style="color: blueviolet">DC=com:
</span></span></span></span></span></span></span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">SMTPSVC/spwfe.contoso.com </span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue"></span></span>
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Updated </span><span style="color: blueviolet">object
</span></span></p>
&nbsp;
<p style="background: white">Get the SPNs once again:
<span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue"></span></span></p>

<pre style="background: white"><strong><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">setspn </span><span style="color: navy">-l </span><span style="color: blueviolet">contoso\spwfe</span></span></strong></pre>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Registered </span><span style="color: blueviolet">ServicePrincipalNames </span><span style="color: blueviolet">for </span><span style="color: blueviolet">CN=SPWFE<span style="color: darkgray">,<span style="color: blueviolet">CN=Computers<span style="color: darkgray">,<span style="color: blueviolet">DC=contoso<span style="color: darkgray">,<span style="color: blueviolet">DC=com:
</span></span></span></span></span></span></span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue;background-color: yellow">SMTPSVC/spwfe.contoso.com
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue;background-color: yellow">SMTPSVC/spwfe
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">TERMSRV/SPWFE
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">TERMSRV/spwfe.contoso.com
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">WSMAN/spwfe
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">WSMAN/spwfe.contoso.com
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">RestrictedKrbHost/SPWFE
</span></span><span style="color: blue;font-family: 'Lucida Console';font-size: 9pt">HOST/SPWFE </span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">RestrictedKrb
Host/spwfe.contoso.com
</span></span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">HOST/spwfe.contoso.com </span></span></p>
&nbsp;
<h1>Summary</h1>
In summary don't set it and forget it! After configuring your SharePoint Server to use SMTP Authentication, check your network traffic to ensure its working as expected. You may need to work with your Active Directory (to set SPNs) and Exchange Team (to set connector properties) to ensure that E-mail is being sent using authentication. Also, if you came here because this blog matches the errors you are experiencing, I hope this helped you figure out the problem quickly.

Thanks for reading!]]></content:encoded>
    </item>
    <item>
      <title>SharePoint requests fail when memory is low</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/sharepoint-requests-fail-when-memory-is-low</link>
      <pubDate>Sat, 11 Aug 2018 01:21:00 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=1825</guid>
      <description><![CDATA[Summary
When working in virtual labs, I don't always adhere to best practices. For example, we all...]]></description>
      <content:encoded><![CDATA[<h1>Summary</h1>
When working in virtual labs, I don't always adhere to best practices. For example, we all know the <a href="https://docs.microsoft.com/en-us/sharepoint/install/hardware-and-software-requirements">minimum memory</a> recommendation for SharePoint is 16GB for production use. So, when testing in my labs, SharePoint web requests may fail. As a result, I find myself troubleshooting the issue, only to find the failure was caused by low memory. I have many SharePoint Farms and many VM's for testing, which covers all supported versions. So, one would think I have learned my lesson and simply provision all my virtual machines with at least 16GB's of memory. Well I can't because physical memory on the VM host is not limitless and I can create way more VM's if use less memory.
<h1></h1>
<h1>So why am I telling you this?</h1>
Mainly it's for me, so I can find the solution easily when this occurs again (and it will). However, I wanted to share my latest symptom which may help someone in the future.
<h1></h1>
<h1>Issue:</h1>
Unable to access a SharePoint site with SharePoint Designer, it was failing with error "<strong>The server could not complete your request</strong>."

Example:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/081018_2008_SharePointr1.png" />

Clicking on "Details" provided no additional information.
<h1></h1>
<h1>Cause:</h1>
Since I kind of spoiled it above, you already know its low memory. By default, when memory is below the 5% of the total memory, "Memory gate checking" at the IIS level kicks in and causes SharePoint failures.

If you think this issue is occurring, look in the application event logs during this failure, you may find the following event.

<span style="font-family: Consolas;font-size: 9pt">Log Name: Application
Source: System.ServiceModel 4.0.0.0
Date: 8/10/2018 2:30:15 PM
Event ID: 3
Task Category: WebHost
Level: Error
Keywords: Classic
User: contoso\spservice
Computer: sp
</span>

<span style="font-family: Consolas;font-size: 9pt">Description:
WebHost failed to process a request.
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/56528276
Exception: System.ServiceModel.ServiceActivationException: The service <span style="background-color: aqua">'/b464bf6ac4fd49f986be1900c0ff4950/MetadataWebService.svc'</span> cannot be activated due to an exception during compilation. The exception message is: Memory gates checking failed because the free memory (149831680 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.. ---&gt; <span style="background-color: yellow">System.InsufficientMemoryException: Memory gates checking failed because the free memory (149831680 bytes) is less than 5% of total memory</span>. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
</span>

<span style="font-family: Consolas;font-size: 9pt">at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64&amp; availableMemoryBytes)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
</span>

<span style="font-family: Consolas;font-size: 9pt">--- End of inner exception stack trace ---
</span>

<span style="font-family: Consolas;font-size: 9pt">at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)
</span>

<span style="font-family: Consolas;font-size: 9pt"> Process Name: w3wp
Process ID: 2360
</span>
<h1></h1>
<h1>Workaround:</h1>
To workaround this issue set the "<strong>minFreeMemoryPercentageToActivateService</strong>" to "0" in the web.config for the <span style="text-decoration: underline"><strong>services web application</strong></span> (not the site), which effectively disables "Memory gate checking".

&nbsp;

Example:
<pre><span style="font-family: Courier New">&lt;system.serviceModel&gt;
</span><span style="font-family: Courier New">&lt;serviceHostingEnvironment minFreeMemoryPercentageToActivateService="0" /&gt;
</span><span style="font-family: Courier New">&lt;/system.serviceModel&gt;
</span></pre>
&nbsp;

Steps:
<ol>
 	<li>
<div>From IIS Manager, right click on the service web app and choose "Explore".</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/081018_2008_SharePointr2.png" /></li>
 	<li>
<div>You will see a folder that contains the web.config.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/081018_2008_SharePointr3.png" /></li>
 	<li>
<div>Make a backup copy of the web.config (always a good practice).</div></li>
 	<li>
<div>

Add the "<em>minFreeMemoryPercentageToActivateService</em>" section previously described just above the "&lt;/configuration&gt;" closing tag.
<div></div>
&nbsp;

Example:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/081018_2008_SharePointr4.png" />

</div></li>
 	<li>
<div>Save the changes and trigger an <strong>IISRESET.</strong></div></li>
 	<li>
<div>Test the changes by accessing Central Admin and a Site Collection.</div></li>
 	<li>
<div>If all is good, you should be able to continue testing with your new settings.</div></li>
</ol>
&nbsp;
<h1>Disable Memory Checking from a Site Web Application</h1>
If your site (not web services) is generating low memory errors, it is possible to disable memory checking at this level as well. However, the web.config may already have a "system.serviceModel" section, so you will need to add the "minFreeMemoryPercentageToActivateService" setting within the current section.

&nbsp;

Example:

&nbsp;

Before the change:
<pre>&lt;system.serviceModel&gt;
&lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" /&gt;
&lt;/system.serviceModel&gt;</pre>
&nbsp;

After the changes:
<pre>&lt;system.serviceModel&gt;
&lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" <strong>minFreeMemoryPercentageToActivateService="0"</strong>/&gt;
&lt;/system.serviceModel&gt;</pre>
&nbsp;

Note: Simply add the setting to the current line separated by a space.

&nbsp;
<h1>Important Takeaways:</h1>
<ul>
 	<li>This is not a supported configuration and only should be used for testing functionally in test labs (not performance testing).</li>
 	<li>Applying CU's may reverse this setting if web.config changes are present in the update.</li>
 	<li>This is an IIS thing and not a SharePoint thing.</li>
 	<li>Low memory can occur on production servers as well, even if your server is configured with 16GB's or more.</li>
 	<li>Please do not use this setting on a production server, because if your server is running below 5% memory, it needs some attention and not a band-aid.</li>
</ul>
&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Does SharePoint 2019 still need the SMTP Service?</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/does-sharepoint-2019-still-need-the-smtp-service</link>
      <pubDate>Thu, 09 Aug 2018 01:11:00 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=1655</guid>
      <description><![CDATA[Summary
Now that SharePoint 2019 public preview has been released, the official deprecated /...]]></description>
      <content:encoded><![CDATA[<h1>Summary</h1>
Now that <a href="https://www.microsoft.com/en-us/download/details.aspx?id=57169">SharePoint 2019 public preview</a> has been released, the official <a href="https://docs.microsoft.com/en-us/sharepoint/what-s-new/what-s-deprecated-or-removed-from-sharepoint-server-2019">deprecated / removed</a> list has been published. After reading this you may have noticed that "<a href="https://docs.microsoft.com/en-us/sharepoint/what-s-new/what-s-deprecated-or-removed-from-sharepoint-server-2019">Incoming email automatic mode</a>" has been removed from the product.

&nbsp;
<p style="margin-left: 36pt"><em>Incoming email automatic mode
</em></p>
<p style="margin-left: 36pt"><em>As announced by the Windows Server team, Microsoft is <a href="https://docs.microsoft.com/windows-server/get-started/removed-features-1709">deprecating</a> the IIS 6 Management compatibility features in Internet Information Services (IIS). The automatic mode of the SharePoint incoming email feature relies on IIS 6 APIs to manage the IIS SMTP service. Because no alternative APIs exist to manage the IIS SMTP service, we are removing support for automatic mode in the incoming email feature of SharePoint Server 2019 Public Preview. Customers using incoming email are recommended to use advanced mode instead, which allows you to manually manage the IIS SMTP service and drop folder.
</em></p>
&nbsp;

Also, you may have seen my <a href="https://blogs.technet.microsoft.com/mikelee/2018/07/25/finally-smtp-authentication-included-with-sharepoint-2019/">blog</a> detailing the changes in SharePoint 2019 stating that the SMTP Authentication is now supported and we longer need a local SMTP server to support anonymous authentication.

&nbsp;

Lastly, the <a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh831568(v=ws.11)">SMTP Service</a> has been added to the deprecation list since Windows 2012 server.

&nbsp;
<p style="margin-left: 36pt"><em>SMTP
</em></p>
<p style="margin-left: 36pt"><em>SMTP and the associated management tools are deprecated. Though the functionality is still available in Windows Server 2012, you should begin using System.Net.Smtp. With this API, you will not be able to insert a message into a file for pickup; instead configure Web applications to connect on port 25 to another server using SMTP.
</em></p>
&nbsp;
<h1>So, what does this all mean?</h1>
SharePoint no longer "requires" a local SMTP service. SharePoint can still utilize the service to process incoming e-mail from the drop folder. However, it's not really "required".

&nbsp;

Incoming e-mail with <strong>advanced mode</strong> gives you a simple input "<strong>E-mail drop folder</strong>".

&nbsp;

Example:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo1.png" />

&nbsp;

When configuring advanced mode, Admin's must enter the drop folder location manually. Since the SharePoint Farm Service Account (the account running the timer service) only needs access to e-mail from a drop location, it can be local or remote file path that contains the incoming e-mail destined for the SharePoint Farm.

&nbsp;

Example:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo2.png" />
<h1>Wrapping it all up</h1>
When the time comes, and the SMTP service is removed from Windows, customers will need a method to route e-mail destined for Sharepoint to a Windows folder to process incoming e-mail. However, customers that still have an on-premises Exchange Server, a "<strong>Foreign Connector</strong>" can be used to route mail destined for SharePoint to a drop folder. Otherwise, a 3<sup>rd</sup> party solution may be required.
<h1></h1>
&nbsp;
<h1>Let's See the "Foreign Connector" solution in action!</h1>
&nbsp;
<div>1. Create a new connector in Exchange and specify correct address space to match the SharePoint Farm configuration.</div>
&nbsp;
<p style="padding-left: 30px">Example:</p>

<pre style="padding-left: 30px"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">New-ForeignConnector </span><span style="color: navy">-Name </span><span style="color: darkred">"SharePoint Email" </span><span style="color: navy">-AddressSpaces </span><span style="color: darkred">"SMTP:sp2019.net" </span><span style="color: navy">-SourceTransportServers </span><span style="color: darkred">"exch-server"</span></span></pre>
&nbsp;
<p style="padding-left: 30px">New-ForeignConnector</p>
<p style="padding-left: 30px"><a href="https://docs.microsoft.com/en-us/powershell/module/exchange/mail-flow/new-foreignconnector?view=exchange-ps">https://docs.microsoft.com/en-us/powershell/module/exchange/mail-flow/new-foreignconnector?view=exchange-ps</a></p>
&nbsp;

2. Set the new connector to the desired <strong>drop</strong> location.

&nbsp;
<p style="padding-left: 30px">Example:</p>

<pre style="padding-left: 30px"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Set-ForeignConnector </span><span style="color: darkred">"SharePoint Email" </span><span style="color: navy">-DropDirectory </span><span style="color: darkred">"C:\Program Files\Microsoft\Exchange Server\V15\SharePoint" </span></span></pre>
&nbsp;
<p style="padding-left: 30px">Set-ForeignConnector</p>
<p style="padding-left: 30px"><a href="https://docs.microsoft.com/en-us/powershell/module/exchange/mail-flow/set-foreignconnector?view=exchange-ps">https://docs.microsoft.com/en-us/powershell/module/exchange/mail-flow/set-foreignconnector?view=exchange-ps</a></p>
&nbsp;

3. Create the folder in the specified location.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo3.png" />

&nbsp;

4. Share the folder and edit the permissions to ensure that Exchange and the SharePoint Timer Service Account has full permissions.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo4.png" /><img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo5.png" /><img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo6.png" />

Note: I gave "everyone" full control at the folder level, but the SharePoint Service account full control at the sharing level.

&nbsp;

5. Now configure SharePoint to use the correct address space and drop location.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo7.png" />

&nbsp;

6. Configure a document library to receive mail.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo8.png" />

&nbsp;

7. Now test it by sending a message from Outlook.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo9.png" />

&nbsp;

&nbsp;

8. The e-mail should be delivered to the drop location, where SharePoint will process it when the incoming e-mail timer job is executed.

<img width="780" height="323" class="alignnone size-full wp-image-1775" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/mail_in_drop.png" />

&nbsp;

9. Success! The message was processed and delivered to the SharePoint Library

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/08/080918_1530_DoesSharePo11.png" />
<h1>Let's Recap</h1>
<ul>
 	<li>
<div>SharePoint 2019 will only support "<strong>Advanced Mode</strong>" to configure incoming e-mail.</div></li>
 	<li>
<div>SMTP Service is <strong>deprecated</strong> but still currently included with the latest version of Windows Server.</div>
Note: When products are deprecated, they can be removed at any time. So be ready.</li>
 	<li>
<div>SharePoint does not require a local SMTP Server, only a <strong>drop</strong> location to process incoming email.</div></li>
 	<li>
<div>An on-prem Exchange Server can utilize a "<strong>Foreign Connector</strong>" to route e-mail per address space to a drop location.</div></li>
 	<li>Setting this up in a lab was <span style="text-decoration: underline">a lot of fun</span>. If you don't agree try it :) .</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>Finally – SMTP Authentication included with SharePoint 2019</title>
      <link>https://docs.microsoft.com/archive/blogs/mikelee/finally-smtp-authentication-included-with-sharepoint-2019</link>
      <pubDate>Wed, 25 Jul 2018 21:42:43 GMT</pubDate>
      <dc:creator><![CDATA[Mike Lee [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/mikelee/?p=1625</guid>
      <description><![CDATA[Summary
On July 24, 2018 Microsoft has announced the availability of both SharePoint Server 2019...]]></description>
      <content:encoded><![CDATA[<h1>Summary</h1>
On July 24, 2018 Microsoft has <a href="https://techcommunity.microsoft.com/t5/Microsoft-SharePoint-Blog/Announcing-Availability-of-SharePoint-Server-2019-Preview/ba-p/214427">announced </a>the availability of both SharePoint Server 2019 Preview and Project Server 2019 Preview.

One of the features I'm excited about is <span style="text-decoration: underline"><strong>SMTP Authentication</strong></span> directly from SharePoint. This means, there is no need to setup a standalone SMTP relay just for SharePoint to send outgoing e-mail when authentication is required.

<span style="color: #333333;font-family: Segoe UI;font-size: 13pt">
</span>Example:<span style="color: #333333;font-family: Segoe UI;font-size: 13pt">
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP1.png" />
<h1></h1>
<h1>Configuration</h1>
SMTP Authentication can be configured from Central Admin within the outgoing mail settings.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP2.png" />
<p style="margin-left: 36pt"><em>Note: It's recommended to use account credentials that match the From address. If you wish to use credentials for a different account, ensure that account has "Send As" permission to impersonate the From address. Also, if you're using a Windows account to authenticate to the SMTP server, you can specify the user name using either the Universal Principal Name (UPN) format (user@domain.com) or the NT4 login format (DOMAIN\user). If you're using a non-Windows account to authenticate to the SMTP server, contact your email administrator to determine the correct user name format.</em></p>
&nbsp;

However, before storing the password, SMTP authentication requires an <strong>application credential key</strong> on each SharePoint server in the farm. If the key is not set before attempting to set the authentication, the following error will occur.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP3.png" />

To set the application credential key, run the following command on each SharePoint server, where "application credential key" is the password to be used to encrypt and decrypt the SMTP password.

PowerShell Example:
<pre style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$key </span><span style="color: darkgray">= </span><span style="color: blue">ConvertTo-SecureString </span><span style="color: navy">-AsPlainText </span><span style="color: navy">-Force </span><span style="color: darkred">"application credential key"</span>
</span><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: blue">Set-SPApplicationCredentialKey </span><span style="color: orangered">$key
</span></span></pre>
<p style="background: white">Repeat the command on each additional SharePoint server in the farm, using the same application credential key.</p>
If you want to remove the application credential key from the local server, use the <strong>Remove-SPApplicationCredentialKey</strong> cmdlet.
<h1></h1>
<h1>Health Monitoring</h1>
Along with the new support for SMTP Authentication, there is also a new Health Rule which check each server (at the server level) to ensure the outgoing email credentials are identical between all servers. If the credential hash is different the following health alert will be displayed.
<p style="margin-left: 36pt"><em>One or more servers can't retrieve the outgoing email credentials (SharePoint Server 2019)
</em></p>
<p style="margin-left: 36pt"><strong><em>SharePoint Server 2019
</em></strong></p>
<p style="margin-left: 36pt"><em><strong>Applies to:</strong> SharePoint Server 2019
</em></p>
<p style="margin-left: 36pt"><em><strong>Summary:</strong> Learn how to resolve the SharePoint Health Analyzer rule "One or more servers can't retrieve the outgoing email credentials" for SharePoint Server 2019.
</em></p>
<p style="margin-left: 36pt"><em><strong>Rule Name:</strong> One or more servers can't retrieve the outgoing email credentials.
</em></p>
<p style="margin-left: 36pt"><em><strong>Summary:</strong> At least one web application is configured to use authentication when sending email. There are one or more servers in this farm that can't retrieve the credentials used to authenticate to the outgoing email server. Without credentials, these servers can only send email anonymously.
</em></p>
<p style="margin-left: 36pt"><em><strong>Cause:</strong> The application credential key wasn't found on these servers or they don't have the same application credential key originally used to store the SMTP password. Every server in the farm must have an application credential key to store and retrieve the SMTP password. The application credential key must be identical on each server.
</em></p>
<p style="margin-left: 36pt"><em><strong>Resolution:</strong> Use the <strong>Set-SPApplicationCredentialKey</strong> command on each failing server to set the application credential key. If the current SMTP password was stored using a different application credential key, you must set the new application credential key on every server in the farm and then save the SMTP credentials again.
</em></p>

<h1></h1>
<h1>Testing Outgoing E-Mail with Authentication</h1>
In one my previous <a href="https://blogs.technet.microsoft.com/mikelee/2017/12/23/test-email-from-sharepoint-using-powershell/">blogs</a>, I provided a script to test outgoing e-mail from SharePoint using PowerShell.

Once SMTP Authentication is configured from outgoing e-mail, the script will use authentication.

If the script just reports "<span style="color: #70ad47"><strong>It Worked..Congrats!</strong><em>"</em></span>, how can one be sure it really worked?

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP4.png" />

One easy method is to use a network trace tool and analyze the SMTP conversation.

Note: If you are using TLS to encrypt the traffic, this will not work unless you can decrypt from the tool.

Let's see how it looks on the wire:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP5.png" />

Oh Wait! Why am I using NTLM? We should be using Kerberos!

Let's look at my outgoing e-mail settings:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP6.png" />

Let's see what the server is telling us when connecting to port 25:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP7.png" />

As you can see from above, only NTLM and Anonymous is advertised.

Since Kerberos is more secure and recommend, we should use port 587 from SharePoint, this is where anonymous is disabled, authentication is required and Kerberos is preferred.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP8.png" />

Now let's look at what the server advertises from port 587:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP9.png" />

As you can see, GSSAPI (Kerberos) is offered with NTLM and Anonymous is no longer displayed.

Now Let's see how it looks on the wire:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP10.png" />

Great News! Now we have proved that SharePoint is using SMTP Auth and Kerberos, all looks good!
<h1>Bonus Reading for Exchange Online Users</h1>
Since many customers use Exchange Online as their primary E-mail Server now, you may no longer have an on-prem Exchange Server. If this is the case, you in luck because SharePoint 2019 Server will support sending outgoing e-mail to your Exchange Online tenant using the "<strong>smtp.office365.com</strong>" relay.

Let's see how to the outgoing e-mail config will look in this case.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/07/072518_1637_FinallySMTP11.png" />

There are a few different ways to make this work. Please see the following article for more options if the recommended scenario does not work.

How to set up a multifunction device or application to send email using Office 365

<a href="https://support.office.com/en-us/article/How-to-set-up-a-multifunction-device-or-application-to-send-email-using-Office-365-69f58e99-c550-4274-ad18-c805d654b4c4">https://support.office.com/en-us/article/How-to-set-up-a-multifunction-device-or-application-to-send-email-using-Office-365-69f58e99-c550-4274-ad18-c805d654b4c4</a>]]></content:encoded>
    </item>
  </channel>
</rss>