Jan 06 2021 01:08 PM - edited Jan 06 2021 01:15 PM
Hi all
I am doing a script to automate some steps related to server maintenance, but there is a strange behavior from Exchange, The Queue is not available for sometime after Running Set-ServerComponentState
Set-ServerComponentState -Identity ex01 -Component HubTransport -State Draining -Requester Maintenance
while ($true){
Get-ServerComponentState -Identity ex01 -Component HubTransport
(Test-ServiceHealth).ServicesNotRunning
Get-Queue -Server ex01 | select MessageCount
if ((get-service MSExchangeFrontEndTransport).Status -notlike "Running"){Write-Host get-service MSExchangeFrontEndTransport -ForegroundColor Red}
sleep -Seconds 2
}
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
Apr 27 2021 02:40 PM
I have a restart of the MSExcahngeTransport and MSExchangeFrontEndTransport services in my script directly after the Set-ServerComponentState to speed up the draining process in out automation script
Apr 28 2021 12:36 AM