How to remove IIS from Windows Server using PowerShell

No more need for Windows Server IIS? Want to remove IIS completely from Windows Server using PowerShell? Start your PowerShell console as admin, and issue the following command in PowerShell:

Uninstall-WindowsFeature -Remove Web-Server

This will completely remove Internet Information Services (IIS) and its configuration! If you want to remove IIS web server, and be able to reinstall it later on, donโ€™t use the -Remove parameter:

Uninstall-WindowsFeature Web-Server

Uninstalls specified Windows Server roles, role services, and features from a computer that is running Windows Server 2012 R2. By adding the Remove parameter, also deletes feature files, or payload, from a computer. This cmdlet replaces Remove-WindowsFeature, the cmdlet that was used to uninstall roles, role services, and features in Windows Server 2008 R2.

Uninstall-WindowsFeature

Before removing IIS from your server, donโ€™t forget to backup IIS and its configuration.

Jan Reilink

Hi, my name is Jan. I am not a hacker, coder, developer or guru. I am merely an application manager / systems administrator, doing my daily thing at Embrace - The Human Cloud. In the past I worked for clidn and Vevida. With over 20 years of experience, my specialties include Windows Server, IIS, Linux (CentOS, Debian), security, PHP, websites & optimization. I blog at https://www.saotn.org.

6 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
EL FLE
26/04/2021 19:10

This removes the install files also so be careful if you’re just trying to remove the tools but want to be able to install again without having to point at alternative media

SCCM admin
29/03/2021 15:30

+1 worked for me also

JKK
24/02/2021 21:35

The One-And-Only solution for my problem. Thanks!