The latest on High Availability & Site Resilience

Sign in to queue

The Discussion

  • User profile image
    ajacks

    The notes have been removed from the slides, so here are all the commands Dmitry used in his demo:

    #drain transport queues:
    Set-ServerComponentState $server -Component HubTransport -State Draining -Requester Maintenance
    #drain UM queue:
    Set-ServerComponentState $server -Component UMCallRouter –State Draining –Requester Maintenance
    # Set messaging redirection 
    Redirect-Message -Server $server -Target EXADV-2052.EXHV-7511dom.extest.microsoft.com -Confirm:$false
    # Suspend cluster node
    Suspend-ClusterNode $server -confirm:$false
    # server activation disfavored: 
    Set-MailboxServer $ server -DatabaseCopyActivationDisabledAndMoveNow $True -confirm:$false
    # server activation blocked
    Set-MailboxServer $server -DatabaseCopyAutoActivationPolicy Blocked -confirm:$false
    # Set all ServerComponentStates Offline
    Set-ServerComponentState $server             -Component ServerWideOffline -State Inactive -Requester Maintenance -confirm:$false
    
    Get-ServerComponentState $server| ft  -Autosize
    Get-MailboxServer $server | ft DatabaseCopy* -Autosize
    Get-ClusterNode $server | fl
    Get-Queue  -Server $server

    Second part of the demo:

    # how to collect all definitions from crimson channel?
    $probedefinitions = (Get-WinEvent -LogName Microsoft-Exchange-ActiveMonitoring/ProbeDefinition | % {[XML]$_.toXml()}).event.userData.eventXml 
    $responderdefinitions = (Get-WinEvent -LogName "Microsoft-Exchange-ActiveMonitoring/ResponderDefinition" | % {[xml]$_.toXml()}).event.userData.eventXml
    $monitordefinitions = (Get-WinEvent -LogName Microsoft-Exchange-ActiveMonitoring/MonitorDefinition | % {[xml]$_.toXml()}).event.userData.eventXml
    
    # Rollup monitor results from get-servehealth and get-healthreport:
    Get-ServerHealth -HealthSet dataprotection -Identity $server| ft -a
    Get-HealthReport -Identity $server
    Get-HealthReport -RollupGroup DAG01
    
    # one copy monitor: injecting notification and show that Monitor changes from “Healthy” to “Unhealthy”. 
    .\red.ps1# failure notification injection
    Get-ServerHealth -Identity $server| ?{$_.name -like "*onecopy*"}
    .\green.ps1# all healthy notification
    Get-ServerHealth -Identity $server| ?{$_.name -like "*onecopy*"}
    
    
    # replendpoint monitor: to  display how we can find probes and responders corresponding to a monitor (in this case there are 3 and 5). 
    $probes = @(); foreach ($p in $probedefinitions) {if ($p.name -like "*ServiceHealthMSExchangeReplEndpoint*") {$probes += $p;} }
    $probes | fl name,typename
    $responders = @(); foreach ($r in $responderdefinitions) {if ($r.alertmask -like "*ServiceHealthMSExchangeReplEndpoint*") {$responders += $r;} }
    $responders | fl name, TypeName
    
    # Also, displaying and walking through timeline of responders – going from restart to escalate
    $monitordefinitions = (Get-WinEvent -LogName Microsoft-Exchange-ActiveMonitoring/MonitorDefinition | % {[xml]$_.toXml()}).event.userData.eventXml
    $monitordefinitions | ?{$_.name -like "*replendpoint*"} | fl name, StateTransitionsXml
    
    # to MM and back to production :
    
    Set-ServerComponentState $server -Component HubTransport -State Draining -Requester Maintenance
    Set-ServerComponentState $server -Component UMCallRouter –State Draining –Requester Maintenance
    Redirect-Message -Server $server -Target EXADV-2052.EXHV-7511dom.extest.microsoft.com -Confirm:$false
    Suspend-ClusterNode $server -confirm:$false
    Set-MailboxServer $server -DatabaseCopyActivationDisabledAndMoveNow $True -confirm:$false
    Set-MailboxServer $server -DatabaseCopyAutoActivationPolicy Blocked -confirm:$false
    Set-ServerComponentState $server -Component ServerWideOffline -State Inactive -Requester Maintenance -confirm:$false
    
    Get-ServerComponentState $server| ft  -Autosize
    Get-MailboxServer $server| ft DatabaseCopy* -Autosize
    Get-ClusterNode $server| fl
    Get-Queue  -Server $server
    $queueTypes = @("DnsConnectorDelivery", "SmtpDeliveryToMailbox", "MapiDelivery", "SmtpRelayToRemoteAdSite", "SmtpRelayToDag", "SmtpRelayToServers")
    $queues = get-queue -server $Server -ErrorAction SilentlyContinue -filter {MessageCount -gt 0} | `
        ?{($QueueTypes -contains $_.DeliveryType -or $_.NextHopDomain -eq "Submission") -and (($_.MessageCountsPerPriority | Measure-Object -Sum).Sum -gt 0)}
    
    # ***
    
    Set-ServerComponentState $server -Component ServerWideOffline -State Active -Requester Maintenance
    Set-ServerComponentState $server -Component UMCallRouter –State Active –Requester Maintenance
    Resume-ClusterNode $server
    Set-MailboxServer $server -DatabaseCopyActivationDisabledAndMoveNow $False -Confirm:$false
    Set-MailboxServer $server -DatabaseCopyAutoActivationPolicy Unrestricted -Confirm:$false
    Set-ServerComponentState $server -Component HubTransport -State Active -Requester Maintenance -Confirm:$false
    Restart-Service MSExchangeTransport
    
    Get-ServerComponentState $server| ft  -Autosize
    Get-MailboxServer $server| ft DatabaseCopy* -Autosize
    Get-ClusterNode $server| fl
    Get-Queue  -Server $server

Add Your 2 Cents