Skip to main content

Stopping All Exchange Services

  1. # Stop MSExchangeADTopology Dependent services
  2. foreach ($svc in get-service MSExchangeADTopology) {$dep = $svc.dependentservices}
  3. foreach ($aa in $dep)
  4. {
  5. get-service $aa.Name | select Name,status
  6. stop-service $aa.Name
  7. get-service $aa.Name | select Name,status
  8. }
  9.  
  10. # Stop all services with the name Exchange
  11. $svcstatus = get-service *exchange* | select name,status
  12. foreach ($mystatus in $svcstatus -eq "Running") {$mystatus = $svcstatus.Status}
  13. foreach ($ab in $svcstatus)
  14. {
  15. get-service $ab.Name | select Name,status
  16. stop-service $ab.Name -f
  17. get-service $ab.Name | select Name,status
  18. }

upggr

I am the one