PowerShell script to perform IISRESET on all servers in SharePoint Farm

This is a handy PowerShell script to have for every SharePoint admin. I’m sure, most of you have already had something like this.

This script is used to Reset all the Servers in SharePoint farm one after other without logging into each and every server. This comes handy during maintenance or in your Development environment where you will be getting your hands dirty.


#IISRESET onĀ all servers in SharePoint Farm

[array]$servers= Get-SPServer | ? {$_.Role -eq “Application”}

foreach ($server in $servers)
Write-Host “Attempting to reset: $server”
iisreset $server /noforce “\\”$_.Address
Write-Host -ForegroundColor Green “IIS has been reset for $server”
Write-Host “Reset completed!”


Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Disable feedback surveys in Power Platform

If you have worked in Microsoft 365 PowerApps or Power Automate, you might be familiar with feedback survey which pops up quite often. Microsoft wants your feedback on how likely are your to recommend Power Automate to a friend or colleague? Well, I ran into a conversation in twitter about this survey. Apparently I learnt […]

Read More

Error handling in Azure PowerShell Runbooks

Error handling in Azure PowerShell Runbooks should be handled carefully if not the runbook with continue to Completed state even if there is an Error in the script. Unlike exception, Runbook execution will continue after  an Error  by default. Windows PowerShell has multiple streams of output. Runbooks in Azure work differently in each of these […]

Read More

SharePoint Designer cannot display the item

You run into ‘SharePoint Designer cannot display the item’ error when you are trying to edit an existing workflow setup in Designer quite often when there is a windows update or update to .NET framework installed in your computer. In some cases it may also not allow you to create new workflows. Resolution: Clearing Designer […]

Read More