Fixing an orphaned Site Collection within Project Server 2010

I had the pleasure of getting to know Project Server 2010 a couple of months ago.  I am a big fan of the way this has been implemeneted, as a SharePoint 2010 Service Application based approach seems to make more sense than a completely seperate product.

During this installation I found out a few interesting things about Project Server :

  1. Do not try using Claim Based Authentication on your Project Server Web Application. It may look like it is working, but I assure you it is not.  Clicking around some of the less obvious areas of the site will probably reveal it is not working.
  2. Never, ever delete a /PWA Site Collection for any reason.  They look just like a normal SharePoint Site Collection, but doing this will leave you with an orphaned PWA site and will leave you scratching your head.  This also implies that PWA site collections cannot be backed up and restored by conventional SharePoint Site Collection Backups.
  3. If you try to convert Claims back to Classic mode (which is not supported), you will likely just break your PWA instance.

There is no really clear cut way to recover from an orphaned Site Collection, and it becomes a real pain as you cannot retract the PWA Service Application until you fix the orphaned Site Collection.

The short verison is it can be done with PowerShell with the following script :

$psi = get-spserviceapplication | where {$_.TypeName -like “*Project*”}
$a = $psi.Sitecollection | where {$_.SiteID -eq “0ce62ac4-d733-483f-b60b-ea7e75b104d4”}
$a = $psi.Sitecollection | where {$_.SiteID -eq “0ce62ac4-d733-483f-b60b-ea7e75b104d4”}

You will then be able to recreate or remove the Service Application, and just get on with Project life!