How to delete an orphaned Project Server Site

Let’s say you go to provision a Project Web App via managed service applications, project server server application, and it fails.  There is a chance that the particular site you are trying to provision is orphaned within the Project Server Service Application.

this occurs after the Site collection that held the PWA site is deleted before it is unprovisioned.  And sometimes it occurs even if the PWA site is unprovisioned and then deleted.

The advice listed by Alexander on this technet forum, works


mark out the GUID for the project service application

$psi = get-spserviceapplication | ? {$_.Id -eq "GUID of the Project Service App from above"}
$a = $psi.Sitecollection | where {$_.SiteID -eq "< Guid of the orphaned site, see text below on how to find this>"}


to test this series of commands, after you’ve ran the above you can perform the following steps, and actually you can perform these steps to get the guid that you need in the above “<Guid>”

From an administrative management console, type



then Mark the GUID for the Project Service App and run

$sa = get-spserviceapplication | ? {$_.Id -eq "GUID of the Service App from above"}


followed by

$sc = $sa.SiteCollection


The guid associated with the SiteID is guid that you’re after, you can find this a few rows above the name field.

“Details of what each section of the above powershell commands are returning are neatly documented in this technet post by Alex Burton –”

Notice how, if you run $sc by itself, it will show you all the site collections that the project service application thinks are in place.  After you run

$a = $psi.Sitecollection | where {$_.SiteID -eq "< Guid>"}





when you run $sc, it will contain one less, based on the siteID used in the <Guid> of

$a = $psi.Sitecollection | where {$_.SiteID -eq "< Guid>"}