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 2016/2019 MIM not updating Multivalue Properties

User profiles that are syncing Multivalued properties with BDC, AD, etc. will not be pulled into the SPMA(SharePoint Management Agent) during the Delta Import step after modification or deletion of the values.

 

 

Under the Hood

The first step is to step Fiddler to capture the MIM server sending the request to Central Admin. This can be done by modifying the C:\Program Files\Microsoft Forefront Identity Manager\2010\Synchronization Service\Bin\miiserver.exe.config. Please make a backup of this file before modifying this. The following XML will need to put in before the </configuration>.

<system.net>

<defaultProxy>

<proxy autoDetect=”false” bypassonlocal=”false” proxyaddress=”http://127.0.0.1:8888″ usesystemdefault=”false” />

</defaultProxy>

</system.net>

</configuration>

 

The IP address will be the server where fiddler is running. I have it running on the same server that MIM is running. After this is done, we need to reset Forefront Identity Manager Synchronization Service in services.msc.

Fiddler showed us that we’re not asking for any multivalued/termset properties which is why we didn’t update the connector space with any change. SharePoint returns with no results.

 

Modifying the SPMA

The SPMA controls the attributes that we are asking SharePoint for since that’s the only connection to SharePoint for MIM. We would need to go into the MIM client à Management Agents à Properties for SPMA à Connectivity

Check the box for Import auto-updated attributes and the password for the account. Click OK and kick off a full.

After reproducing (deleting out the value for a user in the User Profile Service Applciation) the issue we’re seeing the DeltaImport with 1 Update.

Fiddler shows MIM asking for those properties and SharePoint sending that update.

 

 

Don’t forget to remove the Fiddler/proxy entry in the miiserver.exe.config and bounce the service (if you decided to put that in).

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

Deleting User Profiles Using PowerShell

There are many reasons why we would want to use a PowerShell shell script to delete user profiles.

  1. We don’t want to use or trust the My Site Cleanup job.
  2. We have a batch of stub user profiles that need to be deleted.
  3. We just want to delete some user profiles for testing purposes.
  4. 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)

NOTE: 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. 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.

The List

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.

  1. Profile DB query – Select NtName from UserProfile_Full with(nolock) where bdeleted=1
  2. PowerShell:


$upa = Get-spserviceapplication | ?{$_.typename -match "profile"}
Set-SPProfileServiceApplication $upa -GetNonImportedObjects $true | out-file c:\temp\NonImportedProfiles.txt

We just want the list to be a text file with the a NTName on each line.

Parameters


We will just need to modify the top 3 lines to adjust it for our farm. The first is $siteurl. This should be URL that is consuming from the User Profile Service Application. The $file is the location and name of the input file we created above. The $log is for the location of the log file(Yes, there is logging with my PowerShell scripts). Just make sure the directory is created.

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 Permissions with Full Control.

Link to the Script

SharePoint 2016 MIM and SAML/FBA User Profiles

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.
This guide assumes the environment has been setup from these steps at https://technet.microsoft.com/en-us/library/mt637055(v=office.16).aspx

Why should we do this?

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.

 

1.       Open MIM client then Metaverse Designer.  Select “person” then “Add Attribute”.


New Attribute button.


Type in “SPS-ClaimID” for Attribute Name


Click OK

2. Open the ADMA then Configure Attribute Flow. Select user/person


 

a.       Map your Claim identifier for your SAML users to SPS-ClaimID.  The direction should be Import and Direct.


b.       Click “New”.


Find SPS-ClaimProviderType and SPS-ClaimProviderID in MetaVerse object type.  Below is PowerShell to find your SAML Identity Claim.

$tips = Get-SPTrustedIdentityTokenIssuer

foreach($tip in $tips)

{

$name = $tip.Name

$claims = $tip.ClaimTypeInformation


foreach($claim in $claims)

{


If($claim.IsIdentityClaim -eq $true)

{


Write-Host -ForegroundColor DarkGreen “The Identity Claim is listed below for $name“


$claim } }}

 


Select “Advanced” for “Mapping type” and “Import” for Direction.  Click New. 

The constant value SPS-ClaimProviderID will be the name of your SAML provider when you created it. 

SPS-ClaimProviderType will be “Trusted” if you’re using a Trusted provider.


3.       Open SharePoint MA(SPMA). Click on Select Attributes.  Check the box for SPS-ClaimID.

4.      Configure Attribute Flow. Select user/person.

a.       Map SPS-ClaimID to SPS-ClaimID.  The direction will be export and Direct.  Click new. 

I’m using UPN for my environment.  This will be the identifier claim which could be email or samaccountname(see above for PowerShell).


5.       Run a full sync