SharePoint SAML Migration Guide – Part 4 Web Applications

SharePoint SAML Migration Guide – Part 1 Planning

SharePoint SAML Migration Guide – Part 2 Trusted Identity

SharePoint SAML Migration Guide – Part 3 Migration

SharePoint SAML Migration Guide – Part 4 Web Applications

SharePoint SAML Migration Guide – Part 5 User Profiles

The web application decision depends on a few different things. We need to keep in mind that we need the default zone to have Windows Authentication enabled for the crawler. This comes with some unintended issues that we can run into.

Authentication Picker

Enabling more than one authentication in the same zone will cause SharePoint’s default sign in page to be the authentication picker page.


This is usually not ideal since we’re migrating users from Windows to SAML. Since we want Windows Authentication enabled for the crawler, we can force users to use SAML by changing the sign in page to /_trust/default.aspx.


One thing we will run into is the People Picker resolving both SAML and Windows Claims. This is not ideal since these are two different users to SharePoint which will cause end user confusion among other things.


We can hide the Windows results from people picker by changing the Active Directory Claim provider. The PowerShell will make this change farm wide. This would mean no Windows Claim results. We can work around that by adding those claims using PowerShell.

 
$cpm = Get-SPClaimProviderManager 
$adcp = $cpm.ClaimProviders | ? {$_.displayname -eq "Active Directory"} 
$adcp.IsVisible = $false 
$cpm.Update() 

 

Extending the Web Application

The other option would be to extend the web application. Depending on the existing web applications and host headers, we might have to recreate the web application due to the Zone’s names.

Consider the following scenario:

We have a web application that has the following host name in the default zone: https://contoso.com

We would still like to use https://contoso.com, so extending would need a different name. Ideally, we would want an internal name for the default zone.

Host header

Zone

Authentication

http://WFE1:999

Default

Windows (NTLM or Kerberos)

https://contoso.com

Intranet

SAML

Users would be signing into the Intranet but the starting address (crawl target) would use the default zone. To make this happen, we would need to recreate the web application.


We don’t need Windows enabled since it’s enabled in the Default zone. This warning a good reminder that we need Windows Authentication for the crawler.



Click OK to extend the web application. Don’t forget to bind a certificate in IIS for the newly created site.



 

SharePoint SAML Migration Guide – Part 3 Migration

SharePoint SAML Migration Guide – Part 1 Planning

SharePoint SAML Migration Guide – Part 2 Trusted Identity

SharePoint SAML Migration Guide – Part 3 Migration

SharePoint SAML Migration Guide – Part 4 Web Applications

SharePoint SAML Migration Guide – Part 5 User Profiles

Now that we have our Identity provider built we can move on to Migration. There are some misconceptions about SAML users and Windows users. There are a few blog posts out there(including mine) explaining why we need to migrate.

Depending on how the trusted provider was built in step 2 will determine the way we will migrate the users. The two options are to use Move-SPUser or Convert-SPWebApplication.

Move-SPUser

Move-SPUser has been around since the 2010 version shipped and is the same as stsadm migrateuser command. This can be used to migrate users or groups. Running Move-SPUser is a farm wide migration. This means, all web applications, user profiles, etc. will be migrated. There are many scripts out there that we get the users and groups from the site collections which then migrates them to the SAML claims.

$user = Get-SPUser -Identity "i:o#.w|contoso\user1" -Web https://contoso"
Move-SPUser -Identity $user -NewAlias "i:05.t|SAML|admin@contoso.com"

This process can take some time to complete for migrating users depending on how many users and how many site collections are in the farm.

Convert-SPWebApplication

This method is only available for Trusted Providers that are created with -UseDefaultConfiguration. This will migrate users and groups to use SAML only within the web application that is run against this. Unlike Move-SPUser this will only affect the web application that is specified. Check out my ADFS guide here

 
$wa = Get-SPWebApplication https://contoso 
$ap = Get-SPTrustedIdentityTokenIssuer "SAML" Convert-SPWebApplication -Identity 
$wa -From CLAIMS-WINDOWS -To CLAIMS-TRUSTED-DEFAULT -TrustedProvider $ap -RetainPermissions 

Note: If a user does not have an identifier claim in AD(like a missing email), that user is not migrated. This will show up in the ULS logs and the UserInfo table of the content databases.

After we migrated the users and groups we need to shut down the Windows Authentication so we do not have the users log in with the Windows accounts. This would cause them to receive access denied and many other undesirable behaviors.

Resources

Move-SPUser
https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/move-spuser?view=sharepoint-ps

Convert-SPWebApplication
https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/convert-spwebapplication?view=sharepoint-ps

Permissions

If we don’t have any users to migrate or just want to test accessing sites, we would need to add in the user to user policy at the web application level. This spot is the easiest way to look at the claim we are adding while giving permission to a test account.


We can see the user first ‘User1’ is the ADFS claim and the second is the Windows claims.

SharePoint SAML Migration Guide – Part 2 Trusted Identity

SharePoint SAML Migration Guide – Part 1 Planning

SharePoint SAML Migration Guide – Part 2 Trusted Identity

SharePoint SAML Migration Guide – Part 3 Migration

SharePoint SAML Migration Guide – Part 4 Web Applications

SharePoint SAML Migration Guide – Part 5 User Profiles

Part 2 – Trusted Identity

The Trusted Identity Provider has two main options which will assist with the claim provider.

-UseDefaultConfiguration

This will provision an out of the box claim provider that will behave similar to the Windows Authentication’s claim provider.

The script below is to create the trusted provider with -UseDefaultConfiguration. Make the modifications to match your environment. More information on setup and mapping in ADFS check out my ADFS Migration post here.

 
$name = "ADFS" $description = "Description of Token Issuer" 
$signinURL = "https://adfs.contoso.com/adfs/ls" 
$realm = "urn:sp13:contoso" 
$adfscertPath = "C:\adfscert.cer" 
$IDClaim = "EMAIL" #Choose between ACCOUNT-NAME, EMAIL, OR USER-PRINCIPAL-NAME 
$adfscert = New-Object System.Security.Cryptography.X509Certificates.X509Certificates2($adfscertPath) 
New-SPTrustedIdentityTokenIssuer -Name $name -Description $description -realm $realm -ImportTrustCertificate $ADFSCert -SignInUrl $signinURL -UseDefaultConfiguration -IdentifierClaimIs $IDClaim 

NOTE: This method is not compatible with custom claim providers like LDAPCP due to the systemID being a SID claim instead of the identifier claim.

The other choice is without the -UseDefaultConfiguration. We would use this method if we are wanting to use a 3rd party claim provider or the SAML provider is unable to pass Group tokens as SIDs. This will require us to map the identity claim and other claim(s), if required. This does not come with a claims provider so we will need a customer claim provider such has LDAPCP.

 
#claim mappings 
$email = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -IncomingClaimTypeDisplayName "EmailAddress" –SameAsIncoming 
$upn = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" -IncomingClaimTypeDisplayName "UPN" –SameAsIncoming 
$Role = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.microsoft.com/ws/2008/06/identity/claims/role" -IncomingClaimTypeDisplayName "Role" –SameAsIncoming 
$name = "ADFS" $description = "Description of Token Issuer" 
$signinURL = "https://adfs.contoso.com/adfs/ls" 
$realm = "urn:sp13:contoso" 
$adfscertPath = "C:\adfscert.cer" 
New-SPTrustedIdentityTokenIssuer -Name $name -Description $description -Realm $realm -ClaimsMappings $upn,$email,$role -SignInUrl $signinURL -IdentifierClaim $email.InputClaimType 

After we have the Trusted Identity Token Issuer created, we can move on to Part 3 – Migration.

Resources:

New-SPTrustedIdentityTokenIssuer – https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/new-sptrustedidentitytokenissuer?view=sharepoint-ps

Plan for user authentication methods in SharePoint Server – https://docs.microsoft.com/en-us/SharePoint/security-for-sharepoint-server/plan-user-authentication

SharePoint SAML Migration Guide – Part 1 Planning

SharePoint SAML Migration Guide – Part 1 Planning

SharePoint SAML Migration Guide – Part 2 Trusted Identity

SharePoint SAML Migration Guide – Part 3 Migration

SharePoint SAML Migration Guide – Part 4 Web Applications

SharePoint SAML Migration Guide – Part 5 User Profiles

Part 1 – Planning

With most everything in SharePoint, planning and testing is key before slamming it into production. We will need to review some high-level concepts of SharePoint to help determine which patch works for your organization.

Clam Providers – This is the same as people picker. With Windows Authentication, there is an Active Directory (AD) Claim Provider which will send LDAP queries to AD. SAML authentication does not come with a claim provider unless we use -UseDefaultConfiguration.

Trusted Identity Provider – This is created in SharePoint to hook up the SAML provider. This may redirect to SAML providers like ADFS or other 3rd party providers. SharePoint’s PowerShell commandlet to display them is Get-SPTrustedIdentityTokenIssuer
Identity Claim – This is claim that will uniquely identify a user. This is usually Email, UPN, or sAMAccountName.

Migrating from Windows Claims to SAML Claims requires to know the different paths and choices we can make. We can migrate the users and groups using Move-SPUser or Convert-SPWebApplication (only available when using -UseDefaultConfiguration).

Choosing an Identity Claim

The identity claim is unique to the user and must be passed in the SAML token from the SAML provider. As stated above, this could be Email, sAMAccountName, UPN, or something different. The value should be unique for that user and no other users would have this value or we’re going to have trouble down the road with user profiles, permissions, migration, etc. Note: Currently the Convert-SPWebApplication does not work with UPN. This will be important to user profiles when they are imported.

Type

Windows Claim

ID

SAML Claim

User

i:0#.w|contoso\administrator

sAMAccountName

i:0#.t|SAML|administrator

Email

i:05.t|SAML|admin@contoso.com

UPN

i:0e.t|SAML|administrator@contoso.com
Group

c:0+.w|s-1-5-21-3687283648-2425067875-2523671615-101068

UseDefaultConfiguration

c:0+.t|SAML|s-1-5-21-3687283648-2425067875-2523671615-101068

Without UseDefaultConfiguation

c:0-.t|SAML|Group1 (unqualified)
c:0-.t|SAML|contoso\Group1 (qualified)
c:0-.t|SAML|contoso.com\Group1 (fully qualified)

SharePoint Profile Picture Import 1.3

Link to original post: https://adamsorenson.com/user-profile-picture-import-with-active-directory-import/

A new year, blog home, & version of the picture importer

I have just completed a migration to my new blog home here. This platform will give us a bit more flexibility with design and such. I have been working a many bugs that have been plaguing the profile picture import. I think I have a handle on the majority of the outstanding issues. The major bug we had was the terrible performance for larger pictures. This is now fixed since we don’t need to reset the variable. We are still using Active Directory Import(ADI) and able to do incremental.

New variable

There is one new variable to assist with the “LDAP Server Unavailable” issue. $DCorDomainName(line 20)
is set for a resolvable domain name(Netbios or FQDN) or a Domain Controller.

XML file will auto create

New logic in the script will create the DNLookup if it’s not present. There was another issue where existing users in AD would fail since the sAMAccountName property is not included with incremental syncs. This is resolved by doing a lookup by the DN and add them into the DNLookup.xml.

Download the new version here