Use command line to enable IIS web server on Windows 11

0

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

Using IIS, information such as files or documents can be made available over 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 activate Internet Information Services on Windows 11

1. Open the Windows terminal (Powershell)

On your Windows 11 operating system, right click on the Start and select the “Windows Terminal (administrator)”Option.

2. Command to install IIS on Windows 11

Then just run the given command syntax to activate the service you want, 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 order will be:
________________________________________________________

Enable-WindowsOptionalFeature -Online -FeatureName IIS-WebServerRole, IIS-WebServer, IIS-CommonHttpFeatures, IIS-ManagementConsole, IIS-HttpErrors, IIS-HttpRedirect, IIS-WindowsAuthentication, IIS-StaticDirecticContentIS-Compression, IIS-StaticDirecticContent-Document-Computers

_________________________________________________________

Command to activate IIS server on Windows 11

Once activated, press Yes to restart your system.

3. Run the IIS server manager

To access IIS Manager, go 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 to know this can be done using the CLI.

For the status of the running web server

Get-Service W3SVC

To start IIS:

iisreset

5. Disable Internet information services

Since we have used the command to turn on web services, we can use it to turn off the IIS server. Here is that, just run the given command in your Windows Terminal (Powershell) to uninstall Microsoft IIS web server.

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

Other articles:

Share.

Comments are closed.