Archives For June 2014

Need to cycle IIS on all of your SharePoint servers? There are a couple ways to do it in 1-2 lines of PowerShell.

Option 1 (Requires SharePoint Admin shell or the Microsoft.SharePoint.PowerShell add in to be loaded)

Get-SPServer | ?{$_.Role -ne "Invalid"} | %{iisreset $_.Address}

Option 2 (Can be run from any POSH shell)

$servers = @("sp1","sp2","sp3")
$servers | %{iisreset $_}

Option 2 requires that you put your servers into an array manually. This could also be run on a single line.

$servers = @("sp1","sp2","sp3"); $servers | %{iisreset $_}

Happy POSHing!