Hi guys,
As part of a strategy for scalling out our Portal Sharepoint MySites which is over 250k mysites, we decided to create an approach which is:
1- Create a PowerShell custom Job which will run twice a month looking for unuseful mysites and remove them gradually.
2- The users which lost the mysite due custom Powershell job will be redirected into a common page for users that  does not edit their sites. It will avoid having too many mysites.
3- If the user over the common static home page decided to edit (Add new web parts, Add pages, etc) we need to create a personal mysite then.
All this is working except for the #3 which works partially.
When an user confirm its edition from a Sharepoint popup we will call a RESTFul service throught jQuery Ajax async in order to leave the service the task to create mysite while it shows a wait page upon the client side (the important thing here is the callback).
Above is the Ajax call. When this call is performed we need to assume the following:
1- The user already lost mysite due to auto-deletion from powershell script.
2- There is no personal site for this user calling the service.
3- We will create a site for the user.
So we are sure the site its not present, the rest ful function is:
This function is throwing out a PersonalSiteExistsException even when the site is not present.Â
When it works:
When I recycle the application pool after deleting personal sites, the exception is not trow and the site is created properly.
I guess  there is something in the cache but I cannot realize on what is causing the exception.
Could someone guide me¡
Thanks a lot.
?width=750
Thanks a lot Mark., I am looking through them right now.
We have a powershell script which is a custom job we’ve created. After a couple of checkings to see if the user is updating its Home Page into mysite, we proceed doing this:
$profile.PersonalSite.Delete();
So inmediately I proceed to create the site again, but it already exists, even if you check the personalsite instance of the user profile its empty. I noted that after recycling the app pool it works with no problems.
I am looking into the approaches you send me. I really appreaciate your help.
Regards.