Last active
January 2, 2024 16:46
-
-
Save bill-long/8ae1d3206406116d4e8a8c3d42b9025c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ExchangeServices { | |
$services = @(Get-Service MSExchange* | Where-Object { $_.StartType -eq "Automatic" }) | |
$services += Get-Service HostControllerService | |
$services += Get-Service W3SVC | |
return $services | |
} | |
function Stop-ExchangeServices { | |
$servicesToStop = Get-ExchangeServices | |
foreach ($service in $servicesToStop) { | |
Stop-Service $service -Force | |
} | |
} | |
function Start-ExchangeServices { | |
$servicesToStart = Get-ExchangeServices | |
foreach ($service in $servicesToStart) { | |
Start-Service $service | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment