Use command line to enable IIS web server on Windows 11

If you think the GUI is not your cup of tea, use the Windows Terminal command (Powershell) to install and activate Internet Information Services (IIS) on Windows 11.

Thanks to IIS, information such as files or documents can be made available on the network. Supported communication protocols are HTTP, HTTPS, FTP, SMTP, POP3 or WebDAV and other protocols. The web server is capable of running ASP.NET applications. It competes with the Apache web server and represents an alternative to so-called LAMP-based systems (Linux, Apache, MySQL, PHP).

This article explains the command to install IIS using PowerShell on Windows 11.

Powershell command to enable Internet Information Services on Windows 11

1. Open Windows Terminal (Powershell)

On your Windows 11 operating system, right-click on the To start up button and select the “Windows terminal (administrator)” option.

2. Command to install IIS on Windows 11

Then just run the given command syntax to enable the service of your choice, and the same can be used for IIS and its components as well.

Enable-WindowsOptionalFeature -Online -FeatureName 

Let’s say we want to use the above syntax to enable – IIS, Common Features, Management Console, etc. The command will be:
_________________________________________________________

Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer, IIS-CommonHttpFeatures, IIS-ManagementConsole, IIS-HttpErrors, IIS-HttpRedirect, IIS-WindowsAuthentication, IIS-StaticContent, IIS-DefaultDocument, IIS-HttpCompressionStatic, IIS-DirectoryBrowsing

_________________________________________________________

Command to enable IIS server on Windows 11

Once activated, press Yes to restart your system.

3. Run IIS Server Manager

To access the IIS manager, navigate to To look for icon, click on it and type IIS. Once the option “Internet information services” appears, click to run the same.

4. Command to restart or get web server status

Well, of course, we can restart the web server directly from the IIS manager GUI, just for the knowledge, it can be done using the CLI.

For running web server status

Get-Service W3SVC

To start IIS:

iisreset

5. Disable Internet Information Services

As we used the command to enable web services, we can use the same to disable the IIS server. Here is that, just run the given command in your windows terminal (Powershell) to uninstall Microsoft web server – IIS.

Disable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer

Other Items: