To remove IIS from a Windows Server 2012 R2 computer, use either Server Manager or PowerShell.
Using Server Manager (GUI):
- Open Server Manager (click the Server Manager icon on the desktop).
- At the top, click Manage and then Remove Roles and Features.
- On Before you begin, click Next.
- On Server Selection, select the server from the server pool and click Next.
- On Remove Server Roles, find Web Server (IIS) and clear its check box.
- If a Remove Features dialog appears listing dependencies, click Remove Features.
- Click Next.
- On the Features page, uncheck any additional features you want to remove, then click Next.
- On the Confirmation page, verify that Web Server (IIS) and any related items are listed, then click Remove.
- If prompted, restart the server to complete removal.
Using PowerShell:
- Open Windows PowerShell as Administrator (elevated session is required).
- Run the uninstall cmdlet for IIS, for example:
Uninstall-WindowsFeature Web-Server -IncludeManagementTools-
Uninstall-WindowsFeaturerequires admin rights. -
-IncludeManagementToolsensures IIS management tools are also removed.
-
- Restart the server if prompted.
If the system is Windows 8.1 or Windows Server 2012 R2 and update KB2919355 is installed, and IIS uninstall fails or rolls back, install the additional update described in the IIS uninstall issue article before trying to uninstall IIS again.
References: