Service application cannot be deleted due to existing project sites

Service application cannot be deleted due to existing project sites

In this article, we’re gonna solve “Service application cannot be deleted due to existing project sites” that you may face when you delete a Project Server Service Application fro Central Administration.

Applied To

  • Project Server 2019.
  • Project Server 2016.
  • Project Server 2013.
  • Project Server 2010.

You might also like to read Install and Configure Project Server 2016 step by step


Service application cannot be deleted due to existing project sites

In Project Server, when I tried to delete a Project Service application service using SharePoint Central Administration, I got the below error.

service application cannot be deleted due to existing project sites

Actually, you encounter this issue “Service application cannot be deleted due to existing project sites” if you are trying to delete a PWA service application that already associated with a configured PWA instance.

Therefore, to be able to delete the Project Server Service Application, you must first delete its associated PWA instances.

Delete Project Server Service Application PowerShell

To delete project server service application using powershell, you should do the following:

Steps

  • 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

You might also like to read Get PWA Instance Details using PowerShell


Conclusion

In conclusion, we have learned how to Delete Project Server Service Application using PowerShell to avoid “Service application cannot be deleted due to existing project sites” that you may face when you delete Delete Project Server Service Application from Central Administration.

You might also like to read
Have a Question?

If you have any related questions, please don’t hesitate to ask it at deBUG.to Community.

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

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top