Wed. Jun 8th, 2022

This script is used to Reset all the Servers in SharePoint farm.

Please Note: you have local administrator permissions on each server to perform the IISRESET.


Write-Host “Loading SharePoint Commandlets”

Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue

Write-Host -ForegroundColor Green ” Commandlets Loaded … Loading Variables”


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

$farm = Get-SPFarm

foreach ($server in $servers)


Write-Host -ForegroundColor Yellow “Attempting to reset IIS for $server”

iisreset $server /noforce “\\”$_.Address

iisreset $server /status “\\”$_.Address

Write-Host -ForegroundColor Green “IIS has been reset for $server”


Write-Host -ForegroundColor Green “IIS has been reset across the SharePoint Farm”

Start-Sleep -Seconds 5

This website uses cookies. By continuing to use this site, you accept our use of cookies.