Levae this script running for about 30 second and then you will get an error that
Get-Queue : Exchange can't connect to the Microsoft Exchange Transport service on computer "ex01". Verify that the service is started. At line:5 char:1 + Get-Queue -Server ex01 | select MessageCount + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Get-Queue], LocalizedException + FullyQualifiedErrorId : [Server=EX01,RequestId=ccb3aa23-4dfc-45f3-9b87-82de2536a9b3,TimeStamp=1/7/2021 4:52:45 AM] [F ailureCategory=Cmdlet-LocalizedException] A97D44C4,Microsoft.Exchange.Management.QueueViewerTasks.GetQueueInfo
In the Windows Event log I notice that there is a failure related MSExchangeFrontEndTransport, even though the service is not restarting, but it seems its a configuration reload.
Can someone confirm what is going on. is it a config reload or why the Queue becomes unavailable for sometime after set-ServerComponenetState.
I tried this on both Exchange 2016 and Exchange 2019, same result