Prepare restart Exchange Server IIS PowerShell script
# Load Exchange Management Shell PowerShell Snap-In
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn
# Get All Exchange Servers
$Servers = Get-ExchangeServer
# Go through the list and restart one by one
foreach ($Server in $Servers) {
Write-Host "Restarting IIS on server: $($Server.Name)" -ForegroundColor Green
IISRESET $Server.Name
# Optional: Get the Status
Write-Host "IIS status for server $($server):"
IISRESET $server.Name /status
}
Write-host "IIS restarted on all Exchange Servers." -ForegroundColor Green
Комментарии
Отправить комментарий