##STOP MAINTENANCE $servername = $env:computername Set-ServerComponentState $servername -Component ServerWideOffline -State Active -Requester Maintenance Set-ServerComponentState $servername -Component UMCallRouter -State Active -Requester Maintenance Set-ServerComponentState $servername -Component HubTransport -State Active -Requester Maintenance Restart-Service MSExchangeTransport $servername = $env:computername cd $ExScripts .\StopDagServerMaintenance.ps1 -serverName $servername if(($servername -like '*Site2*') -or ($servername -like '*Site3*')) {set-mailboxserver $servername -DatabaseCopyAutoActivationPolicy Blocked} #CHECK THAT SERVER IS OUT OF MAINTENANCE Write-Host "Service Components should be active" -ForegroundColor Yellow Get-ServerComponentState $servername | ft Component,State -Autosize Write-Host "Server should be unrestricted for Site1 servers rest should be Blocked" -ForegroundColor Yellow Get-MailboxServer $servername | FL DatabaseCopyAutoActivationPolicy Write-Host "Clusternode state should be up" -ForegroundColor Yellow Get-ClusterNode $servername | FL Write-Host "Wait for all database copies and content indexes to be Healthy, this may take up to 10 minutes" -ForegroundColor Yellow Get-Mailboxdatabasecopystatus -server $servername ##RUN IF COMPONENTS ARE NOT ONLINE #Set-ServerComponentState $servername -Component ServerWideOffline -State Active -Requester Functional #Set-ServerComponentState $servername -Component Monitoring -State Active -Requester Functional #Set-ServerComponentState $servername -Component RecoveryActionsEnabled -State Active -Requester Functional ##TO COPY CONTENT INDEXES #Update-MailboxDatabaseCopyStatus \ -CatalogOnly