1 minute read

A couple of days ago I deleted my Project Server Web application because I wanted to recreate it.

When I tried to create a new Project Web App Site I got the following messages:

  • The database specified is already used by another project server. Enter a different server or database name and try again.

projectserver

The first idea that I came up with was deleting the databases from the database server. After deleting the databases I retried my action but the problem was still there.

The next thought that came up in my head was deleting the Project Service Application. I pressed delete on the Manage Service Application Page and got the following error message:

  • Service application cannot be deleted due to existing project sites.

errordeleteprojectserviceapplication

The problem is with the Project Service Application. The Project service application remains a connection with a specific site collection even If you delete the web application or the specific site collection. The only thing you can do to delete the connected site collection (that does not exist anymore) from the Project Service Application by using PowerShell.

First you will have to use PowerShell to retrieve a collection of the sites that are referenced with the service application. Get the ID of the reference you want to remove and than remove that reference .

Let take the first step, get the service application and print the site collections.

$svApp = Get-SPServiceApplication -Name "Project Web App Service Application"
$svApp.SiteCollection 

This will get a complete list of all the associated site collections:

powershelloutcome

Next you can copy the ID and remove it by using the following PowerShell command:

$svApp.SiteCollection.Remove("a09c6964-efc2-4917-9448-ce86d0bc95d3")

And now you can remove the Service Application or recreate the site collection. To remove the service application by using powershell use the following command:

Remove-SPServiceApplication $svApp -RemoveData