A few weeks ago, we received an issue from one of our customers trying to access the My Site of a user who had been deleted from Active Directory. Their managers were receiving emails with links to My Sites, but the links did not display the My Site for them. When they clicked on the link, they would get "Sorry, something went wrong. User not found." The page would look like this:
It can be very frustrating for the manager when they attempt to access the site. What is worse is that this continually happens when any of the other users leave the company. The manager is left with no direction as to what the problem is, let alone how to solve it.
The managers are clicking on the link in the email and it is displaying the error shown above. How do we fix this? The site should still be there, and it should be accessible by the manager, especially since they are now a site collection administrator. Well, there are a few ways to prevent/work around this issue.
The best way I have seen so far is to append "/_layouts/viewlsts.aspx" to the URL in the email. For example, the original email link reads as follows: http://mysites.mikes7.com/personal/mpigott. If you enter in http://mysites.mikes7.com/personal/mpigott/_layouts/viewlsts.aspx, it will take you to Michael's My Site contents. A few things to note:
- The Manager's name, not the employee's, is in the upper-left-hand corner. This is normal; you are not on the manager's site. In fact, if you look in the URL in the address bar, it will verify that you are still in Michael's My Site.
- All of the links on the left hand side bar will take you to the Manager's site\information.
- All of the links in the center of the page are directly linked to Michael's My Site. See the screenshot below. The manager can use these to access Michael's data.
2. The other option that you have is to disable the My Site Cleanup Job. This, however, is not recommended as it will require manual work by the SharePoint Administration team. They will have to go in and manually delete each of the My Sites when a user is removed from AD. It also means that the User Profile database will be filled with users that are no longer in AD. To remove these users, you would have to manually delete them from the database, which would render your farm unsupportable by Microsoft.
If you are like me, a solution is great but the understanding of why is also very helpful. I spent some time reading through some blogs about the topic, as well as doing some testing on my test environment. My research led me to find out what is truly happening.
- User Michael creates a My Site and interacts with it.
- Michael leaves the company. The AD team deletes Michael's account or moves it to an OU not included in the User Profile Sync synchronization connection.
- The User Profile Service runs an incremental sync after the account has been deleted.
Michael's account is not included in the sync with SharePoint. Because the account is not synced, it will do a few things on the backend.
- Michael's account will no longer show up in the list of User Profiles in SharePoint.
- Michael's account will be marked for deletion in the User Profile Database. Note that it is not deleted yet, just marked to be deleted.
- Michael's My Site will still remain in the list of site collections.
The My Site Cleanup Job will run next. This job is set to run daily by default, and its job is to do the following:
- It will delete Michael's profile because it was marked for deletion in the User Profile database.
- Since Michael had a My Site, it will mark Michael's My Site to be deleted as well. The deletion is set to occur 14 days after the site is marked.
- It sets Michael's manager as the Secondary Site Collection Administrator.
- It will send Michael's manager an email informing them that the site will be deleted in 14 days. The email will include a link to the My Site. The link will look something like this: http://mysites.mikes7.com/personal/mpigott
- It will run again 11 days after the first notification and send another notification to Michael's manager letting them know the site will be deleted in 3 days.
- At the 14 day mark, it will delete Michael's My Site.
For more information about the My Site Cleanup Job you can read the following post by Mr. Kirk Evans: http://blogs.msdn.com/b/kaevans/archive/2012/06/25/top-recommendations-for-managing-the-my-site-cleanup-timer-job.aspx. He spends a good portion explaining the details of the UPS and the My Site Cleanup Job.
Also, Mr. Spence Harbar has another great blog walking through some of the same steps I mentioned above. His blog can be found here: http://www.harbar.net/archive/2011/02/10/account-deletion-and-sharepoint-2010-user-profile-synchronization.aspx. Please note that both Mr. Harbar's and Mr. Evan's blogs are for SharePoint 2010, but many pieces of them are applicable to SharePoint 2013.
Now you know a little more about the My Site Cleanup Job. For me, the investigation into the issue gave a new understanding of My Sites, UPS, and what's going on behind the scenes. As many of you have already seen, aspects of the User Profile Service can be very touchy. Sometimes it seems as though you could breathe on the UPS and it will break. It can be very frustrating and can cause many problems for your administration team as well as your users. The good news is that we are all in this together. Be sure that your team and all of the managers are aware of this information. In particular, the managers will need to know how to alter the URL to give them access to the My Site. It will save them a lot of time, energy, and headaches when investigating an issue that could have been easily solved. J