SharePoint mysite is deleted

Issue:


The My Site of Joe Blow is scheduled for deletion. As their manager you are now the temporary owner of their site. This temporary ownership gives you access to the site to copy any business-related information you might need. To access the site use this URL: http://servername/mysite/personal/joeblow.

Cause:

In SharePoint under Central Administration there is a ‘My Site Cleanup Job’ which runs every hour. When a user is deleted or disable in Active Directory, the My Site Cleanup job starts a workflow on that user’s My Site. The default behaviour is to send an e-mail message to the manager with a link to the deleted user’s site. The e-mail message contains a request to the manager to move any documents or data that the manager wants to preserve, because the site might be deleted in the future.

MySite clean up job screen

MySite clean up job screen

There is also ‘site use confirmation and deletion’ page under central administration operations which may be checked.

Site use confirmation deletion screen

Site use confirmation deletion screen

Solution:

To mitigate this issue I think you can apply any of the following steps.

1. If you have two domain controllers use the domain name and ‘Auto discover domain controller’ option. If the one domain controller goes down SharePoint will look for the other domain controller. Please look at my aricle on ‘Employee Lookup or User Profile searches in SharePoint 2007‘ to find a filter for not importing disable Active Directory accounts.

AD connection auto discovery

AD connection auto discovery screen

2. In central administration we can disable ‘My Site Cleanup Job’ and run once a week manually to do cleanup. Not a great options.

3. Potentially you can also call the SharePoint profile stored procedure manually. If you do this you may want to disable ‘My Site Cleanup Job’.

DECLARE @UserID uniqueidentifier
DECLARE @NTName nvarchar(400)
DECLARE @SID varbinary(512)

DECLARE userCursor CURSOR FOR
SELECT Userid, NTName, SID from userprofile _full where bdeleted = 1

OPEN userCursor

FETCH NEXT FROM userCursor INTO @UserID, @NTName, @SID

WHILE @@FETCH_STATUS = 0

BEGIN

EXEC profile_RemoveUser @UserID, @NTName, @SID

FETCH NEXT FROM userCursor INTO @UserID, @NTName, @SID

END

CLOSE userCursor
DEALLOCATE userCursor

References:

SharePoint profile stored procedure article

SharePoint Profile Cleanup

White paper on mysite

How To Delete Sharepoint Timer Job Definition

Advertisements

Diganta Kumar has architected and developed software for more than a decade for a wide range of industries and development platforms and over the years has filled many roles including program manager, founder, developer, architect, team lead, mentor and project manager. Diganta is founder of two online IT businesses. He is a certified AWS Solutions Architect, certified Professional Scrum Master (PSM I), certified Professional Scrum Developer (PSD I) and ITIL Certified. He has presented at Microsoft Tech.Ed, Microsoft AppFest and Ark Group Intranet conference. He attends AWS Seattle Official Events, Seattle AWS Architects-Engineers, and AWS Cloud Commerce user groups. He likes to help, mentor and manage software development teams to improve and produce great software. He currently work as a Senior Technical Program Manager for Amazon Web Services.

Posted in SharePoint

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s