Background:
Picture the requirement to have multiple UPAs and multiple UPSS running in a single farm. We don't need to talk about the whys, but we will talk about the how's, and a case I had the pleasure of working where the profiles weren't being removed after they were missing in a sync. We'll even talk a little about the my site cleanup timer job. Not a whole lot because there are a lot of good articles out there that already dig deep into this timer job.
Configuration:
- We need to deploy a dummy web application to have the second UPA associated and the default
- we need to do deploy two User profile service applications.
- We will need to start the sync service on two different servers
- Central Administration -> Manage Service Application -> Edit Properties for each UPA
- Configure the Profile Synchronization instance point to the respective server running the sync service
- Edit the service connections
for the dummy web application - Select the custom group of selections
- Select the second UPA for the external Domain
- Save and Close
- Edit the service connections
for the Primary web application - Select the default group of connections
- Select the first UPA for the Internal Domain
- Save and Close
Cause:
Our issue was in fact that the second UPA for the external domain had a dummy entry for the my site host URL. When we remove users from a sync for whatever reason these users are marked for deletion in the userprofile_full table in the profile database. There is a timer job that runs call "My Site Cleanup Timer Job". The purpose of this timer job is to Remove the users profile from the database and also remove the users associated my site. The problem with having a dummy my site host for the external domain's UPA is that when the timer job attempts to located the registered my site it can't find it due to it not existing and the job fails. Thus resulting in no user getting removed and no my site getting flagged for deletion.
Resolution:
We adjusted the my site host URL to point to the existing my site and everything started working as expected with the my site cleanup timer job.