How to Restart Internet Information Services (IIS) on Exchange Server through PowerShell?

Newer versions of Exchange Server are getting more dependent on the web services. Several features and integrations rely on the web services in Exchange Server, like Outlook Web Access (OWA), Offline Address Book (OAB), Exchange Admin Center (EAC), Outlook Anywhere, and others. These web services depend on the Internet Information Services (IIS) on the Exchange Server.

In cases of installation or renewal of server certificates, maintenance work, or changes in the web configuration, you need to restart the ISS. In this article, we will be going to discuss different ways to restart the Internet Information Services (IIS) on Exchange Server.

Ways to Restart Internet Information Services (IIS) on Exchange Server

There are different ways to restart Internet Information Services on Exchange Server, such as using PowerShell, IIS Manager, and Services Console. Let’s discuss them in detail. However, before you proceed, consider the following:

  1. Restarting IIS will disconnect users who are connected to OWA, ActiveSync, Outlook clients, and other services. So, always perform this task during non-peak hours or on weekends.
  2. Restarting IIS does not delete any data but ensure there are no ongoing email transactions or user activities that could be interrupted during the restart process.
  3. Take a backup of Exchange Server data before performing such tasks. This will come in handy if something goes wrong.

Method 1: Restart the Exchange Server IIS through PowerShell Cmdlets

If you have a Database Availability Group (DAG) setup, you can use the PowerShell cmdlets to restart all the Exchange Servers in the group. Here is how to do so:

  • In the Exchange Management Shell (EMS), run the Get-ExchangeServer command to get the list of all the Exchange Servers in your setup. You can use this to automate the restart process of all the services on all servers.
  • Open Notepad or PowerShell ISE.
  • Create a new file, called Restart-IIS.ps1 and enter the following code:
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
# Get All Exchange Servers
$Servers = Get-ExchangeServer
foreach ($Server in $Servers) {
Write-Host "Restarting IIS on server: $($Server.Name)" -ForegroundColor Green
IISRESET $Server.Name
# Optional: Get the Status
Write-Host "IIS status for server $($server):"
IISRESET $server.Name /status
}
Write-host "IIS restarted on all Exchange Servers"
  • Save the file at the location recommended by Microsoft, which is C:\Scripts.
  • Open a PowerShell window as administrator and run the .\RestartIIS.ps1 script.

PowerShell window

  • The script will run. For each server in your setup, it will reset the service using the IISRESET command and will then check the status of the service.

using the IISRESET command

The advantage of using this method is that it will restart all the services cleanly for all the servers in an automated way.

Method 2: Restart Exchange Server IIS from Internet Information Services (IIS) Manager

If you want to restart the IIS for a single Exchange Server, you can use the Internet Information Services (IIS) Manager. For this,

  • Click on Start.
  • Click on Windows Administrative Tools.

Windows Administrative Tools

Note: In older versions (2016 and earlier), you need to go to Control Panel > Administrative Tools.
  • Double-click on the Internet Information Services (IIS) Manager

Internet Information Services (IIS) Manager

  • Right-click on the server’s name (in this case, it is SRV01) and click on Stop.

Right-click on the server’s name

  • In the right pane, you can see that the service is stopped. In this state, all the web-related services for Exchange will not work as this service hosts several Exchange Server services (see the image below).

Exchange Server services

  • Now to start the service, you just need to click on Start from the Actions tab on the right.

Actions tab

  • To check if the services are running, open the Outlook Web Access (OWA).

open the Outlook Web Access

Alternatively, you can highlight the server and click on Restart to restart the services.

click on Restart to restart the services

Method 3: Restart Exchange Server IIS from Services Control Panel

You can also restart the web services from the Services control panel in your computer. Here are the steps:

  • Right-click on Start and click on Run.

click on Start 

  • In the Run window, enter services.msc and click OK to open the Services control panel.

enter services.msc on Run Window

  • Scroll down to find the World Wide Web Publishing Service.
  • Highlight the service and click on Restart the service.

click on Restart the service

Alternatively, you can use the Command Prompt to restart the service. Follow these steps:

  • Right-click on Start and click on Run.

Start and click on Run

  • In the Run window, type CMD and press Enter.

Use CMD on Run command

  • In the Command Prompt, run the following command:

NET STOP W3SVC

Use NET STOP W3SVC command

  • To start the service, enter the following command:

NET START W3SVC

Use NET START W3SVC command

Method 4: Restart IIS Services using Services Console

If you want to restart some specific IIS-related services, then you can use the Services Console. Here are the steps:

  1. Press Windows Key + R, type services.msc, and press Enter to open the Services Console.
  2. Scroll down to locate the following key services:
  • World Wide Web Publishing Service (W3SVC)
  • IIS Admin Service (IISADMIN)
  • Microsoft Exchange Information Store (MSExchangeIS)
  • Microsoft Exchange Transport (MSExchangeTransport)
  1. Right-click on the service you want to restart and select Restart from the context menu. Repeat the steps for each service you wish to restart.

Conclusion

You would need to restart the Internet Information Services (IIS) if there is an issue with the service. However, there could be instances where there are underlying issues with the Exchange Server’s health. In such a situation, after an abrupt reboot, the databases might not mount due to corruption.

In such cases, an Exchange repair application, such as Stellar Repair for Exchange comes in handy. With this application, you can restore all the data with efficiency and ease. The application can open any version of Exchange Server database with no size limit and in any state - dirty shutdown or clean shutdown. You can browse through the database and export the EDB data granularly to PST and other file formats. You can also use the application to export directly to a live Exchange Server database or Microsoft 365. You can export user mailboxes, archives, shared mailboxes, disabled mailboxes, and public folders.



Was this article helpful?
About The Author
author image
Anubhuti Sinha linkdin Icon

Anubhuti is a tech enthusiast with deep expertise in Microsoft Exchange Server.

Table of Contents

WHY STELLAR® IS GLOBAL LEADER

Why Choose Stellar?
  • 0M+

    Customers

  • 0+

    Years of Excellence

  • 0+

    R&D Engineers

  • 0+

    Countries

  • 0+

    PARTNERS

  • 0+

    Awards Received