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.
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.
Get-SPserviceِِِApplication
$pwa=Get-SPserviceِِِApplication | ? {$_.Id -eq "put the GUID you found above"}
- Type $pwa to be sure it’s online.
- Get all related site collections for $pwa
$sc = $pwa.Sitecollection
- Type $sc to show its details.
- 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
- Remove Orphaned Project Web App Site – An entry with the same key already exist.
- Upgrade to Project Server 2016 Step By Step.
- Project Server 2013 Migration from one farm to another
Have a Question?
If you have any related questions, please don’t hesitate to ask it at deBUG.to Community.
Great article