Hello, I am new to Sharepoint to CA configuration.
I have tried to create an web application, and half way during the creation, I got an error.
Now I want to delete the Web Application and I got this error:Ā Object reference not set to an instance of an object.
I tried using powershell to remove the web application also got error.
I have checked the Content DB is empty, IIS doesn’t show this site, virtual directory doesn’t exist.
How do it solve this?
Regards,
Vin
?width=750
HiĀ Ajeet,
I have found the solution for this, simply point the web application to another web application IIS using this function:
Function Set-WebApplicataionPool($WebAppURL,$ApplicationPoolName){
$apppool = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools | where {$_.Name -eq $ApplicationPoolName}
if ($apppool -eq $null){
write-host -foreground red “The Application Pool $ApplicationPoolName does not exist!”
return 1
}
$webapp = get-spwebapplication -Identity $WebAppUrl
if ($webapp -eq $null){
write-host -foreground red “The Web Application $WebAppUrl does not exist!”
return 1
}
$webapp.Applicationpool = $apppool
$webApp.Update()
$webApp.ProvisionGlobally()
write-host -foreground green “$WebappURL Application Pool has been changed to $ApplicationPoolName”
return 0
}
Set-WebApplicataionPool -WebAppURL “http://sitename” -ApplicationPoolName “SharePoint – SiteName”
source from:Ā Cannot Create, Extend, or Delete a Web Application in Central Administration
Hope this help to someone!!
Regards,
Vin