Update Servers/Microsoft Exchange/Scripts/Restart Exchange Services.md

This commit is contained in:
2024-12-16 03:39:55 -07:00
parent 9f59613afa
commit d690fda712

View File

@ -1,14 +0,0 @@
**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
}
```