<?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>Adam Sorenson’s (MSFT) Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/adamsorenson/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/adamsorenson/feed.xml</link>
    <description>SharePoint Auth and User Profiles - SITE MOVED TO adamsorenson.com</description>
    <lastBuildDate>Thu, 03 Jan 2019 14:13:30 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Blog is Moving</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/blog-is-moving</link>
      <pubDate>Thu, 03 Jan 2019 08:13:30 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=3255</guid>
      <description><![CDATA[This blog is moving to https://adamsorenson.com
	New content will be published over there.]]></description>
      <content:encoded><![CDATA[<p>This blog is moving to <a href="https://adamsorenson.com">https://adamsorenson.com</a>
	</p><p>New content will be published over there.</p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint - PowerShell Script to Remove Users from Site Collection</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/sharepoint-powershell-script-to-remove-users-from-site-collection</link>
      <pubDate>Wed, 22 Aug 2018 10:46:39 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=3165</guid>
      <description><![CDATA[Site collections still have users that are either disabled or deleted from Active Directory....]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:Times New Roman;font-size:12pt">Site collections still have users that are either disabled or deleted from Active Directory. SharePoint does not have anything out of the box that will clean up these.  The reasons to clean these users up is to avoid getting them as a result in the people picker when they should not be showing up.
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">I do have two scripts that will clean these users up. This will be something you want to test out since this is a <strong>delete</strong> function (leave $RemoveUsers = $false).
</span></p><div><table style="border-collapse:collapse" border="0"><colgroup><col style="width:1501px" /></colgroup><tbody valign="top"><tr style="height: 19px"><td style="padding-left: 7px;padding-right: 7px;border-top:  solid 0.5pt;border-left:  solid 0.5pt;border-bottom:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt"><span style="color:red"><strong>WARNING: </strong></span>This will remove users from site collections.  This will remove their alerts, personal views, unique permissions, etc.  The only way to revert is to restore the site collection or content database from backup.</span></p></td></tr></tbody></table></div><p>
 </p><h1>Just a bit of information about your site…
</h1><p><img src="https://msdnshared.blob.core.windows.net/media/2018/08/082218_1648_SharePointP1.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="font-family:Times New Roman;font-size:12pt">This script does require some modification to tailor it for your environment.  The service account is needed even if it's the local domain.  This was designed this way, so you can use this script for sites that have users from different domains. 
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">As stated above, $RemoveUsers is the switch to make this to script to remove the users that were not found in Active Directory.  By default, this is set to $false.
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">After everything is set, run "GetUsers".
</span></p><h1>CSV is created.
</h1><p>
 </p><p>The CSV will be created if any users are in the site collections that are no longer in Active Directory or are disabled.  Review this before feeding it through the second script.  There might be some accounts you may have false positives or just want to remove a few entries.
</p><p><img src="https://msdnshared.blob.core.windows.net/media/2018/08/082218_1648_SharePointP2.png" alt="" />
	</p><p>This script is more straight forward since we are taking that CSV and removing the user from the URL specified in the CSV.  I would recommend backing up the content database(s) that could be affected by the this script.
</p><p>
 </p><p><a href="https://gallery.technet.microsoft.com/SharePoint-PowerShell-to-55588cab">DeletedADUsersFromsites1.1.ps1 can be downloaded here</a>
	</p><p><a href="https://gallery.technet.microsoft.com/SharePoint-PowerShell-8b1c5066">The second script can be downloaded here.</a>
	</p><p>
 </p><p>
 </p><h1>
	</h1>]]></content:encoded>
    </item>
    <item>
      <title>Remove-SPTrustedIdentityTokenIssuer : The trusted login provider is in use and cannot be deleted</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/remove-sptrustedidentityissuer-the-trusted-login-provider-is-in-use-and-cannot-be-deleted</link>
      <pubDate>Fri, 22 Jun 2018 15:10:36 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=3115</guid>
      <description><![CDATA[I have a post about the Migration from Windows to ADFS which utilizes the creation of the...]]></description>
      <content:encoded><![CDATA[<p>
 </p><p>I have a post about the <a href="https://blogs.technet.microsoft.com/adamsorenson/2018/01/17/sharepoint-20132016-migrate-from-windows-claims-to-adfs/">Migration from Windows to ADFS</a> which utilizes the creation of the -UseDefaultConfiguration switch.  A few days ago, I created a Trusted Identity Provider with -UseDefaultConfiguration.  I did not need it in my test farm anymore, so it was time to delete it.
</p><p>This failed with this exception:
</p><p>PS C:\windows\system32&gt; Remove-SPTrustedIdentityTokenIssuer foo
</p><p><span style="color:red">Remove-SPTrustedIdentityTokenIssuer : The trusted login provider is in use and cannot be deleted.
</span></p><p><span style="color:red">At line:1 char:1
</span></p><p><span style="color:red">+ Remove-SPTrustedIdentityTokenIssuer foo
</span></p><p><span style="color:red">+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</span></p><p><span style="color:red">    + CategoryInfo          : InvalidData: (Microsoft.Share...dentityProvider:SPCmdletRemoveSPIdentityProvider) [Remove-SPTrustedIdentityTok 
</span></p><p><span style="color:red">   enIssuer], InvalidOperationException
</span></p><p><span style="color:red">    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRemoveSPIdentityProvider
</span></p><p>
 </p><h1>Only Two Checks 
</h1><p>There are only two reasons this exception is tossed when trying to remove the Trusted Identity Token Issuer. 
</p><ol><li>Use in the web application authentication providers
</li><li>Claim Provider with the same name as your Trusted Identity Token Issuer
</li></ol><p>The first is the obvious choice to check since the Trusted Identity Token Issuer cannot be deleted if used by a web application.  If you have numerous web applications with many zones to check, this can take a long time.  The PowerShell script below numerates all the web applications and their zones to display the authentications that are enabled in those zones.
</p><p>
 </p><div><table style="border-collapse:collapse" border="0"><colgroup><col style="width:950px" /></colgroup><tbody valign="top"><tr style="height: 379px"><td style="padding-left: 7px;padding-right: 7px;border-top:  solid 0.5pt;border-left:  solid 0.5pt;border-bottom:  solid 0.5pt;border-right:  solid 0.5pt"><p>#Use this to enumerate all authentication providers in use for every zone for every web application
</p><p>#author: adamsor
</p><p>
 </p><p>$log = "C:\logs\authproviders.txt"
</p><p>$wa = Get-SPWebApplication
</p><p>foreach($webapp in $wa)
</p><p>{
</p><p>    $aams = $webapp.alternateurls
</p><p>    foreach($aam in $aams)
</p><p>    {
</p><p>    Write-host $webapp.url $aam.zone -ForegroundColor DarkGreen
</p><p>    $url = $webapp.Url
</p><p>    $zone = $aam.Zone
</p><p>    "$url $zone" | out-file $log -Append -noclobber
</p><p>    Get-SPAuthenticationProvider -WebApplication $webapp -Zone $aam.zone 
</p><p>    Get-SPAuthenticationProvider -WebApplication $webapp -Zone $aam.zone | Out-File $log -Append -noclobber
</p><p>    }
</p><p>
 </p><p>}
</p></td></tr></tbody></table></div><p>
 </p><p><strong>Example of the output:
</strong></p><p><img src="https://msdnshared.blob.core.windows.net/media/2018/06/062218_2118_RemoveSPTru1.png" alt="" /><strong>
		</strong></p><p>I checked the authentication providers.  I have ADFSAdamsor in use and you can see the web application URL and zone at the top.  Any that would come up we would just remove the that zone from using the Trusted Identity Token Issuer.
</p><p>
 </p><h1>Claim Provider
</h1><p>The second check for Remove-SPTrustedIdentityTokenIssuer is Claim Providers that have the same name as the Trusted Identity Token Issuer.
</p><p>Get-SPClaimProvider will display all the claim providers installed on the farm.
</p><p><img src="https://msdnshared.blob.core.windows.net/media/2018/06/062218_2118_RemoveSPTru2.png" alt="" />
	</p><p>As the screenshot above shows, I have the claim provider that was created with -UseDefaultConfiguration.  I was able to remove the claim provider then removed the Trusted Identity Token Issuer.
</p><p>Remove-SPClaimProvider &lt;NAME&gt;
</p><p>Remove-SPTrustedIdentityTokenIssuer &lt;NAME&gt;</p>]]></content:encoded>
    </item>
    <item>
      <title>Unable to start User Profile Service Application - Starting</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/unable-to-start-user-profile-service-application-starting</link>
      <pubDate>Sat, 26 May 2018 16:44:14 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=2265</guid>
      <description><![CDATA[The User Profile Synchronization service for SharePoint 2010 or 2013 can fail to start for numerous...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:Times New Roman;font-size:12pt">The User Profile Synchronization service for SharePoint 2010 or 2013 can fail to start for numerous reasons.  This post is for when the User Profile Service Application(UPA) is stuck on <strong>Starting</strong>.  This prevents anybody from creating connections or syncing users.
</span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2018/05/052618_2244_Unabletosta1.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="font-family:Times New Roman;font-size:12pt">This will prevent the User Profile Service Application from functioning properly.  ULS shows the topology.svc tossing this "The requested application could not be found" with EventID evr4.
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">We can try to start the by running the Provision method to get the service application Started.
</span></p><p>$upa = Get-SPServiceApplication &lt;GUID of Service Application&gt;
</p><p>$upa.Provision()
</p><p><span style="font-family:Times New Roman;font-size:12pt">This did fail and in the ULS logs we found this entry.
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">05/26/2018 11:13:46.90    PowerShell_ISE.exe (0x4AF4)    0x48F4    SharePoint Portal Server    User Profiles    ojxm    High    SSP administration site owner is 'i:0#.w|oldaccount\deleted'.    018afcc8-f800-0001-5e35-00e1678bd301
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">SSP administration is a blast from the past.  The reference is back to 2007 but service applications replaced the SSP in SharePoint 2010.  This entry is stating we're looking for owner of the Central Admin.  This value can be exposed by using PowerShell as well.
</span></p><p>$site = Get-SPSite https://centralAdmin:1234
</p><p>$site.Owner
</p><p>
 </p><p>Or the UI with Site Settings and Site Collection Administrators
</p><p><img src="https://msdnshared.blob.core.windows.net/media/2018/05/052618_2244_Unabletosta2.png" alt="" />
	</p><p>Or the <strong>Change site collection administrators</strong> in Central Admin
</p><p><img src="https://msdnshared.blob.core.windows.net/media/2018/05/052618_2244_Unabletosta3.png" alt="" />
	</p><p>
 </p><p>Find that account there and replace it with a valid account then run the Provision() PowerShell.
</p><p>
 </p><p>
 </p>]]></content:encoded>
    </item>
    <item>
      <title>SAML roles and SharePoint 2016/2013 with OAuth</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/saml-roles-and-sharepoint-20162013-with-oauth</link>
      <pubDate>Fri, 02 Mar 2018 14:53:58 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=2385</guid>
      <description><![CDATA[Roles (security groups) with SAML/ADFS will not work with OAuth without some more configuration and...]]></description>
      <content:encoded><![CDATA[Roles (security groups) with SAML/ADFS will not work with OAuth without some more configuration and patching. OAuth affects 2013 Workflows, Office Web Apps, Provider Hosted Apps, Cross Farm Publishing/Consuming scenarios, Hybrid, etc. There are a few steps and requirements that are needed for this to work. <a href="https://support.microsoft.com/en-us/help/3203164/401-unauthorized-error-when-using-oauth-and-saml-claims-in-sharepoint">KB 3203164</a> has some great information on this topic on setting the GroupClaimType.

<strong>NOTE:</strong> SharePoint 2013 must at (or later) March 2016 CU (15.0.4805.1000). SharePoint 2016 introduces the GroupClaimType with the September 2017 (16.0.4588.1000, Feature Pack 2) but we suggest deploying January 2018 PU (16.0.4639.1001) due to the regression causing Windows Claims Oauth augmentation to fail.
<h2>User Profiles are Key</h2>
User profiles are utilized when augmenting the role claims. The groups and users must be imported and synced within the User Profile Service application.

<span style="text-decoration: underline">Map your Identifier claim
</span>

Run this PowerShell script to find the identifier claim:
<div>
<table style="border-collapse: collapse;background: #7f7f7f" border="0"><colgroup> <col style="width: 620px" /></colgroup>
<tbody valign="top">
<tr>
<td valign="middle" style="border: solid 0.5pt;padding: 1px 7px 1px 7px">
<p style="background: white"><span style="color: orangered"><span style="font-family: Lucida Console;font-size: 9pt">$tips <span style="color: darkgray">= <span style="color: blue">Get-SPTrustedIdentityTokenIssuer </span></span></span>
</span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkblue">foreach</span>(<span style="color: orangered">$tip <span style="color: darkblue">in <span style="color: orangered">$tips<span style="color: darkblue">)<span style="color: orangered">
</span></span></span></span></span></span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt">{ </span></p>
<p style="background: white"><span style="color: orangered"><span style="font-family: Lucida Console;font-size: 9pt">$name <span style="color: darkgray">= <span style="color: orangered">$tip<span style="color: darkgray">.<span style="color: orangered">Name<span style="color: darkgray">
</span></span></span></span></span></span>
</span></p>
<p style="background: white"><span style="color: orangered"><span style="font-family: Lucida Console;font-size: 9pt">$claims <span style="color: darkgray">= <span style="color: orangered">$tip<span style="color: darkgray">.<span style="color: orangered">ClaimTypeInformation </span></span></span></span></span>
</span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkblue">foreach</span>(<span style="color: orangered">$claim <span style="color: darkblue">in <span style="color: orangered">$claims<span style="color: darkblue">) </span></span></span></span></span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt">{ </span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: darkblue">If</span>(<span style="color: orangered">$claim<span style="color: darkgray">.<span style="color: orangered">IsIdentityClaim <span style="color: darkgray">-eq<span style="color: orangered"> $true</span>) </span></span></span></span></span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt">{ </span></p>
<p style="background: white"><span style="color: blue"><span style="font-family: Lucida Console;font-size: 9pt">Write-Host <span style="color: navy">-ForegroundColor <span style="color: blueviolet">DarkGreen <span style="color: darkred">"The Identity Claim is listed below for <span style="color: orangered">$name<span style="color: darkred">"<span style="color: orangered">
</span></span></span></span></span></span></span>
</span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$claim</span> } }}</span></p>
</td>
</tr>
</tbody>
</table>
</div>
Example of the script results when Email was the Identifier claim:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/030218_2106_SAMLrolesan1.png" />

In the User Profile Service Application <span style="font-family: Wingdings">à</span> Manage User Properties, edit the properties of the <strong>Claim User Identifier</strong>.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/030218_2106_SAMLrolesan2.png" />

SharePoint 2016's Active Directory Import automatically maps <strong>Claim User Identifier </strong>to <em>saMAccountName</em>. We would need to change that to correct identifier property in Active Directory. Any change in mappings will require a full sync.

Adding a new mapping for the identifier claim:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/030218_2106_SAMLrolesan3.png" />
<h2>Group Membership in User Profiles</h2>
There are two ways to get this information – SQL or PowerShell. The PowerShell one will show nested groups unlike the SQL query.

Run this against your Profile Database and modify the <em>domain\username</em> to fit the user profile that we are searching for. This information would be in the UPA when searching for a User Profile.

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/030218_2106_SAMLrolesan4.png" />

<span style="text-decoration: underline">SQL - SharePoint 2016
</span>

<span style="color: blue;font-family: Consolas;font-size: 9pt">Select <span style="color: teal">upa<span style="color: gray">.<span style="color: teal">UserProfile_Full<span style="color: gray">.<span style="color: teal">NTName<span style="color: gray">,</span> upa<span style="color: gray">.<span style="color: teal">MemberGroup<span style="color: gray">.<span style="color: teal">DisplayName <span style="color: blue">as <span style="color: red">'Group Name'<span style="color: gray">, <span style="color: teal">upa<span style="color: gray">.<span style="color: teal">MemberGroup<span style="color: gray">.<span style="color: teal">SourceReference</span>
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>

<span style="color: blue;font-family: Consolas;font-size: 9pt">From <span style="color: teal">upa<span style="color: gray">.<span style="color: teal">UserProfile_Full <span style="color: blue">with<span style="color: gray">(<span style="color: blue">nolock<span style="color: gray">) JOIN <span style="color: teal">upa<span style="color: gray">.<span style="color: teal">UserMemberships <span style="color: blue">on <span style="color: teal">upa<span style="color: gray">.<span style="color: teal">userprofile_full<span style="color: gray">.<span style="color: teal">RecordID <span style="color: gray">= <span style="color: teal">upa<span style="color: gray">.<span style="color: teal">UserMemberships<span style="color: gray">.<span style="color: teal">RecordID</span>
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>

<span style="color: gray;font-family: Consolas;font-size: 9pt">Join <span style="color: teal">upa<span style="color: gray">.<span style="color: teal">MemberGroup <span style="color: blue">on <span style="color: teal">upa<span style="color: gray">.<span style="color: teal">Usermemberships<span style="color: gray">.<span style="color: teal">MemberGroupId <span style="color: gray">= <span style="color: teal">upa<span style="color: gray">.<span style="color: teal">Membergroup<span style="color: gray">.<span style="color: teal">ID</span>
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>

<span style="color: blue;font-family: Consolas;font-size: 9pt">Where <span style="color: teal">NTName <span style="color: gray">= <span style="color: red">'domain\username'
</span></span></span></span>

<span style="text-decoration: underline">SQL – SharePoint 2013
</span>

<span style="color: blue;font-family: Consolas;font-size: 9pt">Select <span style="color: teal">UserProfile_Full<span style="color: gray">.<span style="color: teal">NTName<span style="color: gray">, <span style="color: teal">MemberGroup<span style="color: gray">.<span style="color: teal">DisplayName <span style="color: blue">as <span style="color: red">'Group Name'<span style="color: gray">, <span style="color: teal">MemberGroup<span style="color: gray">.<span style="color: teal">SourceReference</span>
</span></span></span></span></span></span></span></span></span></span></span></span></span>

<span style="color: blue;font-family: Consolas;font-size: 9pt">From <span style="color: teal">UserProfile_Full <span style="color: blue">with<span style="color: gray">(<span style="color: blue">nolock<span style="color: gray">) JOIN <span style="color: teal">UserMemberships <span style="color: blue">on <span style="color: teal">userprofile_full<span style="color: gray">.<span style="color: teal">RecordID <span style="color: gray">= <span style="color: teal">UserMemberships<span style="color: gray">.<span style="color: teal">RecordID</span>
</span></span></span></span></span></span></span></span></span></span></span></span></span></span>

<span style="color: gray;font-family: Consolas;font-size: 9pt">Join <span style="color: teal">MemberGroup <span style="color: blue">on <span style="color: teal">Usermemberships<span style="color: gray">.<span style="color: teal">MemberGroupId <span style="color: gray">= <span style="color: teal">Membergroup<span style="color: gray">.<span style="color: teal">ID</span>
</span></span></span></span></span></span></span></span></span>

<span style="color: blue;font-family: Consolas;font-size: 9pt">Where <span style="color: teal">NTName <span style="color: gray">= <span style="color: red">'domain\username'</span>
</span></span></span>

<span style="font-family: Consolas;font-size: 9pt">Bdoe has 5 group memberships in the UserProfile service application.
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/030218_2106_SAMLrolesan5.png" /><span style="font-family: Consolas;font-size: 9pt">
</span>

<span style="text-decoration: underline">PowerShell
</span>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$site <span style="color: darkgray">= <span style="color: blue">Get-SPSite <span style="color: darkred">"https://adamsor-2013upa"</span>
</span></span></span></p>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$userprofile <span style="color: darkgray">= <span style="color: darkred">"i:05.t|adfs|user@contoso.com"</span>
</span></span></p>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$ServiceContext <span style="color: darkgray">= [<span style="color: teal">Microsoft.SharePoint.SPServiceContext<span style="color: darkgray">]::</span>GetContext(<span style="color: orangered">$site</span>);
</span></span></span></p>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$pm <span style="color: darkgray">= <span style="color: blue">new-object <span style="color: blueviolet">Microsoft.Office.Server.UserProfiles.UserProfileManager</span>(<span style="color: orangered">$ServiceContext</span>)
</span></span></span></p>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$up <span style="color: darkgray">= <span style="color: orangered">$pm<span style="color: darkgray">.</span>GetUserProfile($userprofile</span>)
</span></span></p>
<p style="background: white"><span style="color: darkgray;font-family: Lucida Console;font-size: 9pt">[<span style="color: teal">xml<span style="color: darkgray">]<span style="color: orangered">$xml <span style="color: darkgray">= </span>($up<span style="color: darkgray">.</span>Memberships<span style="color: darkgray">.</span>GetDataSet())<span style="color: darkgray">.</span>getxml()
</span></span></span></span></p>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$xml<span style="color: darkgray">.</span>SelectNodes(<span style="color: darkred">"//Title"</span>)
</span></p>
Output:

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/030218_2106_SAMLrolesan6.png" />
<h2>GroupClaimType</h2>
This property shown when running Get-SPTrustedIdentityTokenIssuer

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/03/030218_2106_SAMLrolesan7.png" />

As <a href="https://support.microsoft.com/en-us/help/3203164/401-unauthorized-error-when-using-oauth-and-saml-claims-in-sharepoint">KB 3203164</a> states, we only have two options, the Role or GroupSID for claims.

PowerShell:

<span style="color: black;font-family: Consolas;font-size: 11pt">#Create a variable containing the SPTrustedIdentityTokenIssuer object
$issuer = Get-SPTrustedIdentityTokenIssuer</span>

#Set the GroupClaimType property to the Role claim type, do not run for GroupSID claim type
$issuer.GroupClaimType = [Microsoft.IdentityModel.Claims.ClaimTypes]::Role

#Set the GroupClaimType property to the GroupSID claim type, do not run for Role claim type
$issuer.GroupClaimType = [Microsoft.IdentityModel.Claims.ClaimTypes]::GroupSid

#Update the SPTrustedIdenityTokenIssuer object to apply the change
$issuer.Update()
<h2>There is another way….</h2>
Custom claim providers can be developed to augment claims. This can be used instead of completing the steps above. The link below will get you started on that path of development.

<a href="https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-a-claims-provider-in-sharepoint">https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-create-a-claims-provider-in-sharepoint</a>]]></content:encoded>
    </item>
    <item>
      <title>Migrate Users (Move-SPUser) when moving from Windows to SAML/FBA</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/migrate-usersmove-spusers-when-moving-from-windows-to-samlfba</link>
      <pubDate>Tue, 27 Feb 2018 13:02:45 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=2375</guid>
      <description><![CDATA[When adding another authentication provider to a web application like ADFS(SAML) or FBA(LDAP),...]]></description>
      <content:encoded><![CDATA[<span style="font-family: Times New Roman;font-size: 12pt">When adding another authentication provider to a web application like ADFS(SAML) or FBA(LDAP), SharePoint sees these users and roles(groups) as entirely different users and groups than Windows counterparts. The backend Active Directory might be the same along with usernames and passwords but to SharePoint these are different users.
</span>
<h2>Different Users, Different Permissions</h2>
<span style="font-family: Times New Roman;font-size: 12pt">I've deployed ADFS to a web application. I have added both my ADFS and Windows accounts to the site collection. The UserInfo table shows as two different users.
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/022718_1902_Whydoweneed1.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span>

<span style="font-family: Times New Roman;font-size: 12pt">One is a site collection administrator but the other one is not.
</span>
<h2>What's the difference?</h2>
<span style="font-family: Times New Roman;font-size: 12pt">The users will experience different…
</span>
<ul>
 	<li>User Profiles</li>
 	<li>My Sites</li>
 	<li>Permissions(users will report <em>random</em> access denied)</li>
 	<li>Alerts</li>
 	<li>Personal Views</li>
</ul>
<span style="font-family: Times New Roman;font-size: 12pt">People picker will also show two different accounts. This will further confuse end users on which account is correct.
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/02/022718_1902_Whydoweneed2.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span>
<h2>The Best Practice</h2>
<span style="font-family: Times New Roman;font-size: 12pt">Migrate the farm to utilize one type of authentication. Mixed authentication can be done but only for a subset of users. If you're utilizing ADFS, I suggest checking out my previous post on <a href="https://blogs.technet.microsoft.com/adamsorenson/2018/01/17/sharepoint-20132016-migrate-from-windows-claims-to-adfs/">how to migrate to ADFS from Windows claims.</a>
</span>

<span style="font-family: Times New Roman;font-size: 12pt">If you're wanting to keep Windows Authentication but need something like SAML for working away from the office, I would suggest checking out <a href="https://www.sharepoint4developers.net/en-nz/post/wap-adfs-sp2013-kerberos.aspx">Web Application Proxy (WAP)</a>. This will not require SharePoint to migrate any of the users. The SAML authentication happens at WAP then translate the token to Kerberos for SharePoint. </span>]]></content:encoded>
    </item>
    <item>
      <title>Deleting User Profiles Using PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/deleting-user-profiles-using-powershell</link>
      <pubDate>Tue, 20 Feb 2018 13:47:11 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=127</guid>
      <description><![CDATA[There are many reasons why we would want to use a PowerShell shell script to delete user profiles....]]></description>
      <content:encoded><![CDATA[<p>There are many reasons why we would want to use a PowerShell shell script to delete user profiles. <span style="font-size:12pt">
		</span></p><ol><li>We don't want to use or trust the My Site Cleanup job.
</li><li>We have a batch of stub user profiles that need to be deleted.
</li><li>We just want to delete some user profiles for testing purposes.
</li><li>We don't want to wait 30 days before the User Profile is deleted by the My Site Cleanup timer job(applies only to SharePoint 2016)
</li></ol><p><strong>NOTE:</strong> Deleting user profiles with this script will delete just the user profile.  This will not delete their My Site or send out that notification like the My Site cleanup job. <span style="color:red"><strong>WARNING: This script will delete user profiles specified in the file. The only other means to recover the user profile is to restore the Profile DB from backup. </strong></span>
	</p><h2>The List
</h2><p>There are a few ways that we can gather a list of user profiles. We can query the profile database, run GetNonImportedObjects, or we already have a list that we want to delete. 
</p><ol><li>Profile DB query - Select NtName from UserProfile_Full with(nolock) where bdeleted=1
</li><li><div>PowerShell
</div><p style="background: white"><span style="color:orangered"><span style="font-family:Lucida Console;font-size:9pt">$upa <span style="color:darkgray">= <span style="color:blue">Get-spserviceapplication <span style="color:darkgray">| <span style="color:blue">?<span style="color:darkgray">{<span style="color:orangered">$_<span style="color:darkgray">.<span style="color:orangered">typename<span style="color:darkgray"> -match <span style="color:darkred">"profile"<span style="color:darkgray">}<span style="color:blue">
																	</span></span></span></span></span></span></span></span></span></span></span></span></span><span style="font-family:Times New Roman;font-size:12pt">
					</span></span></p></li></ol><p style="background: white"><span style="color:blue"><span style="font-family:Lucida Console;font-size:9pt">Set-SPProfileServiceApplication <span style="color:orangered">$upa <span style="color:navy">-GetNonImportedObjects <span style="color:orangered">$true <span style="color:darkgray">| <span style="color:blue">out-file <span style="color:blueviolet">c:\temp\NonImportedProfiles.txt </span></span></span></span></span></span></span><span style="font-family:Times New Roman;font-size:12pt">
			</span></span></p><p>We just want the list to be a text file with the a NTName on each line. <img src="https://msdnshared.blob.core.windows.net/media/2018/02/022018_1956_DeletingUse1.png" alt="" />
	</p><h2>Parameters
</h2><p style="background: white"><img src="https://msdnshared.blob.core.windows.net/media/2018/02/022018_1956_DeletingUse2.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p style="background: white"><span style="font-family:Times New Roman;font-size:12pt">We will just need to modify the top 3 lines to adjust it for our farm. The first is </span><span style="color:orangered;font-family:Lucida Console;font-size:9pt">$siteurl</span><span style="font-family:Times New Roman;font-size:12pt">. This should be URL that is consuming from the User Profile Service Application. The </span><span style="color:orangered;font-family:Lucida Console;font-size:9pt">$file </span><span style="font-family:Times New Roman;font-size:12pt">is the location and name of the input file we created above. The </span><span style="color:orangered;font-family:Lucida Console;font-size:9pt">$log</span><span style="font-family:Times New Roman;font-size:12pt"> is for the location of the log file(Yes, there is logging with my PowerShell scripts). Just make sure the directory is created.
</span></p><p style="background: white"><span style="font-family:Times New Roman;font-size:12pt">One gotcha is to make sure the account running this script has permissions to the User Profile service application. This can be accomplished in Central Admin with adding the account into <strong>Permissions</strong> with <strong>Full Control</strong>.
</span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2018/02/022018_1956_DeletingUse3.png" alt="" /><img src="https://msdnshared.blob.core.windows.net/media/2018/02/022018_1956_DeletingUse4.png" alt="" />
	</p><p><a href="https://gallery.technet.microsoft.com/office/User-Profile-Deletion-a25e8231"><h2><span style="color:#0563c1;text-decoration:underline">Link to the Script</span></h2></a></p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2016 MIM and SAML/FBA User Profiles</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/sharepoint-2016-mim-and-samlfba-user-profiles</link>
      <pubDate>Wed, 31 Jan 2018 10:42:40 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=25</guid>
      <description><![CDATA[There is not much out there about MIM and SharePoint 2016 with FBA or SAML user profiles.  Using...]]></description>
      <content:encoded><![CDATA[<p><span style="color:black">There is not much out there about MIM and SharePoint 2016 with FBA or SAML user profiles.  Using Active Directory Import is still the same as it was in 2013.   Below we will be going through how to set this up for SAML(ADFS) and MIM.</span>
		<span style="color:black">This guide assumes the environment has been setup from these steps at <a href="https://technet.microsoft.com/en-us/library/mt637055(v=office.16).aspx">https://technet.microsoft.com/en-us/library/mt637055(v=office.16).aspx</a></span>
	</p><h1>Why should we do this?
</h1><p>The account name for user profiles are important and what is used to get the profile.  Windows Authentication user profiles are just "domain\username" for the account name.  When SAML or FBA users invoke the user profiles, the profile service will search for the complete claim(example:  "i:05.t|adfs30|User1").  If the user profile is not there, a stub profile will be created.  This will give the user two profiles.  The main one with SAML/FBA will NOT be sync'd since we would need configure MIM know the claim prefix.
</p><p>
 </p><p><span style="color:black">1.<span style="font-size:7pt">       </span>Open MIM client then Metaverse Designer.  Select "person" then "Add Attribute".</span>
		<span style="font-size:12pt">
		</span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/02/MIM-MetaverseDesigner.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p style="margin-left: 36pt"><span style="font-size:12pt"><span style="color:black">New Attribute button.</span><span style="font-family:Times New Roman">
			</span></span></p><p style="margin-left: 36pt"><img src="https://msdnshared.blob.core.windows.net/media/2017/02/MIM-NewAttr.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p style="margin-left: 36pt"><span style="font-size:12pt"><span style="color:black">Type in "SPS-ClaimID" for Attribute Name</span><span style="font-family:Times New Roman">
			</span></span></p><p style="margin-left: 36pt"><img src="https://msdnshared.blob.core.windows.net/media/2017/02/MIM-NewAttr2.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p style="margin-left: 36pt"><span style="font-size:12pt"><span style="color:black">Click OK</span><span style="font-family:Times New Roman">
			</span></span></p><p><span style="color:black">2. Open the ADMA then Configure Attribute Flow. Select user/person</span>
	</p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/02/MIM-Mapping11.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p>
 </p><p><span style="color:black"><span style="font-size:12pt">a.</span><span style="font-family:Times New Roman;font-size:7pt">       </span><span style="font-size:12pt">Map your Claim identifier for your SAML users to SPS-ClaimID.  The direction should be Import and Direct.</span></span><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/02/MIM-Mapping.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="color:black"><span style="font-size:12pt">b.</span><span style="font-family:Times New Roman;font-size:7pt">       </span><span style="font-size:12pt">Click "New".</span></span><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="color:black"><span style="font-family:Times New Roman;font-size:7pt">
			</span><span style="font-size:12pt">Find SPS-ClaimProviderType and SPS-ClaimProviderID in MetaVerse object type.  Below is PowerShell to find your SAML Identity Claim.
</span></span></p><div><table style="border-collapse:collapse;background: #7f7f7f" border="0"><colgroup><col style="width:623px" /></colgroup><tbody valign="top"><tr><td style="padding-left: 7px;padding-right: 7px;border-top:  solid 0.5pt;border-left:  solid 0.5pt;border-bottom:  solid 0.5pt;border-right:  solid 0.5pt"><p style="background: white"><span style="color:orangered;font-family:Lucida Console;font-size:9pt">$tips <span style="color:darkgray">= <span style="color:blue">Get-SPTrustedIdentityTokenIssuer
</span></span></span></p><p style="background: white"><span style="font-family:Lucida Console;font-size:9pt"><span style="color:darkblue">foreach</span>(<span style="color:orangered">$tip <span style="color:darkblue">in <span style="color:orangered">$tips</span>)</span>
								</span></span></p><p style="background: white"><span style="font-family:Lucida Console;font-size:9pt">{
</span></p><p style="background: white"><span style="color:orangered;font-family:Lucida Console;font-size:9pt">$name <span style="color:darkgray">= <span style="color:orangered">$tip<span style="color:darkgray">.</span>Name</span>
								</span></span></p><p style="background: white"><span style="color:orangered;font-family:Lucida Console;font-size:9pt">$claims <span style="color:darkgray">= <span style="color:orangered">$tip<span style="color:darkgray">.</span>ClaimTypeInformation
</span></span></span></p><p style="background: white"><span style="font-family:Lucida Console;font-size:9pt">
								<span style="color:darkblue">foreach</span>(<span style="color:orangered">$claim <span style="color:darkblue">in <span style="color:orangered">$claims</span>)
</span></span></span></p><p style="background: white"><span style="font-family:Lucida Console;font-size:9pt">    {
</span></p><p style="background: white"><span style="font-family:Lucida Console;font-size:9pt">
								<span style="color:darkblue">If</span>(<span style="color:orangered">$claim<span style="color:darkgray">.</span>IsIdentityClaim <span style="color:darkgray">-eq</span> $true</span>)
</span></p><p style="background: white"><span style="font-family:Lucida Console;font-size:9pt">        {
</span></p><p style="background: white"><span style="font-family:Lucida Console;font-size:9pt">
								<span style="color:blue">Write-Host <span style="color:navy">-ForegroundColor <span style="color:blueviolet">DarkGreen <span style="color:darkred">"The Identity Claim is listed below for <span style="color:orangered">$name<span style="color:darkred">"</span>
												</span></span></span></span></span></span></p><p style="background: white"><span style="font-family:Lucida Console;font-size:9pt">
								<span style="color:orangered">$claim</span>        }    }}</span></p></td></tr></tbody></table></div><p>
 </p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/02/MIM-Mapping3.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="font-size:12pt"><span style="color:black">Select "Advanced" for "Mapping type" and "Import" for Direction.  Click New.  </span><span style="font-family:Times New Roman">
			</span></span></p><p><span style="font-size:12pt"><span style="color:black">The constant value SPS-ClaimProviderID will be the name of your SAML provider when you created it.  </span><span style="font-family:Times New Roman">
			</span></span></p><p><span style="font-size:12pt"><span style="color:black">SPS-ClaimProviderType will be "Trusted" if you're using a Trusted provider.</span><span style="font-family:Times New Roman">
			</span></span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/02/MIM-Mapping4.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="color:black">3.<span style="font-size:7pt">       </span>Open SharePoint MA(SPMA). Click on Select Attributes.  Check the box for SPS-ClaimID.</span>
	</p><p><span style="color:black">4.<span style="font-size:7pt">      </span>Configure Attribute Flow. Select user/person.</span>
	</p><p><span style="color:black"><span style="font-size:12pt">a.</span><span style="font-family:Times New Roman;font-size:7pt">       </span><span style="font-size:12pt">Map SPS-ClaimID to SPS-ClaimID.  The direction will be export and Direct.  Click new.  </span></span><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="font-size:12pt">I'm using UPN for my environment.  This will be the identifier claim which could be email or samaccountname(see above for PowerShell).<span style="font-family:Times New Roman">
			</span></span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/02/MIM-Mapping.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="color:black">5.<span style="font-size:7pt">       </span>Run a full sync</span></p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint 2013/2016 - Migrate from Windows claims to ADFS</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/sharepoint-20132016-migrate-from-windows-claims-to-adfs</link>
      <pubDate>Wed, 17 Jan 2018 09:08:27 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=465</guid>
      <description><![CDATA[Many farms are moving from Windows Authentication(NTLM or Kerberos) to SAML. This migration and...]]></description>
      <content:encoded><![CDATA[<span style="font-family: Times New Roman;font-size: 12pt">Many farms are moving from Windows Authentication(NTLM or Kerberos) to SAML. This migration and change requires a lot of planning. This guide is only to give a frame work of migrating some of the simpler farms. This guide also assumes that the ADFS server is already setup and just needs to be configured.
</span>

<span style="font-family: Times New Roman;font-size: 12pt">The difference of this guide and other guides are two things. We will be using the -UseDefaultConfiguration when created the trusted identity token issuer. This will give us an OOB claims provider instead of having your farm fending for itself with the people picker/claim provider. The next difference is the user and group migrations. We will be using Convert-SPWebapplication instead of developing a script to use Move-SPUser. More details later in the post about both of these.
</span>

<span style="font-family: Times New Roman;font-size: 12pt"><span style="color: red"><strong>Requirements</strong></span>:
</span>
<ol>
 	<li>The SharePoint farm has to be at <a href="https://support.microsoft.com/kb/2881061">June 2014 CU</a> (or higher) for SharePoint 2013(15.0.4623.1001).</li>
 	<li>The web applications must be Windows Claims. SAML is not supported on classic.</li>
 	<li>ADFS must be backed with the same Active Directory used in Windows Claims.</li>
</ol>
<h1>Steps to be completed:</h1>
<ol>
 	<li>Configure ADFS</li>
 	<li>Creating Trusted Identity Provider</li>
 	<li>Migrate Users and Groups</li>
</ol>
<h1>Config ADFS</h1>
<span style="font-family: Times New Roman;font-size: 12pt">As stated above we assume the ADFS server is setup and connected to AD and ready to configure the Relying Party Trusts.
</span>
<ol>
 	<li>
<div>In <strong>AD FS</strong>, right click <strong>Relying Party Trusts</strong> and select <strong>Add Relying Party Trust</strong>.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint21.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>This will bring up <strong>Add Relying Party Trust Wizard</strong>. Click <strong>Start</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint22.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>Click <strong>Enter data about the relying party manually</strong>, <strong>Next.</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint23.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>Type in a display name and description(optional). Click <strong>Next</strong>.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint24.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>We want to select <strong>AD FS 1.0 and 1.1 profile</strong> since SharePoint does not support anything but SAML 1.1.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint25.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>We will need to enter in the web application with <strong>/_trust</strong>. This will need to be HTTPS.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint26.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>We will need to add in the realm for an identifier. I entered in <strong>urn:sp13:contoso. </strong>We will be using this on the SharePoint side.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint27.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>I'm not using Multi-factor so just clicking <strong>Next</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint28.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>We're permitting everybody through. Click <strong>Next</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint29.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>Click <strong>Next</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint210.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>Click <strong>Close </strong>and leave the box checked. We will be mapping claims.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint211.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>In the <strong>Issuance Transform Rules</strong>, click <strong>Add Rule…</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint212.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>Leave the drop down value at <strong>Send LDAP Attributes as Claims</strong>. Click <strong>Next</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint213.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>Give the claim rule a name. Select <strong>Active Directory</strong> from the dropdown.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint214.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>We will only be mapping the required fields here. The first one we will map is your identifier claim. This is the claim that a user needs to have in AD to sign in. The only choices <em>Account-Name, Email or USER-PRINCIPAL-NAME</em>. Adjust your guide as needed. I will be using Email. The only other Claim is for security groups.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint215.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
</ol>
<div>
<table style="border-collapse: collapse" border="0"><colgroup> <col style="width: 381px" /> <col style="width: 398px" /></colgroup>
<tbody valign="top">
<tr style="height: 17px">
<td valign="middle" style="border: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt;text-decoration: underline"><strong>LDAP Attribute</strong></span></td>
<td valign="middle" style="border-top: solid 0.5pt;border-left: none;border-bottom: solid 0.5pt;border-right: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt;text-decoration: underline"><strong>Outgoing Claim Type</strong></span></td>
</tr>
<tr style="height: 18px">
<td valign="middle" style="border-top: none;border-left: solid 0.5pt;border-bottom: solid 0.5pt;border-right: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt">User-Principal-Name</span></td>
<td valign="middle" style="border-top: none;border-left: none;border-bottom: solid 0.5pt;border-right: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt">UPN</span></td>
</tr>
<tr style="height: 17px">
<td valign="middle" style="border-top: none;border-left: solid 0.5pt;border-bottom: solid 0.5pt;border-right: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt">E-Mail-Address</span></td>
<td valign="middle" style="border-top: none;border-left: none;border-bottom: solid 0.5pt;border-right: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt">E-Mail Address</span></td>
</tr>
<tr style="height: 17px">
<td valign="middle" style="border-top: none;border-left: solid 0.5pt;border-bottom: solid 0.5pt;border-right: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt">SAM-Account-Name</span></td>
<td valign="middle" style="border-top: none;border-left: none;border-bottom: solid 0.5pt;border-right: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt">Windows account name</span></td>
</tr>
<tr style="height: 18px">
<td valign="middle" style="border-top: none;border-left: solid 0.5pt;border-bottom: solid 0.5pt;border-right: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt">Token-Groups as SIDs</span></td>
<td valign="middle" style="border-top: none;border-left: none;border-bottom: solid 0.5pt;border-right: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="font-family: Times New Roman;font-size: 12pt">Group SID</span></td>
</tr>
</tbody>
</table>
</div>
<ol>
 	<li>
<div>We will need the Token-sign certificate from ADFS. Click on <strong>Certificates, </strong>then click on the <strong>token-signing</strong> certificate, then <strong>View Certificate</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint216.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>Click on <strong>Details</strong> tab and <strong>Copy to File…</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint217.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>DER .CER is the file format we want. Click <strong>Next</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint218.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>Give the file a name and location. Click <strong>Next</strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint219.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>
<div>Click <strong>Finish. </strong>Copy the certificate to the SharePoint server.</div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint220.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
</ol>
<h1>Creating Trusted Identity Provider</h1>
<ol>
 	<li>
<div>On the SharePoint server, open <strong>PowerShell ISE.</strong> We will be loading the SharePoint module using <strong>Add-PSSnapin *sharepoint* </strong></div>
<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint221.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></li>
 	<li>This is to set the path of the token signing certificate we got from ADFS<strong>
</strong></li>
</ol>
<div>
<table style="border-collapse: collapse;background: #7f7f7f" border="0"><colgroup> <col style="width: 1140px" /></colgroup>
<tbody valign="top">
<tr style="height: 35px">
<td valign="middle" style="border: solid 0.5pt;padding: 1px 7px 1px 7px">
<p style="background: white"><span style="color: orangered"><span style="font-family: Lucida Console;font-size: 9pt">$adfscertPath <span style="color: darkgray">= <span style="color: darkred">"c:\adfstoken.cer" </span></span></span><span style="font-family: Times New Roman;font-size: 12pt">
</span></span></p>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$adfscert <span style="color: darkgray">= <span style="color: blue">New-Object <span style="color: blueviolet">System.Security.Cryptography.X509Certificates.X509Certificate2<span style="color: blue">(<span style="color: orangered">$adfsCertPath<span style="color: blue">)</span></span></span></span></span></span></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p style="margin-left: 18pt">3. We want SharePoint to trust the certificate.<strong>
</strong></p>

<div>
<table style="border-collapse: collapse;background: #7f7f7f" border="0"><colgroup> <col style="width: 1139px" /></colgroup>
<tbody valign="top">
<tr style="height: 14px">
<td valign="middle" style="border: solid 0.5pt;padding: 1px 7px 1px 7px"><span style="color: blue;font-family: Lucida Console;font-size: 9pt">New-SPTrustedRootAuthority <span style="color: navy">-Name <span style="color: darkred">"ADFS Token Signing Cert" <span style="color: navy">-Certificate <span style="color: orangered">$adfscert</span></span></span></span></span></td>
</tr>
</tbody>
</table>
</div>
<p style="margin-left: 18pt">4. The script to create the trusted provider in SharePoint.</p>
<p style="margin-left: 36pt"><span style="font-family: Times New Roman;font-size: 12pt">The -Realm is what we put in as an identifier for ADFS(urn:sp13:contoso)
</span></p>
<p style="margin-left: 36pt"><span style="font-family: Times New Roman;font-size: 12pt">The -IdentifierClaimIs can only be <strong>ACCOUNT-NAME</strong>, <strong>EMAIL</strong>, or <strong>USER-PRINCIPAL-NAME</strong>.
</span></p>
<p style="margin-left: 36pt"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint222.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></p>

<div>
<table style="border-collapse: collapse;background: #7f7f7f" border="0"><colgroup> <col style="width: 1156px" /></colgroup>
<tbody valign="top">
<tr style="height: 60px">
<td valign="middle" style="border: solid 0.5pt;padding: 1px 7px 1px 7px">
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$ap <span style="color: darkgray">= <span style="color: blue">New-SPTrustedIdentityTokenIssuer <span style="color: navy">-Name <span style="color: darkred">"ADFS" <span style="color: navy">-Description <span style="color: darkred">"ADFS provider" <span style="color: navy">-Realm <span style="color: darkred">"urn:sp13:contoso" <span style="color: navy">-ImportTrustCertificate <span style="color: orangered">$adfscert <span style="color: navy">-signInURL <span style="color: darkred">"https://adfs.contoso.com/adfs/ls" <span style="color: navy">-UseDefaultConfiguration -IdentifierClaimIs <span style="color: blueviolet">EMAIL</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p style="margin-left: 36pt"><span style="font-family: Times New Roman;font-size: 12pt"> We can add in more claims after the trusted provider is created. Example is below of adding a role claim.
</span></p>

<div style="margin-left: 36pt">
<table style="border-collapse: collapse;background: #7f7f7f" border="0"><colgroup> <col style="width: 1120px" /></colgroup>
<tbody valign="top">
<tr style="height: 88px">
<td style="padding-left: 7px;padding-right: 7px;border: solid 0.5pt">
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$ap <span style="color: darkgray">= <span style="color: blue">Get-SPTrustedIdentityTokenIssuer <span style="color: darkred">"ADFS"</span>
</span></span></span></p>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$ap<span style="color: darkgray">.</span>ClaimTypes<span style="color: darkgray">.</span>Add(<span style="color: darkred">"https://schemas.microsoft.com/ws/2008/06/identity/claims/role"</span>)
</span></p>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$map <span style="color: darkgray">= <span style="color: blue">New-SPClaimTypeMapping</span>
<span style="color: darkred">"https://schemas.microsoft.com/ws/2008/06/identity/claims/role" <span style="color: navy">-IncomingClaimTypeDisplayName</span> "Role"</span>
<span style="color: navy">-SameAsIncoming</span>
</span></span></p>
<p style="background: white"><span style="font-family: Lucida Console;font-size: 9pt"><span style="color: orangered">$ap<span style="color: darkgray">.</span>AddClaimTypeInformation($map</span>)
</span></p>
<p style="background: white"><span style="color: orangered;font-family: Lucida Console;font-size: 9pt">$ap<span style="color: darkgray">.</span>Update()
</span></p>
</td>
</tr>
</tbody>
</table>
</div>
5. Associate the new trusted provider to your web application(s). In central admin, select <strong>Application Management</strong>, then <strong>Manage web applications. </strong>Select your web application, then <strong>Authentication Providers</strong>. For each zone, select <strong>Windows Authentication</strong> and <strong>Trust Identity provider. </strong>Both are required for the migration.
<p style="margin-left: 36pt"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint223.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span></p>

<h1>Migrate Users and Groups</h1>
<span style="font-family: Times New Roman;font-size: 12pt">The migration of users and groups are very similar to the migration scripts with a difference of the groups. The groups will change from Windows claim + SID to ADFS + SID. Other migrations are passing the unqualified name through the SAML token. The claim provider that is provisioned will not show you the SID just like Windows does either.
</span>

<span style="font-family: Times New Roman;font-size: 12pt">The PowerShell we will be running is Convert-SPWebApplication.
</span>
<div>
<table style="border-collapse: collapse;background: #7f7f7f" border="0"><colgroup> <col style="width: 1187px" /></colgroup>
<tbody valign="top">
<tr style="height: 37px">
<td valign="middle" style="border: solid 0.5pt;padding: 1px 7px 1px 7px">
<p style="background: white"><span style="color: orangered"><span style="font-family: Lucida Console;font-size: 9pt">$wa <span style="color: darkgray">= <span style="color: blue">get-spwebapplication <a href="https://contoso">https://contoso</a><span style="color: blueviolet">
</span></span></span></span><span style="font-family: Times New Roman;font-size: 12pt">
</span></span></p>
<p style="background: white"><span style="color: blue;font-family: Lucida Console;font-size: 9pt">Convert-SPWebApplication <span style="color: navy">-Identity <span style="color: orangered">$wa <span style="color: navy">-From <span style="color: blueviolet">CLAIMS-WINDOWS <span style="color: navy">-To <span style="color: blueviolet">CLAIMS-TRUSTED-DEFAULT <span style="color: navy">-TrustedProvider <span style="color: orangered">$ap <span style="color: navy">-RetainPermissions </span></span></span></span></span></span></span></span></span></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<span style="font-family: Times New Roman;font-size: 12pt">This will need to be run on each web application. After the conversion is done, you can disable the Windows Authentication.
</span>

<span style="font-family: Times New Roman;font-size: 12pt">People picker will have two results for all users that have an Email address in Active Directory. The ADFS results is the one we would want to select.
</span>

<img alt="" src="https://msdnshared.blob.core.windows.net/media/2018/01/011818_0019_SharePoint224.png" /><span style="font-family: Times New Roman;font-size: 12pt">
</span>
<h1><span style="text-decoration: underline">Resources </span></h1>
<span style="font-family: Times New Roman;font-size: 12pt">The Convert-SPWebApplication command cannot convert from Windows claims to SAML in SharePoint Server 2013 - <a href="https://support.microsoft.com/en-us/help/3042604/the-convert-spwebapplication-command-cannot-convert-from-windows-claim%20">https://support.microsoft.com/en-us/help/3042604/the-convert-spwebapplication-command-cannot-convert-from-windows-claim</a>
</span>

<span style="font-family: Times New Roman;font-size: 12pt">Configure SAML-based claims authentication with AD FS in SharePoint 2013 - <a href="https://technet.microsoft.com/en-us/library/hh305235.aspx">https://technet.microsoft.com/en-us/library/hh305235.aspx</a>
</span>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint - FBA - 8306 - The security token username and password could not be validated.</title>
      <link>https://docs.microsoft.com/archive/blogs/adamsorenson/sharepoint-fba-8306-the-security-token-username-and-password-could-not-be-validated</link>
      <pubDate>Sat, 23 Dec 2017 18:33:04 GMT</pubDate>
      <dc:creator><![CDATA[ASorenson8]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/adamsorenson/?p=135</guid>
      <description><![CDATA[Forms based authentication(FBA) can have general bucket errors. In this blog post, I will be going...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:Times New Roman;font-size:12pt">Forms based authentication(FBA) can have general bucket errors. In this blog post, I will be going over the 8306. This one seems to stump many people and can be difficult to trouble shoot if we don't know where to start. 
</span></p><p>
 </p><h1>What flavor of FBA? 
</h1><p><span style="font-family:Times New Roman;font-size:12pt">FBA can come in various deployments with the backend being SQL, .NET, etc. The most common being LDAP which I will be using in this post for the 8306. The deployment documents for this is in the following TechNet articles. 
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">2013 - <a href="https://technet.microsoft.com/en-us/library/ee806890.aspx">https://technet.microsoft.com/en-us/library/ee806890.aspx</a>
		</span></p><p><span style="font-family:Times New Roman;font-size:12pt">2010 - <a href="https://technet.microsoft.com/en-us/library/ee806890(v=office.14).aspx">https://technet.microsoft.com/en-us/library/ee806890(v=office.14).aspx</a>
		</span></p><p>
 </p><h1>What Process is tossing 8306? 
</h1><p><span style="font-family:Times New Roman;font-size:12pt">The error that we're chasing down can be reproduced in any environment with FBA. The text of the error states we have failed to issue a token. 
</span></p><div><table style="border-collapse:collapse" border="0"><colgroup><col style="width:1273px" /></colgroup><tbody valign="top"><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-top:  solid 0.5pt;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">Log Name: Application</span></p></td></tr><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">Source: Microsoft-SharePoint Products-SharePoint Foundation</span></p></td></tr><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">Date: 12/23/2017 3:00:50 PM</span></p></td></tr><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">Event ID: 8306</span></p></td></tr><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">Task Category: Claims Authentication</span></p></td></tr><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">Level: Error</span></p></td></tr><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">Keywords: </span></p></td></tr><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">User: contoso\mosssvc</span></p></td></tr><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">Computer: WFE1.contoso.com</span></p></td></tr><tr style="height: 16px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">Description:</span></p></td></tr><tr style="height: 15px"><td vAlign="middle" style="padding-top: 1px;padding-left: 7px;padding-bottom: 1px;padding-right: 7px;border-left:  solid 0.5pt;border-bottom:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="font-family:Times New Roman;font-size:12pt">An exception occurred when trying to issue security token: The security token username and password could not be validated..</span></p></td></tr></tbody></table></div><p><span style="font-family:Times New Roman;font-size:12pt">This is being tossed by the web application's application pool(0x2AD0) but really it's bubbling up from the Security Token Service. 
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">ULS logs shows us the exception for the web app: 
</span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/12/122417_0034_SharePointF1.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="font-family:Times New Roman;font-size:12pt">Here you can see the failure happen earlier in the request(filter by correlationID) in the STS: 
</span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/12/122417_0034_SharePointF2.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="font-family:Times New Roman;font-size:12pt">With this information we need to take a Network trace from the WFE since it's making the request to the DC(Domain Controller).   I use a tool called <a href="https://www.microsoft.com/en-US/download/details.aspx?id=4865">Netmon 3.4</a>  We can check the web.config of the STS to see where we are pointing to verifying the username and password.
</span></p><div><table style="border-collapse:collapse" border="0"><colgroup><col style="width:623px" /></colgroup><tbody valign="top"><tr><td style="padding-left: 7px;padding-right: 7px;border-top:  solid 0.5pt;border-left:  solid 0.5pt;border-bottom:  solid 0.5pt;border-right:  solid 0.5pt"><p><span style="color:black;font-family:Consolas;font-size:10pt">&lt;membership&gt;
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">      &lt;providers&gt;
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">        &lt;add name="membership" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             type="Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">
								<span style="background-color:yellow">server="yourserver.com"</span>
							</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             port="389" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             useSSL="false" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             userDNAttribute="distinguishedName" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             userNameAttribute="sAMAccountName" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             userContainer="OU=UserAccounts,DC=internal,DC=yourcompany,DC=com" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             userObjectClass="person" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             userFilter="(&amp;amp;(ObjectClass=person))" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             scope="Subtree" 
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">             otherRequiredUserAttributes="sn,givenname,cn" /&gt;
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">      &lt;/providers&gt;
</span></p><p><span style="color:black;font-family:Consolas;font-size:10pt">    &lt;/membership&gt;</span><span style="font-family:Times New Roman;font-size:12pt">
							</span></p></td></tr></tbody></table></div><p><span style="font-family:Times New Roman;font-size:12pt">LDAP is used over ports 386 and 636(SSL).  Netmon has standard filters that can be applied.
</span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/12/122417_0034_SharePointF3.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="font-family:Times New Roman;font-size:12pt">Netmon on the WFE: 
</span></p><p><img src="https://msdnshared.blob.core.windows.net/media/2017/12/122717_1611_SharePointF1.png" alt="" /><span style="font-family:Times New Roman;font-size:12pt">
		</span></p><p><span style="font-family:Times New Roman;font-size:12pt">The Netmon here show that we're not getting any response from the DC which is one example of this error. Others may manifest itself as different issues all together. 
</span></p><h1>Root Cause? 
</h1><p><span style="font-family:Times New Roman;font-size:12pt">The ULS logs usually just says it failed while trying to validate the Username and Password. 
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">12/23/2017 16:09:35.77    w3wp.exe (0x5A80)    0x92C0    SharePoint Foundation    Claims Authentication    fo1t    Monitorable    STS Call: Failed to issue new security token. Exception: System.ServiceModel.FaultException`1[Microsoft.IdentityModel.Tokens.FailedAuthenticationException]: <span style="background-color:yellow">The security token username and password could not be validated</span>. (Fault Detail is equal to Microsoft.IdentityModel.Tokens.FailedAuthenticationException: The security token username and password could not be validated.).    7580399e-8900-708b-67e2-ab7bcf6013a3 
</span></p><p><span style="font-family:Times New Roman;font-size:12pt">Here are the most common reasons you'll see 8306 in your FBA deployment: 
</span></p><ol><li>Somebody put in the wrong username and password 
</li><li>Communication with the DC(in my example above I had a firewall block LDAP traffic) 
</li><li>Misconfiguration of the web.configs 
</li></ol><p><span style="font-family:Times New Roman;font-size:12pt">The first reason is odd one, but it's true. Putting in incorrect credentials will toss a 8306 with the same text as above (The user name and password is not validated.). If you're seeing inconsistent results, you might have a DC that isn't responding correctly which the Netmon will be valuable to isolate the issue to one WFE or DC that is affected.</span></p>]]></content:encoded>
    </item>
  </channel>
</rss>