At work, I had come across monitoring alerts for our Exchange servers. The error had showed a failed state for the Exchange Edge Sync service. The only problem, we had lacked any Exchange Edge servers routing traffic. The remedy was disabling MSExchangeEdgeSync across almost 30 transport servers. Now, on one hand repetitive tasks were from an IT perspective, therapeutic; however, what if I had missed one by accident. So the push was on for a code snippet to silence them all like lambs Clarice.
1. get-transportserver – The first part was gathering all Exchange servers with the transport role.
2. set-service MSExchangeEdgeSync -startuptype “disabled” – This was important for avoiding the manual GUI moves per server.
3. -computername $computername – This was the final piece to the puzzle, pulling names for set-service to work against.
So, the final command was formatted like this.
set-variable -name $computername (get-transportserver) set-service MSExchangeEdgeSync -computername $computername -startuptype “disabled” -whatif
Again, I had encouraged anyone in a production environment to always append -whatif just before pulling the trigger. Be sure your sure, no one had liked making a mess of things in front of your chancellor.
Read More:
Set-Service (Microsoft Technet)
Set-Variable (SS64)