MIM Portal fails to load after changing Masterpage or Theme

If you’re unable to do anything in the MIM portal, you might want to check your master page settings. Many times, Admins will change the Look and Feel of the site collection that MIM Portal is provisioned on. This will change the master page which will toss this nice error on almost every link in the portal.

If we modify the web.config of the web application, we can expose the .NET stack.

Change from:

<customErrors mode=”On” />

To:

<customErrors mode=”Off” />

From:

CallStack=”false”

To:

CallStack=”true”

We would need to check the masterpage.

 
$web = Get-SPWeb http://mimportalURL/IdentityManagement
$web.CustomMasterURL

Should show up as “/IdentityManagement/_catalogs/masterpage/ilm2.master”

Set this back using:

$web.CustomMasterURL =  "/IdentityManagement/_catalogs/masterpage/ilm2.master"
$web.Update()

SharePoint – ADI Mappings

We have been seeing more issues with Active Directory Import (ADI) in the recent months due to the confusion of mappings. My colleague, Josh, wrote a great article on the issue with Work Email not populating.

Upgrading from 2013 or FIM to ADI

Mappings in 2013 with using the User Profile Synchronization Service (FIM) showed up in the page Manage User Properties in the User Profile Service Application.

Active Directory Import (ADI) shows no mappings in the same page but as Josh’s post states above this is as expected.

The only mappings that we will need to be concerned with are the ones that are not out of the box. We wouldn’t need to map things like Last Name to sn since it is hardcoded.

NOTE: Any misspelling or mapping to a nonexistent property in AD will result in the user profile property not updating.

Emails have “SMTP:” prefix in the User Profile

This is caused by adding an explicit mapping for Work Email to proxyAddresses. This will bypass the code that parses all the values of proxyAddresses and select the first string in as a value. This may even select a “SIP:” prefix as well. Since proxyAddresses is a multivalued property in AD but a string (single value) in the User Profiles, the explicit mappings will override the out of the box mapping.

Solution: Remove the mapping for Work Email and run a full sync.

Summary

Most of the properties that are out of the box will not need to be mapped. The only User Profile properties that will need to be explicitly mapped will be the custom mappings.

PowerShell Script: Check user profiles

I have been asked many times how to check if Active Directory Import is working. With User Profile Synchronization, we had the FIM client to show what was updated during the MOSS_Export step.

The script I wrote uses DirSync which allows for incremental checks against Active Directory. This will create a cookie.bin that will keep track of state of AD when you ran it last. The account we would like to use is the same account you’d use sync user profiles.

The service account we would need to run this with your sync account that will connect to Active Directory with Replicate Directory Changes.

Adjust the script to match your environment. Be sure to add the mappings.xml file to the folder specified on Line 11.


Mappings

Mappings can be added or subtracted from the mappings.xml file that is included. This file is needed to know what we would like to check from AD to SharePoint. When adding in additional mappings, be sure to match the internal name(s) of the profile properties.


Results

The script will out put a CSV with tab as the delimiter character. This will allow easier sorting to troubleshoot the specific user profile. UPA Value column is what the user profile has


For a good troubleshooting guide user profiles not syncing check out my colleague Josh’s guide: https://joshroark.com/sharepoint-all-about-non-imported-user-profiles/

Download the script here

SharePoint SAML Migration Guide – Part 5 User Profiles

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 User Profiles are usually overlooked when migrating to SAML. This will require a new connection to be recreated if you’re using Active Directory Import (ADI) or User Profile Synchronization Service (2013/2010).

Recreating the connection will require some documentation before deleting the old connection. FQDN of forest connection, Service Account, Connection Filter/LDAP Filter, OU Selection, User Profile Property Mappings

ADI or User Profile Synchronization Service

Back in Part 1 of this guide we decided on a claim identifier. This is key when setting up your user profiles. First we’re going to create a new connection and give it a name.

Make sure to select Trusted Claims Provider Authentication as the Authentication Provider Type. If you have more than one provider, select the correct one for Authentication Provider Instance.


After creating the connection, we need to map the claim identifier. Back in the User Profile Service Application, we need to select Manage User Properties.


Click on the drop down for Claim User Identifier and Edit.


I’m using email as my identifier, so I’m entering in the AD property of ‘mail’. Adjust this to match your identifier. Click Add. Repeat for other connections/domains.


Click OK and kick off a full sync.

Users with a claim identifier will be imported and shown now as a SAML user profile


Using Full MIM with SharePoint 2016/2019? Check out my post here about setting this up. https://adamsorenson.com/sharepoint-2016-mim-and-samlfba-user-profiles/

Oauth with Roles/Group membership not working? Check out my post here about that subject: https://adamsorenson.com/saml-roles-and-sharepoint-20162013-with-oauth/

 

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.