Latest Posts

Delete Web Application manually and using PowerShell command

Deleting web application is equally important to maintain SharePoint farm. It is very significant that we periodically delete the web applications that are no longer in use. In this article, we will go through the options available for deleting the web application manually.


First, we will go through the manual steps so that it will be easier to understand what each option is used for.

The step-by-step process of deleting the Web Application manually

  1. Go to Central Administration >> Application Management >> Manage web applications
  2. Manage web application navigation
  3. Click on a Web application that you want to delete
  4. Web Applicationn Selection
  5. Go to Ribbon >> click on Delete button Dropdown. You will get two options
  6. Web application delete button dropdown
  • First option: Delete Web Application
  • first option delete webapplication
    1. Delete Content Database – If you tick Yes, Content Database associated with web application will be deleted. Once the content database is deleted, all the sites within the content database will also be deleted
    2. Delete IIS web sites: If you tick Yes, the IIS web site and all the IIS metadata related to this web application will be deleted. See Screenshot below
  • Second Option: Remove SharePoint from IIS Web Site
  • Remove SharePoint from IIS website
    1. Select IIS web site and zone to remove: This option is used to delete the web application Extension/Zone. Make sure you don’t delete the default zone. Mostly this is used to delete the extension of the main web application
    2. Delete IIS web sites: If you tick Yes, the IIS web site and all the IIS metadata related to this web application will be deleted.
    3. comparison before after deleting web application from IIS

Delete Web Application using PowerShell

  • For easy and quick deletion of Web Application, most of the administrators prefer to run PowerShell Command. Make sure you run the PowerShell using the Farm administrator account.
  • Open the SharePoint Management Shell and run the below command.
  • There are two examples given. Example 1 deletes zone and Example 2 deletes entire web application and content database.
  • ###Example 1:###
  • # Specify Web application URL here
  • $webApplcation = “https://sitename”
  • # This command will delete the web application Extension/Zone (Internet).
  • Remove-SPWebApplication –Identity $webApplcation –Zone Internet –Confirm
  •  
  • ###Example 2:###
  • # Specify Web application URL here
  • $webApplcation = https://sitename
  • # This command will delete the web application from IIS and Content Database.
  • Remove-SPWebApplication –Identity $webApplcation  -DeleteIISSite -RemoveContentDatabases -Confirm  

Conclusion

We went through manual steps as well as PowerShell command to delete Web application, which is one of the most essential tasks from SharePoint administration perspective. This article was performed in SharePoint 2013 On-premises.

You can go through a detailed explanation to delete Web Application using Powershell if you need in-depth knowledge of the syntax.


We value your Feedback:

Page URL:

Name:

Email:


Suggestion:

© 2024 Code SharePoint