January 17, 2013

Exchange 2010 - DAG maintenance issue

[PS] C:\Windows\system32>cd $exscripts

[PS] C:\Program Files\Microsoft\Exchange Server\V14\scripts>.\StartDagServerMaintenance.ps1 -serverName Server1.example.local

Make sure that DatabaseCopyAutoActivationPolicy is in Blocked state
[PS] C:\Program Files\Microsoft\Exchange Server\V14\scripts>Get-MailboxServer Server1.example.local | fl

If not use:
[PS] C:\Program Files\Microsoft\Exchange Server\V14\scripts>Set-MailboxServer Server1.example.local -DatabaseCopyAutoActivationPolicy Blocked

When you try to run StopDagServerMaintenance.ps1 you get error:

[PS] C:\Program Files\Microsoft\Exchange Server\V14\scripts>.\StopDagServerMaintenance.ps1 -serverName Server1.example.local
WARNING: [15:32:02.586 UTC] Call-ClusterExe: cluster.exe did not succeed, but 5042 was not a retry-able error code. Not
attempting any other servers. This may be an expected error by the caller.
Log-Error : [15:32:02.586 UTC] Start-DagServerMaintenance: Failed to resume the ability of the server Server1.example.local to host the Primary Act
ive Manager, 'cluster.exe /cluster:Server1.example.local node Server1 /resume' returned 5042.
At C:\Program Files\Microsoft\Exchange Server\V14\scripts\StopDagServerMaintenance.ps1:125 char:13
+             Log-Error <<<<  ($StopDagServerMaintenance_LocalizedStrings.res_0008 -f $serverName,$serverName,$shortServerName,$LastExitCode,"Start-DagServerMaint
enance") -stop
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Log-Error

It is because you enter full FQDN of server instead of NetBios name. Also don not forget to run Exchange Management Shell as administrator. To run script properly use:
.\StopDagServerMaintenance.ps1 -serverName Server1


  1. Try placing the server into maintenace mode from one of the other nodes and you'll find that works fine.

  2. This can be caused in a two node DAG, if StartDagServerMaintenance.ps1 encounters any errors (red warnings on the ps input) it will back out all the changes except moving mailboxes from active to passive dag server. It will not pause the cluster or block activation.

    The reason you are getting this is the stopdagservermaintence script is trying to activate stuff that the startdagservermaintenance didnt actually complete.
    As long as you can switchover all databases manually and that activation isnt blocked you should be good. script below to check activation.
    Get-MailboxSERVER | select NAME,*ACTIVATION* | ft –auto
    for further info see the posts

    1. I think I will never check it since migrated to 2013/O365. Anyway thank you for sharing.