Make iisreset on all servers of SharePoint farm
It’s a very useful code. Sometimes after activating features, installing solutions or anything else you need to make iisreset on all the application servers of your SharePoint farm.
#IISReset on all application servers in a farm if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Write-Host "Connect Sharepoint library" Add-PSSnapin Microsoft.SharePoint.PowerShell } $farm = Get-SPFarm $servers = Get-SPServer | Where { $_.Role -eq "Application"} foreach($server in $servers) { Write-Host -ForegroundColor Red “Attempting to iisreset on server $server” iisreset $server /noforce iisreset $server /status Write-Host -ForegroundColor Green “iisreset has been successfully done on server $server” }