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

When I tried to delete a Project Service application service via Central Administration , I got the following 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 this application service, you can’t delete it until delete its related PWA instances.

Solution:

  • Open SharePoint Management Shell as Administrator.SharePoint 2013 Management Shell
  • Get all service application.  

Get-SPserviceِِِApplication.

Get-SPServiceApplication

  • 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-SPServiceApplication PWA

  • Get all related site collections for $pwa

$sc =  $pwa.Sitecollection

  • Type $sc to show its details.

SitecollectionID

  • Remark and copy the site ID.
  • Remove your site collection.

$sc.SiteCollection.Remove("Site ID")

  • Repeat all previous steps for all listed sites.
  • After finishing from clearing all sites > Try to delete the application service that should be now deleted properly.

Remove-SPServiceApplication $pwa -RemoveData

Enjoy 🙂

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s