diff --git a/Scripts/Powershell/Exchange/Restart Exchange Services.md b/Scripts/Powershell/Exchange/Restart Exchange Services.md new file mode 100644 index 0000000..ce11a49 --- /dev/null +++ b/Scripts/Powershell/Exchange/Restart Exchange Services.md @@ -0,0 +1,14 @@ +**Purpose**: +Sometimes Microsoft Exchange Server will misbehave and the services will need to be *bumped* to fix them. This script iterates over all of the Exchange-related services and restarts them automatically for you. + +``` powershell +$servicelist = Get-Service | Where-Object {$_.DisplayName -like "Microsoft Exchange *"} +$servicelist += Get-Service | Where-Object {$_.DisplayName -eq "IIS Admin Service"} +$servicelist += Get-Service | Where-Object { $_.DisplayName –eq "Windows Management Instrumentation" } +$servicelist += Get-Service | Where-Object { $_.DisplayName –eq "World Wide Web Publishing Service" } + +foreach($service in $servicelist){ + Set-Service $service -StartupType Automatic + Start-Service $service +} +``` \ No newline at end of file