This article will discuss the “My site deletion email message" which users get when their subordinates “My site” is scheduled for deletion in SharePoint.
This mainly takes place because of the “My site cleanup timer job” and it takes care of deleting the user’s “My site" that is scheduled for deletion. This article discusses about the how the timer job works and what it does .
What is the My Site Cleanup Timer Job?
The My Site Cleanup Job is responsible for deleting user profiles and My Sites of those users. This includes the following activities:
- Remove user profiles that are queued for deletion.
- If those users have a My Site, assign the user’s manager as the secondary site owner. Email the manager letting them know that the user’s My Site will be deleted in 14 days.
- Exactly 11 days after the first notification, email the manager again letting them know that the My Site will be deleted in 3 days.
- After a period of 14 days, delete the My Site.
The first thing which we need to understand is how a user profile is actually deleted.
How is a user profile deleted in SharePoint?
Now, there are couple of ways on how a user’s profile is deleted with regards to SharePoint.
- A user profile is deleted when we delete it from the “Manage user profile” section in Central Administration.
- When a user account which was included in a previous profile import is no longer included in the next import.
Suppose you delete a user account in Active Directory and then run an incremental or full user profile synchronization. You would expect that this means the user profile is deleted, and in fact this is picked up as a delete from Active Directory and processed in the FIM, where SharePoint picks up the fact the user profile is deleted and deletes it.
What happens when the “My site Cleanup Timer job “runs?
Listed below are the detailed steps about what happens when the “My site” cleanup timer job runs. …
- A user’s account gets disabled/deleted in Active Directory when the user leaves the firm or if the user is terminated.
- Once the user’s account is deleted/disabled and when SharePoint gets to know about this, the “My site “deletion timer job will be triggered in that user’s account.
- It first removes the user’s profile from SharePoint and once the profile is removed the user will no longer have access to the SharePoint sites. Well, it’s quite obvious that the user won’t be able to access any resource in the domain as his AD account itself is disabled.
- Once that’s done the access delegation part of the user’s “My site” takes place. What happens here is that the timer job looks for the user’s manager and will assign the manager’s account as the secondary owner for the user’s “ My site." Now this process will send an email to the user’s manager letting him/her know about his/her subordinate’s “My site" and will also have a link to the user’s “My site."
- This would give the manager complete access to the user’s “My site” including the “My documents" folder.
- Suppose the user doesn’t have a “manager” mentioned in his/her SharePoint profile, then the timer job will look for the secondary owner of the user’s “My site." If it finds a secondary contact it will then make the secondary contact as the secondary owner of the “My site “and will send an email to the secondary owner letting him/her know about the “My site.”
- The email will be sent in 3 parts, the first one will be a notification of the user’s “My site” with a link to the user’s “My site." The second one will be sent exactly 11 days after that and this will give a reminder to manager about his/her subordinate’s “ My site.” Finally, the last one will be sent on the 14th day stating that the user’s “My site “is deleted.
Note:
It doesn’t necessarily mean that the clean job will run on a user’s account only when the user’s account is deleted/disabled in AD. Even if the user’s account is moved to different OU SharePoint will consider the fact that this account is no longer existing in the same OU as the profile synchronization connection is broken and will run the “ My site" deletion timer job in the user’s account.
What happens when the user doesn’t have a manager?
Manager Profile Property Populated | Secondary Contact Configured | Email Sent | Site Queued for Deletion |
Yes | Yes | Yes, to manager | Yes |
Yes | No | Yes, to manager | Yes |
No | Yes | Yes, to secondary contact | Yes |
No | No | No | No |
Is it possible to customize the timer job?
Indeed it’s possible to customize the timer job. You can change the job schedule and you can also plan your own cleanup process.
Issue with the “My site “deletion email message in SharePoint Server 2013:
When a user profile is deleted from My Site, an email is sent to the user’s manager. However, this email contains a link to the user’s root My Site which no longer exists. In addition, you receive the following error message:
This issue has been addressed in the September 8, 2015 update.
My site deletion email message in SharePoint Online:
When a OneDrive for Business site collection is scheduled for deletion, the default action is to transfer ownership of the site to the manager of the original work account or school account that is being deleted. For this to occur, the user profile Manager Property must be set for the original owner of the OneDrive for Business site.
The Access Delegation setting is configured in the SharePoint admin center. This setting is located in Setup My Sites under the User Profiles section. By default, Access Delegation is enabled. We recommend that you also configure a secondary owner account in this section. This account will be the appointed owner of the site collection if the user profile Manager Property isn’t set for the original site owner. Email notifications will also be sent to the secondary owner account when the value is populated.
When a manager or secondary owner isn’t set for the user profile, or if the Access Delegation setting is disabled, the profile and OneDrive for Business site collection will follow the same deletion process that’s described in the next section. However, no email messages will be sent.
The profile and OneDrive cleanup process in SharePoint Online:
- A work or school account is deleted from the Microsoft Office 365 admin center or is removed through Active Directory synchronization.
- The account deletion is synchronized to SharePoint Online.
- The My Site Clean Up timer job runs, and the user profile is marked for deletion. The profile will be preserved in the database in a deleted state for 30 days. This coincides with the time that’s allocated to restore a deleted user account from the Azure Active Directory recycle bin.
- If the Manager Field is populated for the deleted account, the manager will receive an email message that states that the site will be removed in 30 days and that access to the site is granted to the manager.
- If the Manager field isn’t populated for the user account and a secondary owner was configured in Setup My Sites under the User Profile section of the SharePoint admin center, the secondary owner contact will receive an email message that states that the site will be removed in 30 days and that access to the site is granted to the user.
- After 27 days, a second email message will be sent to the manager or secondary owner that states that the site will be deleted in three days.
- After three days, the profile for the deleted account is deleted from the user profile service.
The personal site (that is, the OneDrive for Business site) for the deleted account is sent to the site collection recycle bin. The site is deleted from the recycle bin according to the site collection recycle bin retention policy, which is 30 days.
Read more articles on SharePoint: