Service application cannot be deleted due to existing project sites During deleting a Project Application Service

In this article, I will solve the below SharePoint Issue

The service application cannot be deleted due to existing project sites.


Scenario

When I tried to delete a Project Service application service via Central Administration, I got the below error.

Service application cannot be deleted due to existing project sites.

service application cannot be deleted due to existing project sites.


Cause:

There’re PWA instances (Site Collections) associated with the Project Service application service that must be deleted first before deleting the associated PWA Application Service.


Solution

Delete Project Service Application Service Using PowerShell

  • Open SharePoint Management Shell as Administrator.

SharePoint 2013 Management Shell

  • Get all service application. 

Get-SPserviceِِِApplication

Get SharePoint Serviceِِِ Application Using PowerShell

  • Get PWA Service Application.
$pwa=Get-SPserviceِِِApplication | ? {$_.Id -eq "put the GUID you found above"}
  • Type $pwa to be sure it’s online.

Get Project Server Serviceِِِ Application Using PowerShell

  • Get all related site collections for $pwa
$sc =  $pwa.Sitecollection 
  • Type $sc to show its details.

Get PWA Instances of the Project Server Serviceِِِ Application Using PowerShell

  • Remark and copy the site ID.
  • Remove your site collection.
$sc.SiteCollection.Remove("Site ID") 
  • Repeat all previous steps for all listed sites.
  • After clearing all sites > Try to delete the Project Server Serviceِِِ Application that should be now deleted properly.
Remove-SPServiceApplication $pwa -RemoveData 

Applies To
  • Project Server 2016.
  • Project Server 2013.
  • Project Server 2010.
See also

Remove Orphaned Project Web App Site – An entry with the same key already exist

Advertisements

One thought on “Service application cannot be deleted due to existing project sites During deleting a Project Application Service

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s