Removing Project Server 2010 Applications in SharePoint 2010

02/24/2011

A common mistake is to remove a PWA Site Collection without doing this by the application manager. This error usually whoever incurs has several problems then the PWA won’t open anymore and sometimes cannot create new PWAs.

Cause

To delete the Site Collection was removed the pointer directly in the Web Application, but for the Service Project Server data is still a PWA with the database intact.

Symptom

When you try to delete now correctly by “Manage Service Applications” error occurs:

“Service application cannot be deleted due to existing project sites”

Solution

Enter SharePoint 2010 Management Shell and run the following sequence of commands:

The first command lists all applications have been found and among them the PWA. You can create a filter for like, similar to the second command. Or if you already know the name of the applications put directly in the second row.

The second command captures the application ID and the third uses this ID to bring the list of Site Collections linked to PWA.

The fourth command lists the result of the variable $Colecoes so that you can read the ID of the Site Collection that is inserted into the ultimate dos commands.

After this, run the commands again 3 and 4 until that do not return any Site Collection, although the PWA is usually a single SC.

Below is the complete prints of each stage:

And don’t forget that you will not be deleted databases in SQL Server, what should be done manually before creating a new application for the PWA server.

Excellent! This was exactly what I needed! I had deleted a /pwa site collection without first unprovisioning it using the Project Server Service Application. Therefore I had a lot of errors in the event logs about how Project Server couldn’t find the databases and it was still trying to run timer jobs against them! They were also still appearing in the list at Central Admin –> Upgrade and Migration –> Review Database Status. They were listed as not responding. This article removed them from that list and cleared the errors in my event logs. Thanks for posting this gem of information!

In case it helps someone else searching on Google most of my errors were “Event 8115, Project Server” (logged as Error) and looked much like this:

Thank you so much for posting this.
This helped me when trying to remove Project Server 2010 before upgrading my SharePoint server to 2013.
Just in case someone else struggles with the PowerShell script needed, You need to Copy the ID of the site collection, not the SiteId (Doh!). This worked for me:
——
$ID_App = Get-SPServiceApplication | ? {$_.Displayname -like “Project*”}
$Colecoes = $ID_App.SiteCollection
$Colecoes
$ID_App.SiteCollection.Remove(“930fcb2e-d6b9-4735-89b4-5704c9d5c940”)
—-
You can then unprovision the Service application via SPCA or PowerShell:
—–
$ID_App.Unprovision($false);
$ID_App.Delete();
———-
Thanks!