Friday 7 April 2017

Unable to remove web application from SharePoint 2013

I have tried delete web application facing below error, my scenario is there is no database, and IIS site. 

An object in the SharePoint administrative framework, “SPWebApplication Name=ulabtechnologies:1234’ Site Parent=SPWebService”, could not be deleted because other objects depend on it. Update all of these dependants to point to null or different objects and retry this operation. The dependant objects are as follows: SPSolutionDeploymentJobDefinition Name=solution-deployment-


In SQL Management Studio:

SELECT * FROM Objects (NoLock) where Name like '%%'

Note the "Id" GUID.
SELECT * FROM SiteMap (nolock) where ApplicationId = ''

Note the 'DatabaseId' GUID.



Next step is to be done on a SharePoint server in the farm:

STSADM -O DeleteConfigurationObject -id {DatabaseId GUID from step above}

Repeat this for each row returned in the first step and then you will be able to successfully delete the web application from the farm.
Now try to delete web application 

Remove-SPWebApplication -Identity "" -Confirm