I want to get rid of the Web Application that I had for MySites as I have recreated a new web app for that. I want to know the proper procedure and steps to follow to remove the Web app and its content database from the farm and from SQL as well to make sure I do it in the correct order. This is a test environment.

2 Answers 2


deletion is easy process but housekeeping is little timy. We are following the below steps as a practice for decommission the Web Application:

  • Make Inventory of the Web application data, i.e. Content DB name9s0, #of site collections, url of site collections, custom settings,
  • Take the Backup of Content Database ( For safe play, in case you need the data again)
  • Take the URL of Web Application from Load Balancer / AlternateAccess Mapping ( whatever you have in place). This will stop the traffic to the web application and alert you if someone is still using it.
  • Delete the Web Application from Central admin or PowerShell ( this will delete the IIS Site on all servers, Databases[depending on your configuration], retract the solution which apply this web app, deletion of web.config).
  • Check the SQL Server and make sure all the database related to that WA should be gone, if exist then please delete them (in many case you have to delete at the end).
  • Check IIS on all servers and make sure No IIS site exist for that web app.
  • check the IIS site directory (where the web.config and other folders) and delete that if exist.
  • Remove the Custom Solution from central admin (if any which is dedicated for the web application).
  • Decommission the DNS and Loadbalancer entries.
  • If you have any monitoring tool i.e. SCOM, Delete those monitors as it will throw error.
  • If you have any dedicated service account for the web application, please delete those as well.
  • If you are using ADFS or Kerberos or FBA type authentication then you have to remove the configuration for the web application.
  • Trying to do step 3 to remove the URL from AAMs, as I only have a default zone alternate URL, this can not be deleted. Used Remove-SPAlternateURL -Identity http://MyWebapp and got error You cannot delete the default zone alternate URL so should I skip that step?
    – MLC
    Commented Dec 26, 2018 at 15:56
  • You have to change the url, u cant remove it from Aam.it will be removed automatically when web application deleted
    – Waqas Sarwar MVP
    Commented Dec 26, 2018 at 16:12

Ran this on the App Server:

Remove-SPWebApplication -Identity "Test My Sites" -Confirm -DeleteIISSite

This took care of removing everything for me. WebApp in Central Admin, Database in Central Admin, IIS sites on both MinRole servers, AAMs, IIS site directory content at C:\inetpub\wwwroot\wss\VirtualDirectories

Note: I am not using -RemoveContentDatabases as this is handled by the DBAs who have a specific procedure to follow.

Important: Have to do other cleanup steps defined by Waqas Sarwar MVP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.