Internet Information Services (IIS) is a web server that runs on Microsoft Windows operating systems. IIS is a crucial component of many web-based applications, and it is necessary to know how to restart IIS when it malfunctions or needs updates. While restarting IIS can be done through the IIS Manager graphical user interface, it can also be performed using the command line interface. In this article, we will discuss how to restart IIS via the command line.
Step 1: Open Command Prompt
To access the command line interface, you will need to open the Command Prompt. To do this, click the Windows Start button, search for “cmd”, and select the Command Prompt app from the search results.
Step 2: Stop IIS
To stop IIS, you will need to enter the following command in the Command Prompt:
iisreset /stop
To stop IIS on command line, open terminal and type:
Press WIN + R
to open Run window. Type the same command on run window and press enter:
This command will stop all running IIS services.
Step 3: Start IIS
To start IIS, you will need to enter the following command in the Command Prompt:
iisreset /start
Press WIN + R
to open Run window. Type the same command on run window and press enter:
This command will start all IIS services that were stopped in the previous step.
Step 4: Restart IIS
Alternatively, you can restart IIS with a single command using the following:
iisreset /restart
To restart IIS on command line, open terminal and type:
Press WIN + R
to open Run window. Type the same command on run window and press enter:
This command will both stop and start IIS services at the same time.
Step 5: Verify IIS is running
To ensure that IIS is running correctly, you can check its status by entering the following command in the Command Prompt:
iisreset /status
This command will display the current status of all IIS services.
In conclusion, restarting IIS via the command line interface is a simple process that can be done using a few basic commands. By following these steps, you can quickly and easily restart IIS, which can help to resolve any issues that may be preventing your web-based applications from running correctly.
6 Comments
Prathima (or anyone curious about the same), hope you’ve gotten your answer by now.
But if not…
You’ll need to write a small script that runs the iisreset command. Just a quick line or two like this will work:
@echo off
c:\Windows\system32\iisreset.exe /restart
Another script could check on the status of the web server periodically, seeking a specific page. You can even target one that’s not publicly linked, such as
/TellMeWhenThisSiteIsDown.html
Put the web check script in your Task Scheduler. Once an hour, every five minutes, whatever. If the page loads properly, the script exits; if it finds errors, it then runs the restart script.
A “quick and dumb” way to do this would be to simply run the restart script each day when you expect no clients (e.g. 3am).
The disadvantage of course is that it would disconnect / log out anyone who happened to be visiting at the time of the restart (INCLUDING other automated processes relying on the web server), which is of course not ideal. But it also can be written, scheduled, and done in two minutes. So for a low-volume site that still needs to remain available… it’s an option.
Your picture under “Stop” and “Start” are backwards (they don’t sync with the text)
How we can stop remotely from other server as a batch or powershell ?
Thanks a lot, it saved my day 🙂
I can’t start my wampp server because it’s IIS service still online.
Hi ,
Can you please help me is there a way to automate this process to perform iisreset when one of the services is down ?
Hello Thanks Post To This Article. Its Working And use to easily..