Saturday, September 12, 2015

An object of the type Microsoft.SharePoint.Administration.SPIisWebsiteUnprovisioningJobDefinition

Hi All,

I was working on a project and need to create a new web application. I created a new web application and wanted to delete the web application from SharePoint UI for some reason but was not able to delete it.

I decided to delete via PowerShell:

Remove-SPWebApplication http://sp2013/ -Confirm -DeleteIISSite -RemoveContentDatabases 

and received this error:

 An object of the type Microsoft.SharePoint.Administration.SPIisWebsiteUnprovisioningJobDefinition named "Unprovisioning SharePoint - 80" already exists under the parent Microsoft.SharePoint.Administration.SPWebService named "".  Rename your object or delete the existing object.

I used PowerShell to delete the orphan object as follows:

Get-SPTimerJob | where { $_.name -like "*SharePoint - 80*" } |ft id,name
#Make a variable
$job = Get-SPTimerJob -id <id>
#Delete the timer job
$job.Delete()

After the the same PowerShell to delete as follows:

Remove-SPWebApplication http://sp2013/ -Confirm -DeleteIISSite -RemoveContentDatabases
and after a couple of minutes the web application we deleted.

I hope it will be useful.

--aaroh

Reference
1. Blog  



Low Code Reimagined with AI + Copilot Pitch Deck - Copy Copilot day (Virtual) - 2023

 Hi All,  I presneded a session at Pune UG on Low Code Reimagined with AI + Copilot Pitch Deck.  Video is at this address  https://www.youtu...