In this article we will discuss how to do iis reset on all sharepoint servers using powershell. The powershell commands used will find the list of sp servers in the farm first. Next powershell command will do iis reset on each sp server.
Advertisements
This script will list all SP Servers and restarts IIS on all of them.
add-PSSnapin microsoft.sharepoint.powershell
$spserver = get-spserver | ?{$_.role -eq "Application"}
foreach ($server in $spserver)
{
write-host "Performing IIS Reset on Server:"$server.name
iisreset $server.Name
}
Advertisements