<?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>bspieth</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/bspieth/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/bspieth/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:28:48 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Remove a missing Claims Provider from the SharePoint configuration database</title>
      <link>https://docs.microsoft.com/archive/blogs/bspieth/remove-a-missing-claims-provider-from-the-sharepoint-configuration-database</link>
      <pubDate>Tue, 31 May 2016 11:40:51 GMT</pubDate>
      <dc:creator><![CDATA[Bernd Spieth]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bspieth/?p=86</guid>
      <description><![CDATA[Currently I am developing a custom claims provider that connects to an identity store in the backend...]]></description>
      <content:encoded><![CDATA[Currently I am developing a custom claims provider that connects to an identity store in the backend to verify user names from the people picker (ADFS scenario).
One day the search stopped working and I checked the ULS logs to find the cause of the problem. The ULS log was full with errors of this type:
<pre>STS Call: Failed to issue new security token. Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Customer.ClaimsProvider.LDAP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9512c55e4a68ef80' or one of its dependencies. The system cannot find the file specified. File name: 'Customer.ClaimsProvider.LDAP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9512c55e4a68ef80'</pre>
SharePoint was right, I retracted the claims provider the other day. I redeployed the claims provider to check if that solves the problem but it doesn't, the error was still written to the ULS log. So I started PowerShell to get more information.

I executed the following cmdlets to get a reference to the claim provider manager and list the registerd claim providers:
<pre>$manager = Get-SPClaimProviderManager
$manager.ClaimProviders</pre>
<pre>DisplayName : System
 Description : Provides system claim data.
 IsEnabled : True
 IsUsedByDefault : True
 IsVisible : True
 AssemblyName : Microsoft.SharePoint, Version=15.0.0.0,
 Culture=neutral, PublicKeyToken=71e9bce111e9429c
 TypeName : Microsoft.SharePoint.Administration.Claims.SPSyst
 emClaimProvider
 ClaimProvider : Microsoft.SharePoint.Administration.Claims.SPSyst
 emClaimProvider
 ClaimProviderType : Microsoft.SharePoint.Administration.Claims.SPSyst
 emClaimProvider
 IsValid : True
 UpgradedPersistedProperties : {}</pre>
<pre>DisplayName : Active Directory
 Description : Active Directory claim data.
 IsEnabled : True
 IsUsedByDefault : False
 IsVisible : True
 AssemblyName : Microsoft.SharePoint, Version=15.0.0.0,
 Culture=neutral, PublicKeyToken=71e9bce111e9429c
 TypeName : Microsoft.SharePoint.Administration.Claims.SPActi
 veDirectoryClaimProvider
 ClaimProvider : Microsoft.SharePoint.Administration.Claims.SPActi
 veDirectoryClaimProvider
 ClaimProviderType : Microsoft.SharePoint.Administration.Claims.SPActi
 veDirectoryClaimProvider
 IsValid : True
 UpgradedPersistedProperties : {}</pre>
<pre>DisplayName : All Users
 Description : Provides identity provider claim data.
 IsEnabled : True
 IsUsedByDefault : True
 IsVisible : True
 AssemblyName : Microsoft.SharePoint, Version=15.0.0.0,
 Culture=neutral, PublicKeyToken=71e9bce111e9429c
 TypeName : Microsoft.SharePoint.Administration.Claims.SPAllU
 serClaimProvider
 ClaimProvider : Microsoft.SharePoint.Administration.Claims.SPAllU
 serClaimProvider
 ClaimProviderType : Microsoft.SharePoint.Administration.Claims.SPAllU
 serClaimProvider
 IsValid : True
 UpgradedPersistedProperties : {}</pre>
<pre>DisplayName : Forms Auth
 Description : Forms Based Authentication claim data.
 IsEnabled : True
 IsUsedByDefault : False
 IsVisible : True
 AssemblyName : Microsoft.SharePoint, Version=15.0.0.0,
 Culture=neutral, PublicKeyToken=71e9bce111e9429c
 TypeName : Microsoft.SharePoint.Administration.Claims.SPForm
 sClaimProvider
 ClaimProvider : Microsoft.SharePoint.Administration.Claims.SPForm
 sClaimProvider
 ClaimProviderType : Microsoft.SharePoint.Administration.Claims.SPForm
 sClaimProvider
 IsValid : True
 UpgradedPersistedProperties : {}</pre>
<pre>DisplayName : User Profile Claim Provider
 Description : User Profile Claim Provider
 IsEnabled : True
 IsUsedByDefault : True
 IsVisible : True
 AssemblyName : Microsoft.Office.Server.UserProfiles,
 Version=15.0.0.0, Culture=neutral,
 PublicKeyToken=71e9bce111e9429c
 TypeName : Microsoft.Office.Server.Security.UserProfileClaim
 Provider
 ClaimProvider : Microsoft.Office.Server.Security.UserProfileClaim
 Provider
 ClaimProviderType : Microsoft.Office.Server.Security.UserProfileClaim
 Provider
 IsValid : True
 UpgradedPersistedProperties : {}</pre>
<pre>DisplayName : Customer Ldap
 Description : Claims Provider for getting claims from
 REST-Service with CustomerLdap-Source.
 IsEnabled : True
 IsUsedByDefault : True
 IsVisible : True
 AssemblyName : Customer.ClaimsProvider.LDAP,
 Version=1.0.0.0, Culture=neutral,
 PublicKeyToken=9512c55e4a68ef80
 TypeName : Customer.ClaimsProvider.LDAP.CustomerProvider
 ClaimProvider :
 ClaimProviderType :
 IsValid :
 UpgradedPersistedProperties : {}</pre>
The last entry in the list was the wrong one, it shouldn't be there anymore. I checked the methods of the Claim Provider manager object an there was a one with the name "RemoveAt". The method needs the number of the item in the array to remove, in this case it was number 5 (it can be another number in your environment). I used the following command to remove the missing claim provider from the manager:
<pre>$manager.ClaimProviders.RemoveAt(5)</pre>
I finally saved the change with the following command:
<pre>$manager.Update()</pre>
That solved the problem, the error disapperead from the ULS log and the SharePoint search was working again.]]></content:encoded>
    </item>
    <item>
      <title>AppFabric Cache Cluster Connection problem</title>
      <link>https://docs.microsoft.com/archive/blogs/bspieth/appfabric-cache-cluster-connection-problem</link>
      <pubDate>Wed, 09 Mar 2016 12:25:10 GMT</pubDate>
      <dc:creator><![CDATA[Bernd Spieth]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bspieth/?p=52</guid>
      <description><![CDATA[One of my customers uses AppFabric as cache service for a IIS based web application. The AppFabric...]]></description>
      <content:encoded><![CDATA[One of my customers uses AppFabric as cache service for a IIS based web application. The AppFabric cache cluster was configured for high availibility and uses a SQL Cluster Instance as lead host. The configuration was made with PowerShell and without the AppFabric GUI setup application. Some times later I have to make some changes to the AppFabric cache cluster so I started the AppFabric PowerShell and it showed me the following message:

Use-CacheCluster : ErrorCode&lt;ERRPS001&gt;:SubStatus&lt;ES0001&gt;:Error in reading provider and connection string values. Please provide the values manually.

<a href="https://msdnshared.blob.core.windows.net/media/2016/03/AppFabric-Error-Message.png"><img class="alignnone size-medium wp-image-71" src="https://msdnshared.blob.core.windows.net/media/2016/03/AppFabric-Error-Message-300x63.png" alt="AppFabric Error Message" width="300" height="63" /></a>

I have never seen this error before and I belive the reason is that I have configured all other AppFabric cache instance via the GUI Setup application. The GUI setup application writes the AppFabric connection string and the provider type to the following key in the registry:

<code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppFabric\V1.0\Configuration</code>

It sets the value "ConnectionString" to the connection string of the AppFabric SQL instance and the value "Provider" to "System.Data.SqlClient". Both entries were empty in my case:

<a href="https://msdnshared.blob.core.windows.net/media/2016/03/AppFabric-Connection-String-Key.png"><img class="alignnone size-medium wp-image-62" src="https://msdnshared.blob.core.windows.net/media/2016/03/AppFabric-Connection-String-Key-300x92.png" alt="AppFabric Connection String Key" width="300" height="92" /></a>

I wrote the following PowerShell script to add the connection string to the registry:

<code>$registryHive = "HKLM:SOFTWARE\Microsoft\AppFabric\V1.0\Configuration"
$connectionStringValueName = "ConnectionString"
$connectionStringValue= "Data Source=SQLServer\MyAppFabricInstance;Initial Catalog=AppFabric_Cache_Database;Integrated Security=True"
$providerValueName = "Provider"
$providerValue= "System.Data.SqlClient"

if ((Test-Path $registryHive) -eq $false)
{
  New-Item $registryHive -Force | Out-Null
}
Set-ItemProperty $registryHive -Name $connectionStringValueName -Value  $connectionStringValue| Out-Null
Set-ItemProperty $registryHive -Name $providerValueName -Value  $providerValue| Out-Null</code>

After this change and a restart of the AppFabric PowerShell I was able to connect to the AppFabric cluster without any Problems.

Hint: It is also possible to provide the connection string and provider with the Use-CacheCluster cmdlet:

<code>Use-CacheCluster -ConnectionString "Data Source=SQLServer\MyAppFabricInstance;Initial Catalog=AppFabric_Cache_Database;Integrated Security=True" -ProviderType System.Data.SqlClient</code>]]></content:encoded>
    </item>
    <item>
      <title>Unable to activate new SharePoint 2013 search topology</title>
      <link>https://docs.microsoft.com/archive/blogs/bspieth/unable-to-activate-new-sharepoint-2013-search-topology</link>
      <pubDate>Thu, 18 Jun 2015 07:23:00 GMT</pubDate>
      <dc:creator><![CDATA[Bernd Spieth]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bspieth/2015/06/18/unable-to-activate-new-sharepoint-2013-search-topology/</guid>
      <description><![CDATA[During my tests with a provisioning script for SharePoint 2013 I run into a Problem with the...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:verdana,geneva;font-size:small;">During my tests with a provisioning script for SharePoint 2013 I run into a Problem with the SharePoint 2013 search. The provisioning of the search service application and the activation of a new search topology failed while activating the new search topology. I used a single VM for the script tests so the SharePoint farm topology was really simple. I started looking after the usual suspects, Windows services (SharePoint Search Host Controller, SharePoint Server Search 15) and IIS application pools but there were all fine. </span></p>
<p><span style="font-family:verdana,geneva;font-size:small;">The search service application administration in the Central Administration displayed the message &quot;Unable to retrieve topology component health states. This may be because the admin component is not up and running&quot;. </span><br /><br /><span style="font-family:verdana,geneva;font-size:small;">Then I started to check the ULS logs. There were a lot of critical messages in the ULS log regarding CSS addresses:</span><br /><br /><span style="font-family:courier new,courier;font-size:small;">Content Plugin can not be initialized - list of CSS addresses is not set.</span><br /><br /><span style="font-family:verdana,geneva;font-size:small;">I assumed that this message was the result of the unfinished search provisioning and not the cause of the problem so </span><span style="font-family:verdana,geneva;font-size:small;">I filtered the entries in the ULS log by the &quot;Product&quot; <span style="font-family:Verdana;font-size:small;">column </span>containing the word &quot;search&quot;. This gave me an overview of the search provisioning process and I found entries of the process hostcontrollerservice.exe which reappears every 20 - 30 seconds:</span><br /><br /><span style="font-family:courier new,courier;font-size:small;">HostController: Starting node AdminComponent1 on system 8C5512 marked for automatic startup - threadId: 12</span><br /><br /><span style="font-family:courier new,courier;font-size:small;">HostController: Restarting node AdminComponent1 on system 8C5512 marked for automatic startup - threadId: 18</span><br /><br /><span style="font-family:courier new,courier;font-size:small;">HostController: Restarting node AdminComponent1 on system 8C5512 marked for automatic startup - threadId: 18</span><br /><br /><span style="font-family:verdana,geneva;font-size:small;">It looks like the SharePoint system was trying to start the AdminComponent1 process but the process stops after a couple of seconds.The AdminComponent is one of the processes that is started as a child process of the hostcontrollerservice.exe. So I checked the running tasks with the Sysinternals Process Explorer <span style="font-family:Verdana;font-size:small;">(in tree mode) </span>and found the following:</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/6266.2015-06-18%2013_26_45-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/6266.2015_2D00_06_2D00_18-13_5F00_26_5F00_45_2D00_mRemoteNG-_2D00_-confCons.xml.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/6266.2015-06-18%2013_26_45-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/6266.2015_2D00_06_2D00_18-13_5F00_26_5F00_45_2D00_mRemoteNG-_2D00_-confCons.xml.png" border="0" /></a><br /><br /><span style="font-family:verdana,geneva;font-size:small;">As you can see there are no child processes beneath the hostcontrollerservice.exe process. In a working SharePoint 2013 search system the are normally five or six child processes. </span></p>
<p><span style="font-family:verdana,geneva;font-size:small;">So the question was why do I not have any running child process? I checked the command line of the child processes on a SharePoint system with working search with the Process Explorer. The noderunner process of the admin component was started there with this command line:<br /></span></p>
<p><span style="font-family:courier new,courier;font-size:small;">&quot;C:\Program Files\Common Files\Microsoft Office Servers\15.0\Search\Runtime\1.0\NodeRunner.exe&quot; --noderoot &quot;C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications\Search\Nodes\C5539A\AdminComponent1&quot; --addfrom &quot;C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications\Search\Nodes\C5539A\AdminComponent1\Configuration\Local\Node.ini&quot; --tracelog &quot;C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications\Search\Nodes\C5539A\AdminComponent1\Logs\NodeRunner.log&quot;</span></p>
<p><span style="font-family:verdana,geneva;font-size:small;">As you can see the command line contains a parameter tracelog:</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">--tracelog &quot;C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications\Search\Nodes\C5539A\AdminComponent1\Logs\NodeRunner.log</span><br /><br /><span style="font-family:verdana,geneva;font-size:small;">I opened the path &quot;C:\Program Files\Microsoft Office Servers\15.0\Data\Office Server\Applications\Search\Nodes&quot; on the not working SharePoint system and found a six digit sub folder with another folder named AdminComponent1 and a subfolder named Logs. In the logs folder there was a file NodeRunner.log which contained a lot of exception messages:</span><br /><br /><span style="font-family:courier new,courier;font-size:small;">Caught exception in node activator: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; System.OutOfMemoryException: Exception of type &#39;System.OutOfMemoryException&#39; was thrown.</span><br /><span style="font-family:courier new,courier;font-size:small;">&nbsp;&nbsp; at Microsoft.Ceres.CoreServices.Node.NodeActivator.ActivateNode(IDictionary`2 configuration)</span><br /><span style="font-family:courier new,courier;font-size:small;">&nbsp;&nbsp; --- End of inner exception stack trace ---</span><br /><span style="font-family:courier new,courier;font-size:small;">&nbsp;&nbsp; at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)</span><br /><span style="font-family:courier new,courier;font-size:small;">&nbsp;&nbsp; at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)</span><br /><span style="font-family:courier new,courier;font-size:small;">&nbsp;&nbsp; at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)</span><br /><span style="font-family:courier new,courier;font-size:small;">&nbsp;&nbsp; at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)</span><br /><span style="font-family:courier new,courier;font-size:small;">&nbsp;&nbsp; at Microsoft.Ceres.CoreServices.NodeRunner.Runner.StartNodeController(EntryPoint entryPoint)</span><br /><span style="font-family:courier new,courier;font-size:small;">&nbsp;&nbsp; at Microsoft.Ceres.CoreServices.NodeRunner.Runner.Start()</span><br /><br /><span style="font-family:verdana,geneva;font-size:small;">It looks like I have a memory problem which prevents the noderunner processes from starting correctly. This was very odd because the system had 32 GB RAM. I searched for the exception message and found some results pointing me to the solution. It is possible to limit the memory consumption of the noderunner processes with an entry in the file noderunner.exe.config in the folder &quot;C:\Program Files\Common Files\Microsoft Office Servers\15.0\Search\Runtime\1.0&quot;. I found the following entry in my noderunner config file:</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2015-06-18%2013_29_00-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2015_2D00_06_2D00_18-13_5F00_29_5F00_00_2D00_mRemoteNG-_2D00_-confCons.xml.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2015-06-18%2013_29_00-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2015_2D00_06_2D00_18-13_5F00_29_5F00_00_2D00_mRemoteNG-_2D00_-confCons.xml.png" border="0" /></a><br /><br style="font-family:verdana,geneva;font-size:small;" /><span style="font-family:verdana,geneva;font-size:small;">I changed the&nbsp;<span style="font-family:verdana,geneva;font-size:small;"><span style="font-family:verdana,geneva;font-size:small;">memoryLimitMegabytes</span></span> value of the tag <span style="font-family:verdana,geneva;font-size:small;">&lt;nodeRunnerSettings memoryLimitMegabytes=&quot;100&quot; /&gt;</span> to 0 (which means no restriction) and restarted the Search Host Controller Windows service. After a couple of seconds the hostcontrollerservice.exe in the Process Explorer showed the expected child processes:</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2015-06-18%2016_16_16-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2015_2D00_06_2D00_18-16_5F00_16_5F00_16_2D00_mRemoteNG-_2D00_-confCons.xml.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2015-06-18%2016_16_16-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2015_2D00_06_2D00_18-16_5F00_16_5F00_16_2D00_mRemoteNG-_2D00_-confCons.xml.png" border="0" /></a></p>
<p><br /><span style="font-family:verdana,geneva;font-size:small;">To verify that the search service application was really working I went to the Central Administration and the search administration and it showed me the wanted status:</span><br /><br /></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2015-06-18%2016_18_36-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2015_2D00_06_2D00_18-16_5F00_18_5F00_36_2D00_mRemoteNG-_2D00_-confCons.xml.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2015-06-18%2016_18_36-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2015_2D00_06_2D00_18-16_5F00_18_5F00_36_2D00_mRemoteNG-_2D00_-confCons.xml.png" border="0" /></a></p>
<p><span style="font-family:verdana,geneva;">Problem solved!</span></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Error message "The User Profile Application requires domain credentials for connection access" when trying to add a Windows group to the User Profile Service Application connection permissions</title>
      <link>https://docs.microsoft.com/archive/blogs/bspieth/error-message-the-user-profile-application-requires-domain-credentials-for-connection-access-when-trying-to-add-a-windows-group-to-the-user-profile-service-application-connection-permissio</link>
      <pubDate>Thu, 16 Oct 2014 02:35:09 GMT</pubDate>
      <dc:creator><![CDATA[Bernd Spieth]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bspieth/2014/10/16/error-message-the-user-profile-application-requires-domain-credentials-for-connection-access-when-trying-to-add-a-windows-group-to-the-user-profile-service-application-connection-permissio/</guid>
      <description><![CDATA[A customer had a problem with the User Profile Service Application in SharePoint 2013 on premise. It...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:verdana,geneva;font-size:small;">A customer had a problem with the User Profile Service Application in SharePoint 2013 on premise. It was not possible to add a Windows Group in the connection permission dialog and save the changes. Right after clicking the OK button the following error message appeared:</span></p>
<p><span style="font-family:verdana,geneva;font-size:small;">Sorry, something went wrong</span></p>
<p><span style="font-family:verdana,geneva;font-size:small;">The User Profile Application requires domain credentials for connection access</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2014-10-16%2011_24_34-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2014_2D00_10_2D00_16-11_5F00_24_5F00_34_2D00_mRemoteNG-_2D00_-confCons.xml.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2014-10-16%2011_24_34-mRemoteNG%20-%20confCons.xml.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2014_2D00_10_2D00_16-11_5F00_24_5F00_34_2D00_mRemoteNG-_2D00_-confCons.xml.png" border="0" /></a></p>
<p><span style="font-family:verdana,geneva;font-size:small;">I was not able to find the root cause of the problem but I was able to add the Windows group through a PowerShell script I found at Waldek Mastykarz website:</span></p>
<p><span style="font-family:verdana,geneva;font-size:small;">https://blog.mastykarz.nl/granting-permissions-user-profile-service-application-powershell</span></p>
<p><span style="font-family:verdana,geneva;font-size:small;">The script was original written for SharePoint 2010 but it also works with SharePoint 2013. It modified the original script a little bit and attached it to this post.</span></p>
<p><span style="font-family:verdana,geneva;font-size:small;">&nbsp;</span></p>
<p></p>
<p></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/9811/00/00/03/63/95/56/Grant-UserProfileConnectionPermission.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-9811-00-00-03-63-95-56/Grant_2D00_UserProfileConnectionPermission.zip">Grant-UserProfileConnectionPermission.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>HTTP 404 problem with english MySite Blogs and the display language set to a different language</title>
      <link>https://docs.microsoft.com/archive/blogs/bspieth/http-404-problem-with-english-mysite-blogs-and-the-display-language-set-to-a-different-language</link>
      <pubDate>Tue, 06 May 2014 13:21:00 GMT</pubDate>
      <dc:creator><![CDATA[Bernd Spieth]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bspieth/2014/05/06/http-404-problem-with-english-mysite-blogs-and-the-display-language-set-to-a-different-language/</guid>
      <description><![CDATA[Recently a customer of mine had a problem with the MySite. The whole SharePoint 2013 farm (Windows...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:verdana,geneva;font-size:small;">Recently a customer of mine had a problem with the MySite. The whole SharePoint 2013 farm (Windows Server, SharePoint Server and SQL Server) was installed with English components. The MySite for the user was also created in English with 6 additional language packs installed. If a user had set his display language in his MySite profile to German she was receiving her status messages from the SharePoint Farm (news feed updates etc.) in German. The display language was set for every user to German by a PowerShell script. The MySite also contains the default MySite blog which was used by some users.</span></p>
<p><span style="font-size:medium;"><strong><span style="font-family:verdana,geneva;">&nbsp;</span></strong></span></p>
<p><span style="font-size:medium;"><strong><span style="font-family:verdana,geneva;">The problem</span></strong></span></p>
<p><span style="font-family:verdana,geneva;font-size:small;">If a user adds a post to his MySite blog the Newsfeed of the user is updated with a link to the new blog post:</span></p>
<p><span style="color:#1f497d;font-family:&#39;Calibri&#39;,&#39;sans-serif&#39;;font-size:11pt;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2477.News%20feed.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2477.News-feed.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/2477.News%20feed.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/2477.News-feed.png" border="0" /></a><br /></span></p>
<p></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span></p>
<p><span style="font-family:Calibri;font-size:medium;">The URL to this blog post (&quot;Test Eintrag&quot;) looks like this:</span></p>
<p><a href="https://mysite.customer.com/my/de_bspi0102/Blog/Lists/Posts/ViewPost.aspx?ID=8"><span style="color:#0563c1;font-family:Calibri;font-size:medium;">https://mysite.customer.com/my/de_bspi0102/Blog/Lists/Posts/ViewPost.aspx?ID=8</span></a></p>
<p>&nbsp;<span style="font-family:Calibri;font-size:medium;">If I click on the link my browser opens ViewPost.aspx. ViewPost.aspx starts a redirect to the following URL (traced with Internet Explorer Developer Tools):</span></p>
<p><span style="font-family:Calibri;font-size:medium;">&nbsp;</span><a href="https://mysite.customer.com/my/de_bspi0102/Blog/Lists/Beitraege/Post.aspx?List=7bfeb6ee%2Deacf%2D4295%2Da542%2D605d7a21a8df&amp;ID=8&amp;Web=f1bbf158%2Dfb30%2D48f0%2D8e29%2D5862c92a5a07"><span style="font-family:Calibri;"><span style="font-size:medium;"><span style="color:#0563c1;">https://mysite.customer.com/my/de_bspi0102/Blog/Lists/</span>Beitraege<span style="color:#0563c1;">/Post.aspx?List=7bfeb6ee%2Deacf%2D4295%2Da542%2D605d7a21a8df&amp;ID=8&amp;Web=f1bbf158%2Dfb30%2D48f0%2D8e29%2D5862c92a5a07</span></span></span></a></p>
<p><span style="font-family:Calibri;font-size:medium;">That is the point where the 404 error occurs. The cause of the 404 is the name of the blog list. The real name of the blog list is &quot;Posts&quot; and not &quot;Beitraege&quot;. It seems that the ViewPost.aspx is using the display language value of the MySite profile settings to use a localized name of the blog list, and that is wrong. If I change the link to the blog post from</span></p>
<p><a href="https://mysite.customer.com/my/de_bspi0102/Blog/Lists/Posts/ViewPost.aspx?ID=8"><span style="font-family:Calibri;"><span style="font-size:medium;"><span style="color:#0563c1;">https://mysite.customer.com/my/de_bspi0102/Blog/Lists/Posts/</span>ViewPost.aspx<span style="color:#0563c1;">?ID=8</span></span></span></a></p>
<p><span style="font-family:Calibri;font-size:medium;">to</span></p>
<p><a href="https://mysite.customer.com/my/de_bspi0102/Blog/Lists/Posts/ViewPost.aspx?ID=8"><span style="font-family:Calibri;"><span style="font-size:medium;"><span style="color:#0563c1;">https://mysite.customer.com/my/de_bspi0102/Blog/Lists/Posts/</span>Post.aspx<span style="color:#0563c1;">?ID=8</span></span></span></a></p>
<p><span style="font-family:Calibri;font-size:medium;">the URL is working without any problems. If I change the display language in my MySite profile back to English, create a new blog entry and click on the link, the error persists, the redirected URL still points to the list with the name &quot;Beitraege&quot;.</span></p>
<p></p>
<p><span style="font-family:Times New Roman;font-size:medium;"><strong><span style="color:#000000;font-family:verdana,geneva;">The solution</span></strong><br /></span></p>
<p></p>
<p><span style="font-family:Calibri;font-size:medium;">The content type for the blog list has three configuration fields to set the URL for the display form, the edit form and the new form. The picture below shows the 3 fields of the content type in SharePoint Designer:</span></p>
<p><span style="font-family:Calibri;font-size:medium;"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/SharePoint%20Designer.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/SharePoint-Designer.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/11/SharePoint%20Designer.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-11/SharePoint-Designer.png" border="0" /></a><br /></span></p>
<p><span style="font-family:Calibri;"><span style="font-size:medium;">The users with the 404 problem have the URL of the display form set to &quot;Lists/Beitrage/Post.aspx&quot; despite the fact that the name of the list is &quot;Posts&quot; and not &quot;Beitrage&quot;. &nbsp;I changed the URL of the display form of the blog list content type to &quot;Lists/Posts/Post.aspx&quot; and the problem disappeared. I had a lot of users with that problem so I decided to write a PowerShell script that identifies the affected MySites and sets the display form of the content type to the correct url.</span></span></p>
<p></p>
<p><span style="font-family:Calibri;font-size:medium;">Surprisingly when I checked the content type from the PowerShell script it was always showing the correct URL but it was wrong in fact. It seems that the only way to see the wrong URL is by using SharePoint Designer.&nbsp; So I decided to always set the URL to the correct value with the PowerShell script even if it looks like it is already correct. That fixed the problem for all affected users.</span></p>
<p></p>
<p><span style="font-family:Calibri;font-size:medium;">I attached the PowerShell script to this blog post</span></p>
<p></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/9811/00/00/03/62/90/39/Change-ListContentTypeDisplayFormURL.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-9811-00-00-03-62-90-39/Change_2D00_ListContentTypeDisplayFormURL.zip">Change-ListContentTypeDisplayFormURL.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013 Newsfeed does not show old entries after server crash</title>
      <link>https://docs.microsoft.com/archive/blogs/bspieth/sharepoint-2013-newsfeed-does-not-show-old-entries-after-server-crash</link>
      <pubDate>Tue, 06 May 2014 13:16:00 GMT</pubDate>
      <dc:creator><![CDATA[Bernd Spieth]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bspieth/2014/05/06/sharepoint-2013-newsfeed-does-not-show-old-entries-after-server-crash/</guid>
      <description><![CDATA[A couple of days ago I had an interesting problem with the MySite newsfeed in SharePoint 2013. The...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size:small;">A couple of days ago I had an interesting problem with the MySite newsfeed in SharePoint 2013. The SharePoint farm crashed because of a problem with the SAN storage that contains the SharePoint databases. The operation team fixed the problem and I rebooted the SharePoint servers to bring the farm back. Everything looked fine after the reboot, the SharePoint farm was online again.</span></p>
<p><span style="font-size:small;">After some testing I found out that the MySite newsfeed only contained information that was created after the server reboot. All entries that were created before the crash disappeared. </span><br /><span style="font-size:small;">My first idea was that there must be a problem with the microfeed list in the MySite of the users so I checked the list (MySite/Lists/PublishedFeed) on the MySites of some users and found all old entries are still there, they just do not show up in the newsfeed. So my second idea was to check the distributed cache service and the cache cluster. I executed the following PowerShell command on every SharePoint server that has the distributed cache service running:</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Use-CacheCluster</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Get-CacheHostConfig &ndash;ComputerName $env:Computername -CachePort 22233</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Get-CacheHost</span></p>
<p><span style="font-size:small;">The cmdlets were executed without any errors, both cache server instances were up and running. I recreated the cache cluster just to make sure that it was possible to create a new cache cluster without any problems. That also succeeded.</span></p>
<p><span style="font-size:small;">The next idea was to look for a PowerShell cmdlet that re-caches the news feed from the micro feed list and I found the following two cmdlets:</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Update-SPRepopulateMicroblogLMTCache</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Update-SPRepopulateMicroblogFeedCache</span></p>
<p><span style="font-size:small;">&nbsp;</span></p>
<p><span style="font-size:small;">I started <span style="font-family:courier new,courier;">Update-SPRepopulateMicroblogLMTCache</span> with the id of the User Profile Service application proxy one time like this:</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">$upp = Get-SPServiceApplicationProxy | where {$_.TypeName -like &quot;User Profile Service Application Proxy&quot;}</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">$uppID = $upp.Id</span></p>
<p><span style="font-family:courier new,courier;font-size:small;"># Force a cache time stamp refresh</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Update-SPRepopulateMicroblogLMTCache -ProfileServiceApplicationProxy $uppID</span></p>
<p><span style="font-family:courier new,courier;">&nbsp;</span></p>
<p><span style="font-size:small;">After that I executed the second command with the id of the User Profile Service application proxy and my own account name (domain\username):</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">$upp = Get-SPServiceApplicationProxy | where {$_.TypeName -like &quot;User Profile Service Application Proxy&quot;}</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">$uppID = $upp.Id</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">Update-SPRepopulateMicroblogFeedCache -ProfileServiceApplicationProxy $uppID -AccountName $domainAndUserName</span></p>
<p><span style="font-family:courier new,courier;font-size:small;">&nbsp;</span></p>
<p><span style="font-size:small;">And voila: After a couple of seconds and a reload of my MySite page all my old newsfeed entries were back again!</span></p>
<p><span style="font-size:small;">I wrote a PowerShell script that iterates through all of the users with a MySite and executes the Update-SPRepopulateMicroblogFeedCache cmdlet with the account name of the user as parameter. After some minutes all news feeds were repopulated with the old news feed entries.</span></p>
<p><span style="font-size:small;">The cause for this problem was the ungraceful shutdown of all distributed cache instances. This crash killed the in memory cache with the news feed entries.</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/9811/00/00/03/60/58/47/Repopulate-Newsfeed.zip" original-url="https://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-9811-00-00-03-60-58-47/Repopulate_2D00_Newsfeed.zip">Repopulate-Newsfeed.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Configure the IIS 6 SMTP server with WMI and PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/bspieth/configure-the-iis-6-smtp-server-with-wmi-and-powershell</link>
      <pubDate>Mon, 18 Feb 2013 23:09:00 GMT</pubDate>
      <dc:creator><![CDATA[Bernd Spieth]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/bspieth/2013/02/18/configure-the-iis-6-smtp-server-with-wmi-and-powershell/</guid>
      <description><![CDATA[Recently one of my customers asked me how to configure IIS 6 SMTP domains via PowerShell&nbsp;during...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: verdana,geneva; font-size: small;">Recently one of my customers asked me how to configure IIS 6 SMTP domains via PowerShell&nbsp;during an unattended SharePoint farm installation. I was not able to find a complete example, so I thought this would be a great topic for my first blog post.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">The PowerShell script will create a new incoming SMTP alias domain and then configure selected properties like max. message size, etc. It uses WMI to create the domain and configure the properties.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">This should work on all Windows versions that support IIS 6 and PowerShell, but I have only tested it on Server 2008 R2.</span></p>
<p><span style="font-family: verdana,geneva; font-size: small;">Enjoy!</span></p>
<p>&nbsp;</p>
<div class="WordSection1">
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console'; color: blue;" lang="EN-US">Set-ExecutionPolicy</span><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US"> <span style="color: blueviolet;">RemoteSigned</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console'; color: darkblue;" lang="EN-US">function</span><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US"> <span style="color: blueviolet;">Configure-SMTPService</span> (<span style="color: darkgray;">[</span><span style="color: teal;">string</span><span style="color: darkgray;">]</span><span style="color: orangered;">$incomingEMailDomainName</span><span style="color: darkgray;">,</span> <span style="color: darkgray;">[</span><span style="color: teal;">int</span><span style="color: darkgray;">]</span><span style="color: orangered;">$incomingEMailMaxMessageSize</span>)</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">{</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">White</span> <span style="color: darkred;">" -&gt; Changing the start-up type of SMTP service to 'Automatic'..."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Set-Service</span> <span style="color: darkred;">"SMTPSVC"</span> <span style="color: navy;">-StartupType</span> <span style="color: blueviolet;">Automatic</span> <span style="color: navy;">-ErrorAction</span> <span style="color: blueviolet;">SilentlyContinue</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">if</span> (<span style="color: orangered;">$?</span>)</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Green</span> <span style="color: darkred;">" [OK] Successfully changed startup type."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">else</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Red</span> <span style="color: darkred;">" [Error] Unable to change startup type."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">Exit</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">White</span> <span style="color: darkred;">" -&gt; Starting SMTP service..."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Start-Service</span> <span style="color: darkred;">"SMTPSVC"</span> <span style="color: navy;">-ErrorAction</span> <span style="color: blueviolet;">SilentlyContinue</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">if</span> (<span style="color: orangered;">$?</span>)</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Green</span> <span style="color: darkred;">" [OK] Service successfully started."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">else</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Red</span> <span style="color: darkred;">" [Error] Unable to start service."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">Exit</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># Ascriptomatic is a great tool to explorefor exploring WMI namespace is scriptomatic: </span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># https://www.microsoft.com/en-us/download/details.aspx?id=12028</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">White</span> <span style="color: darkred;">" -&gt; CreatingCreate incoming SMTP domain..."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># First create a new smtp domain. The path 'SmtpSvc/1' is the first virtual SMTP server. If you need to modify another virtual SMTP server</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># change the path accordingly.</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">try</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$smtpDomains</span> <span style="color: darkgray;">=</span> <span style="color: darkgray;">[</span><span style="color: teal;">wmiclass</span><span style="color: darkgray;">]</span><span style="color: darkred;">'root\MicrosoftIISv2:IIsSmtpDomain'</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$newSMTPDomain</span> <span style="color: darkgray;">=</span> <span style="color: orangered;">$smtpDomains</span><span style="color: darkgray;">.</span>CreateInstance()</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$newSMTPDomain</span><span style="color: darkgray;">.</span>Name <span style="color: darkgray;">=</span> <span style="color: darkred;">"SmtpSvc/1/Domain/</span><span style="color: orangered;">$incomingEMailDomainName</span><span style="color: darkred;">"</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$newSMTPDomain</span><span style="color: darkgray;">.</span>Put()&nbsp; <span style="color: darkgray;">|</span> <span style="color: blue;">Out-Null</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Green</span> <span style="color: darkred;">" [OK] Successfully created incoming email domain."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">catch</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Red</span> <span style="color: darkred;">" [Error] Unable to create incoming email domain."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">Exit</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">White</span> <span style="color: darkred;">" -&gt; Configuring incoming SMTP domain..."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">try</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># Configure the new smtp domain as alias domain</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$smtpDomainSettings</span> <span style="color: darkgray;">=</span> <span style="color: darkgray;">[</span><span style="color: teal;">wmiclass</span><span style="color: darkgray;">]</span><span style="color: darkred;">'root\MicrosoftIISv2:IIsSmtpDomainSetting'</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$newSMTPDomainSetting</span> <span style="color: darkgray;">=</span> <span style="color: orangered;">$smtpDomainSettings</span><span style="color: darkgray;">.</span>CreateInstance()</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># Set the type of the domain to "Alias"</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$newSMTPDomainSetting</span><span style="color: darkgray;">.</span>RouteAction <span style="color: darkgray;">=</span> <span style="color: purple;">16</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># Map the settings to the domain we created in the first step</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$newSMTPDomainSetting</span><span style="color: darkgray;">.</span>Name <span style="color: darkgray;">=</span> <span style="color: darkred;">"SmtpSvc/1/Domain/</span><span style="color: orangered;">$incomingEMailDomainName</span><span style="color: darkred;">"</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$newSMTPDomainSetting</span><span style="color: darkgray;">.</span>Put() <span style="color: darkgray;">|</span> <span style="color: blue;">Out-Null</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Green</span> <span style="color: darkred;">" [OK] Successfully configured incoming email domain."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.0pt; font-family: 'Lucida Console';">}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 9.0pt; font-family: 'Lucida Console'; color: darkblue;" lang="EN-US">catch</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Red</span> <span style="color: darkred;">" [Error] Unable to configure incoming e-mail domain."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">Exit</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">White</span> <span style="color: darkred;">" -&gt; Configuring virtual SMTP server..."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">try</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$virtualSMTPServer</span> <span style="color: darkgray;">=</span> <span style="color: blue;">Get-WmiObject</span> <span style="color: blueviolet;">IISSmtpServerSetting</span> <span style="color: navy;">-namespace</span> <span style="color: darkred;">"ROOT\MicrosoftIISv2"</span> <span style="color: darkgray;">|</span> <span style="color: blue;">Where-Object</span> { <span style="color: orangered;">$_</span><span style="color: darkgray;">.</span>name <span style="color: darkgray;">-like</span> <span style="color: darkred;">"SmtpSVC/1"</span> }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># Set maximum message size (in bytes)</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$virtualSMTPServer</span><span style="color: darkgray;">.</span>MaxMessageSize <span style="color: darkgray;">=</span> (<span style="color: orangered;">$incomingEMailMaxMessageSize</span> <span style="color: darkgray;">*</span> <span style="color: purple;">1024</span>)</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># Disable session size limit</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$virtualSMTPServer</span><span style="color: darkgray;">.</span>MaxSessionSize <span style="color: darkgray;">=</span> <span style="color: purple;">0</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># Set maximum number of recipients</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$virtualSMTPServer</span><span style="color: darkgray;">.</span>MaxRecipients <span style="color: darkgray;">=</span> <span style="color: purple;">0</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkgreen;"># Set maximum messages per connection</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$virtualSMTPServer</span><span style="color: darkgray;">.</span>MaxBatchedMessages <span style="color: darkgray;">=</span> <span style="color: purple;">0</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: orangered;">$virtualSMTPServer</span><span style="color: darkgray;">.</span>Put() <span style="color: darkgray;">|</span> <span style="color: blue;">Out-Null</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Green</span> <span style="color: darkred;">" [OK] Successfully configured virtual SMTP server."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">catch</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: blue;">Write-Host</span> <span style="color: navy;">-Foregroundcolor</span> <span style="color: blueviolet;">Red</span> <span style="color: darkred;">" [Error] Unable to configure virtual SMTP server."</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: darkblue;">Exit</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">}</span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console'; color: blue;" lang="EN-US">Configure-SMTPService</span><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US"> <span style="color: darkred;">"sp.mydomain.local"</span> <span style="color: purple;">10240</span></span></p>
<p class="MsoNormal" style="margin-bottom: .0001pt; line-height: normal; background: white; text-autospace: none;"><span style="font-size: 9.0pt; font-family: 'Lucida Console';" lang="EN-US">&nbsp;</span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>
</div>]]></content:encoded>
    </item>
  </channel>
</rss>