An Exchange Server 2010 Database Availability Group (DAG) provides several benefits to an organization, primarily that of continuous availability of mailbox databases.

To update the DAG members with new patches, update rollups or service packs, the update process should be managed to prevent all of the DAG members from being offline at the same time.

To do this you can move the active mailbox databases off a particular server so that it can be patched, and if necessary rebooted, without causing any downtime for mailbox users on that database.

This tutorial demonstrates how to update the servers in an Exchange Server 2010 Database Availability Group without causing downtime. Because this process differs depending on the version of Exchange Server 2010 you’re running I’ve covered each method here.

For this tutorial Update Rollup 4 for Exchange Server 2010 is being installed. In your case you should be planning to deploy the latest service pack and/or update rollup that is available for Exchange Server 2010.

Preparing an Exchange Server 2010 RTM DAG Member for Updates

The first step is to move active mailbox databases to another DAG member so that the server can be updated.

To see a list of mailbox databases and their current active server use the Get-MailboxDatabase cmdlet.

[PS] C:\>Get-MailboxDatabase

Name                           Server          Recovery        ReplicationType
----                           ------          --------        ---------------
Mailbox Database 02            EX1             False           Remote
Mailbox Database 01            EX2             False           Remote

In this example I want to apply updates to server EX1, and I can see that it currently hosts the active copy of Mailbox Database 02.

If your environment has a lot of DAG members and mailbox databases you can refine this query to only show active mailbox databases for a specific server.

[PS] C:\>Get-MailboxDatabase | where {$_.Server -eq "EX1"}

Name                           Server          Recovery        ReplicationType
----                           ------          --------        ---------------
Mailbox Database 02            EX1             False           Remote

Move the mailbox databases using the Move-ActiveMailboxDatabase cmdlet.

[PS] C:\>Move-ActiveMailboxDatabase "Mailbox Database 02" -ActivateOnServer EX2

Confirm
Are you sure you want to perform this action?
Moving mailbox database "Mailbox Database 02" from server "ex1.exchangeserverpro.local" to server
"EX2.exchangeserverpro.local".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): y

Identity        ActiveServerAtS ActiveServerAtE Status     NumberOfLogsLost   RecoveryPoint MountStatus MountStatus
                tart            nd                                            Objective     AtMoveStart AtMoveEnd
--------        --------------- --------------- ------     ----------------   ------------- ----------- -----------
Mailbox Data... ex1             ex2             Succeeded  0                  14/09/2010... Mounted     Mounted

All of the mailbox databases are now active on server EX2.

[PS] C:\>Get-MailboxDatabase

Name                           Server          Recovery        ReplicationType
----                           ------          --------        ---------------
Mailbox Database 02            EX2             False           Remote
Mailbox Database 01            EX2             False           Remote

As another example, if there were multiple databases active on a server you can move all of them with a single command.

[PS] C:\>Get-MailboxDatabase | where {$_.Server -eq "EX1"} | Move-ActiveMailboxDatabase -ActivateOnServer EX2 -Confirm:$false

Identity        ActiveServerAtS ActiveServerAtE Status     NumberOfLogsLost   RecoveryPoint MountStatus MountStatus
                tart            nd                                            Objective     AtMoveStart AtMoveEnd
--------        --------------- --------------- ------     ----------------   ------------- ----------- -----------
Mailbox Data... ex1             ex2             Succeeded  0                  14/09/2010... Mounted     Mounted
Mailbox Data... ex1             ex2             Succeeded  0                  14/09/2010... Mounted     Mountede

Note the use of -Confirm:$false to avoid having to confirm each move. Use this option with caution.

After moving all active mailbox databases off the server that you are planning to update, the final preparation step is to block activation on the server to prevent it from automatically reactiving a database copy while you are performing maintenance.

First check the current activation policy on the server using Get-MailboxServer.

[PS] C:\>Get-MailboxServer EX1 | fl Name,DatabaseCopyAutoActivationPolicy

Name                             : EX1
DatabaseCopyAutoActivationPolicy : Unrestricted

Next, use Set-MailboxServer to block activation.

[PS] C:\>Set-MailboxServer EX1 -DatabaseCopyAutoActivationPolicy Blocked

Preparing an Exchange Server 2010 SP1 or Later DAG Member for Updates

For Exchange 2010 with Service Pack 1 the process is a little easier thanks to some scripts provided by Microsoft. Open the Exchange Management Shell and navigate to the scripts folder on the Exchange server.

cd $exscripts

Next run the StartDagServerMaintenance.ps1 PowerShell script.

.\StartDagServerMaintenance.ps1 -serverName ho-ex2010-mb1

The script will automatically do the following tasks for you:

  • Calls Suspend-MailboxDatabaseCopy on the database copies.
  • Pauses the node in Failover Clustering so that it can not become the Primary Active Manager.
  • Suspends database activation on each mailbox database.
  • Sets the DatabaseCopyAutoActivationPolicy to Blocked on the server.
  • Moves databases and cluster group off of the designated server.

Stopping Conflicting Services

If the mailbox server is running any Exchange-integrated services, such as antivirus software, these should be disabled prior to the update.

For example to disable Forefront use the FSUtility command (note that this is done automatically by Exchange Server 2010 update rollups and service packs now).

C:\> fsutility /disable

Another example is Data Protection Manager 2010, which may be configured to perform Copy backups from passive database copies at frequent intervals through the day. Make sure these jobs are paused to prevent errors or conflicts from occuring.

Disabling Server Monitoring

If the DAG members are monitored using SCOM or a similar system then this should also be disabled or placed into maintenance mode.

This will prevent alarms from being raised as well as prevent any automatic remediation actions from being run by the monitoring agent that may cause the server updates to fail.

Updating the Server

Install the update following the deployment notes for that update type.

Update rollups come in the form of a .MSP file (Windows Installer Patch) that is applied to the server. Simply double-click the file or launch it from a command line window.

Service packs are a complete reissue of the Exchange Server setup files and are installed by running setup in upgrade mode, which can be run in either graphical or command line mode.

C:\> setup /m:upgrade

Both update rollups and service packs can take some time to install, so plan a large window of time for these updates.

How to Install Updates on Exchange Server 2010 Database Availability Groups

Verifying the Update

After the update has completed, and if necessary the server rebooted, you should check the server’s health before placing it back into production in the CAS array.

Event Logs – look for error or warning events that have started since the update was applied.

Setup Logs – service packs write a complete setup log file to C:ExchangeSetupLogs

Services – check the Exchange services are running (or at least those that you expect to be running, some such as IMAP and POP will be stopped if you have not explicitly enabled them)

[PS] C:\>Get-Service *exchange*

Status   Name               DisplayName
------   ----               -----------
Running  MSExchangeADTop... Microsoft Exchange Active Directory...
Running  MSExchangeIS       Microsoft Exchange Information Store
Running  MSExchangeMailb... Microsoft Exchange Mailbox Assistants
Running  MSExchangeMailS... Microsoft Exchange Mail Submission
Stopped  MSExchangeMonit... Microsoft Exchange Monitoring
Running  MSExchangeRepl     Microsoft Exchange Replication
Running  MSExchangeRPC      Microsoft Exchange RPC Client Access
Running  MSExchangeSA       Microsoft Exchange System Attendant
Running  MSExchangeSearch   Microsoft Exchange Search Indexer
Running  MSExchangeServi... Microsoft Exchange Service Host
Running  MSExchangeThrot... Microsoft Exchange Throttling
Running  MSExchangeTrans... Microsoft Exchange Transport Log Se...
Running  msftesql-Exchange  Microsoft Search  (Exchange)
Running  vmickvpexchange    Hyper-V Data Exchange Service
Stopped  wsbexchange        Microsoft Exchange Server Extension...

Returning an Exchange Server 2010 RTM DAG Member to Production

If the update was successful and the server healthy then it can be placed back into production.

Re-enable services such as Forefront Protection for Exchange.

C:\> fsutility /enable

Re-enable monitoring agents and alarms for the server.

Set the server’s activation policy back to its original setting.

[PS] C:\>Set-MailboxServer EX1 -DatabaseCopyAutoActivationPolicy Unrestricted

At this stage you might move all of the active mailbox databases to the server that was just updated so that you can update the other servers in the DAG. After all of the DAG members have been updated it is likely that mailbox databases will be active on servers that are not their first activation preference.

For Exchange Server 2010 RTM you can view the activation preferences for each database, and manually move active mailbox databases to their preferred server.

[PS] C:\>Get-MailboxDatabase | fl name,activationpreference

Name                 : Mailbox Database 02
ActivationPreference : {[EX2, 1], [EX1, 2]}

Name                 : Mailbox Database 01
ActivationPreference : {[EX1, 1], [EX2, 2]}
[PS] C:\>Move-ActiveMailboxDatabase "Mailbox Database 01" -ActivateOnServer EX1

Confirm
Are you sure you want to perform this action?
Moving mailbox database "Mailbox Database 01" from server "EX2.exchangeserverpro.local" to server
"ex1.exchangeserverpro.local".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [?] Help (default is "Y"): y

Identity        ActiveServerAtS ActiveServerAtE Status     NumberOfLogsLost   RecoveryPoint MountStatus MountStatus
                tart            nd                                            Objective     AtMoveStart AtMoveEnd
--------        --------------- --------------- ------     ----------------   ------------- ----------- -----------
Mailbox Data... ex2             ex1             Succeeded  0                  14/09/2010... Mounted     Mounted

Returning an Exchange Server 2010 SP1 or Later DAG Member to Production

Once again Exchange 2010 with Service Pack 1 makes this task easier thanks to a script provided by Microsoft. Open the Exchange Management Shell and navigate to the scripts folder on the Exchange server.

cd $exscripts

Next run the StopDagServerMaintenance.ps1 PowerShell script.

.\StopDagServerMaintenance.ps1 -serverName ho-ex2010-mb1

The script will automatically reverse each of the actions made by StartDagServerMaintenance.ps1 except that it will not move active mailbox databases back to the server.

To move the active mailbox databases you can continue to go to each mailbox server in the DAG and run StartDagServerMaintenance.ps1 and perform your updates. When all of the servers have been updated you can rebalance the DAG automatically using a script from Microsoft which is demonstrated here.

[adrotate banner=”49″]

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Chris

    Hi Paul,
    I am currently running Exchange 2010 SP3 RU12 and will updating to RU29. I have two DAG servers and two CAS Servers. Im looking for the correct or preferred order of installing. Should I do one cas and one dag then move over to the next two or do both cas servers first then move to the dag servers. Thanks a bunch for any info.

  2. Kris

    Hi Paul,

    I would like to seek your opinion/advise. Currently I have 2 Exchange 2010 in DAG environment in the same site. All active DB’s are hosted in Exchange A, I am able to move the active DB’s to Exchange B with no issue however when I shutdown Exchange A all my outlook clients are unable to connect. My mail.example.com is pointed to DAG IP. I don’t have any CAS array, both Exchange A and B had the same roles.

    Regards,
    Kris

  3. Z RATHER

    Hi,
    I am on “Update Rollup 6 for Exchange Server 2010 SP3″
    Can i directly install ” Update RU15 for Exchange Server 2010 SP3.” If not what is the lat RU that i need to apply before applying RU15.

    Here is my current version.
    ProductVersion FileVersion FileName
    ————– ———– ——–
    14.03.0195.001 14.03.0195.001 C:Program FilesMicrosoftExchange ServerV14binExSetup.exe

    Thanks.

  4. Jatin Patel

    Hi Paul,

    This is a great article, Thank you for sharing.

    I have a question, We have Two Mailbox servers ( Server A and Server B) in DAG.
    Server A has active copy of 4 Databases
    Server B has Public Folder Database ( This is the only Copy on this server and not being Replicated to Server A)

    Now when I run the StartDagMaintenance Script on ServerB, will Public Folder Database be migrated to Server A ? Ideally We do not want this to happen as this is around 400GB .

    or will it just stay on ServerB and not accessible ?

    Any advice would be appreciated.

    Thanks

    Jatin

    1. Paul Cunningham

      No, the PF database won’t be migrated to the other DAG member. In Exchange 2010 DAGs don’t replicate PF databases at all.

      1. Jatin Patel

        Thank you Paul for your prompt response. I will try to update mailbox servers this weekend with the help of this article.

  5. alan

    Ok thank you a lot. I understand a lot better now. I thought the caution meant there was a risk of damaging the database by just doing a move. 🙁

    The “additional steps” are exactly what I’d like to find in a tutorial. Especially different strategies when the database is big and reseeding multiple copies from scratch might take a long time.

    1. Paul Cunningham

      One way or another you need to reseed the database to the other DAG members. Concerns about long seeding times are a good reason to not run large databases. Multiple smaller databases is often better.

  6. Alan

    Hi Paul,

    When installing Windows updates, is it standard practice to click “Suspend Database Copy” on each passive copy on the server being updated as well as running the StartDagServerMaintenance script?

    And a follow-up, when installing Exchange roll-ups or Service Packs, would you recommend stopping/disabling all Exchange services on the server being updated first, as well as running StartDagServerMaintenance?

    I’m asking because we have ended up with a very long list of steps for upgrading our Exchange 2010 SP3 servers.

    Thanks,

    – Alan.

    1. Paul Cunningham

      No, the script suspends database copies for you (that is mentioned in the article above).

      No, you should not stop or disable services.

      1. Alan

        Thanks for your time.

        That’s very strange. What we’ve always found on our Ex 2010 servers is that the StartDagServerMaintenance script blocks activation but never suspends the seeding of the passive databases… we have to manually do that afterwards in the EMC.

        Any idea why? The scripts can’t be faulty on all our servers.

        1. Paul Cunningham

          Suspend-MailboxDatabaseCopy is part of the script (obviously you can just open the script in an editor and see whether someone has tampered with it). If it isn’t taking effect that is something to look further into, but the intention of the script is that it performs that step.

          1. alan

            Thank you very much for clarifying that. Yes, I see that in the script and no, it hasn’t been modified since SP3 was installed. Something to investigate further.

            Btw above you mention exercising care when using the -confirm:false option in the Move-ActiveMailboxDatabase cmdlet. I need to do that in a scheduled script that runs out of hours, so that online Outlook 2010 users don’t experience even a momentary disconnection during the day.

            Why the caution? I’m going to specify lossless mode but as a contact worker, I’m paranoid.

            Also, if the worse happens, do you know of any tutorials on restoring an individual DAG database (not the entire DAG/all its databases) or does that just not happen? We have 4 databases per DAG and each database has 1 active/3 passive copies on different servers.

            I don’t see that scenario in your Troubleshooting Exchange book, which is excellent otherwise. Can’t find it discussed much elsewhere either.

            Thanks again.

          2. Paul Cunningham

            Confirm:$false may mean that database moves you weren’t expecting to occur will occur. The cautionary note is to say that you should not use it without understanding what is about to happen.

            If you lose all copies of a database you can restore from backup. It’s the same process as restoring any other database, with additional steps to remove/re-add database copies.

  7. Alan

    Hi Paul,

    When installing Windows updates, is it standard practice to click “Suspend Database Copy” on each passive copy on the server being updated as well as running the StartDagServerMaintenance script?

    And a follow-up, when installing Exchange roll-ups or Service Packs, would you recommend stopping/disabling all Exchange services on the server being updated first, as well as running StartDagServerMaintenance?

    I’m asking because we have ended up with a very long list of steps for upgrading our Exchange 2013 SP3 servers.

    Thanks,

    – Alan.

  8. Richard

    Hi Paul,

    I am using Exchange Server 2010 SP3 in Window Server 2008 R2
    Last time, I upgraded firmware from IBM system to fix battery controller. And I got one problem the sector size of all disks is mismatch. I followed below link to solve but cannot until at this time: http://blogs.technet.com/b/exchange/archive/2013/04/24/exchange-2010-database-availability-groups-and-disk-sector-sizes.aspx

    Currently, I am using at file replication mode instead of block replication mode in Exchange Server. So, my question is with in your steps above, can I update latest rollups at file replication mode. I hope this rollup can fix my problem.

    I will appreciate with your support.
    Best Regards.
    Richard

  9. Peter

    Hello Paul,

    My environment consist of two CAS server sitting behind a load-balancer. One of the CAS server is a witness server for a dag that consists of two mailbox servers. What is the correct sequence for patch all 4 servers? When should the dag witness server patch? Should one of the mailbox server put on maintenance mode in order to patch the witness server so the fail-over process won’t trigger without the witness server available?

    Thank you!

    1. Paul Cunningham

      For Exchange 2010 do Client Access first (I’m assuming those are also your Hub Transport servers), then Mailbox.

      The FSW can be unavailable without causing the DAG to do anything, because the two DAG members are still able to form quorum (2/3 nodes are still online).

      You only put a DAG member into maintenance mode when you intend to patch *that* DAG member.

  10. Z. Rather

    Greetings.
    I have DAG of two members servers one server on each site. I have CAS array FQDN hqoutlook.local.com and clients use this ARRAY FQDN hqoutlook.local.com to connect to Exchange. Now I have to test the failure like that the Server at HQ site will be marked as down and all the database will be moved to DR site DAG member.
    In this scenario if I change the DNS/IP of the hqoutlook.com to DR server CAS server will users be able to connect at the DR site and the main site will be marked as down. The rpcclientaccessserver for all the Database is set hqoutlook.local.com.
    There is no load balancer etc. in place. Just I am pointing the DNS record of hqoutlook.local.com to the CAS server [ Bothe the members server of my DAG are multirole server].

    your views on this please.

    Z .Rather.

    1. Paul Cunningham

      It will probably work, but I don’t know your environment so don’t take my word for it. Plan for a test during an outage window and do your testing to see whether it will work for you.

  11. Brian

    Hi Paul,
    Great article. My question to you is, is it possible to automate Windows Server Updates on Exchange Backend and Front end servers in a DAG formation?
    If so can you point me to some links? I am trying to automate so I don’t have to do this manually.

    Regards,

    1. Paul Cunningham

      It’s basically all PowerShell, so yes.

      I don’t know of any publicly shared scripts though.

  12. Bart

    No matter what i google about Exchange 2013, I always end up on this website! Good explanations! You rock! 🙂

  13. Brad

    Hi

    I have a situation where I have two separate dags one hosting archive mailboxes and one hosting user mailboxes across 4 servers.

    Is there a preference to which DAG should be updated first ie archive dag first and if so will there be any issues in only updating the user DAG at a later stage ?

    Thanks for your help

      1. Brad

        Service pack on the Archive DAG has been applied and all is working as expected, Thank you for assistance and prompt reply.

  14. mohammed

    i have two mailbox servers configure with dag.
    i have two hub & cas server.

    how can i update exchange 2010 sp2 to sp3.
    can you please help me to solve this

    1. Paul Cunningham

      Read the article above. It explains how to install updates on DAG members.

  15. Bob Collins

    Hi Paul,

    As others have stated, thank you for clear, concise, and excellent articles.

    I think i may have shot myself in the foot this maintenance, as I did not run the startdagmaintenance scripts. I manually made a DAG member to be active database. I am applying updates to the DAG member I took the active database from.

    Is it too late to run the start maintenance scripts? The DAG member I am now updating has a very large copy queue length and is in the status of initializing.

    What are your thoughts?
    Thanks
    Bob

    1. Paul Cunningham

      You could probably still run the start script. Not sure about the current status of your DAG though since I can’t see it and your description is a bit unclear. But it sounds like you’ve learned a lesson 😉

  16. deepak k

    i have 3 dag numbers exch01, exch02, exch03. Exch03 in mounted state and all other in healthy state. after windows update excho3 shows service down state . now I mount exch01. how can I turn up the service?

  17. Annie

    Hi paul,
    Your blogs are always informative and supportive to me. Thanks for that.
    I have one query here, If the DAG extended to two sites, also CAS/HUB/SMTP are available at both sites. I wanted to upgrade to sp2 on CAS/HUB/SMTP and members of DAG at one site only and remain the other site with exchange sp1 till some time. will my DAG still work and replicated properly between two sites where half of mailbox servers at one site with exchange sp1 and another half at other site with sp2.
    Thanks in advance..

  18. Kirld

    Paul,

    We are having Exchange 2K10 SP1 RU8… we are planning to install SP3. does this steps still apply on having that installation? or there are more points to consider before installation?

      1. Kirld

        Thanks Paul.. as always..You’re a great help.

      2. Kirld

        Paul..

        Is it ok if we upgrade our CAS/HT to SP3 and leave our Mailbox server to SP1?

        1. Paul Cunningham

          You don’t need to upgrade them simultaneously, if that is what you mean.

          You should plan to upgrade your Mailbox server at some stage though.

        2. Kirld

          Thanks.. however, we will be upgrading our Mailbox server few weeks after the CAS/HT. i was just concerned if there will be impacts if we have CAS/HT at SP3 and Mailbox at SP1 at the time before we upgrade themailbox to SP3.

      3. Adnan

        Hi Paul,
        My question is different. i have already Exchange 2010 SP3 installed with the DAG.
        i want to install the CU17 on my mailbox servers which are part of DAG. When i executed .\StartDagServerMaintenance.ps1 script it started moving mailboxes to other server but at the end it gave me error message “Write-Error: The following objects are still hosted by “Server Name” , even after attempting to move them off ‘n Database ‘Database Name’ Reason “Copy is critical for redundancy according to red alert”. Please explain how can i put my server into Maintenance mode and can move the databases to other servers. Secondly, does this script physically moves all the healthy copies from one server to another server and later makes them active? can we see that there is no passive copy on the server where we executed the Start script and later does .\StopDagServerMaintenance.ps1 brings back those copies to server?

  19. Toto

    Hi

    Thanks for the really good “How-To”!
    One question:
    We have 2 MBS in a DAG, and one CAS. Which way is better to run the Update, first de CAS or first the MBS in the DAG?

    Thanks,
    toto

    1. Paul Cunningham

      For Exchange 2010 always update the CAS first, starting with the internet-facing site if you have multiple sites.

  20. Jay

    Hi,

    I’m about to embark on a service pack upgrade on our servers due to an ongoing issue (MS won’t proceed with the case until we get he upgrade completed). Our servers are in a DAG setup but during the update I don’t want to switch over the Active DB copy to another DAG member, we have agreed downtime for the upgrade. What is the best way of ensuring the databases don’t switchover?

    Thanks

      1. Jay

        Thanks. The updates installed fine. The only issue we have seen after the upgrades relates to moving mailboxes to other servers, and also recovering mailboxes from a recovery DB. The jobs sit at 0% and the only way I’ve managed to get them to complete is to change the “DataMoveReplicationConstrataint” setting to None instead of SecondCopy, and restart the MS Exchange Replication service. The jobs then complete, and then change the setting back after the move completes.

  21. Dave

    Hey guys..but if you only have one copy of that database I believe the (red script) error can be ignored…

    correct me if im wrong..

  22. Zahoor Rather

    Below are my version details:
    IS there any other way to chack if i ahve any SP installed on this boxe.?

    Name : SAJDHQEX01
    Edition : Enterprise
    AdminDisplayVersion : Version 14.3 (Build 123.4)
    ServerRole : Mailbox, ClientAccess, HubTransport
    Site : nbk.com.sa/Configuration/Sites/SAUDI-Main-Site

    Name : SAJDDREX01
    Edition : Enterprise
    AdminDisplayVersion : Version 14.3 (Build 123.4)
    ServerRole : Mailbox, ClientAccess, HubTransport
    Site : nbk.com.sa/Configuration/Sites/DRSiteAlAndalus

    Below is the status of the Dbs at the moment when the DR server is in maintenence mode.:
    [PS] C:\>Get-DatabaseAvailabilityGroup -status

    Name Member Servers Operational Servers
    —- ————– ——————-
    SAEXDAG1 {SAJDDREX01, SAJDHQEX01} {SAJDDREX01, SAJDHQEX01}

    [PS] C:\>Get-MailboxDatabase

    Name Server Recovery ReplicationType
    —- —— ——– —————
    NBKSTAFF SAJDHQEX01 False Remote
    ITD SAJDHQEX01 False Remote
    SManager SAJDHQEX01 False Remote
    DREXDB SAJDHQEX01 False Remote

    thanks.

  23. Zahoor Rather

    ExchangeVersion : 0.10 (14.0.100.0)

    I run the Exchange Mang. Shell in run as Admin and run the script again, i got the below message.

    [PS] C:\>cd $exscripts
    [PS] C:Program FilesMicrosoftExchange ServerV14scripts>.StartDagServerMaintenance.ps1 -serverName SAJDDREX01
    The following objects are hosted by ‘SAJDDREX01′, before attempting to move them off: `n(Database=’NBKSTAFF’, Reason=’Co
    py is critical for redundancy according to Red Alert script’) (Database=’ITD’, Reason=’Copy is critical for redundancy a
    ccording to Red Alert script’) (Database=’SManager’, Reason=’Copy is critical for redundancy according to Red Alert scri
    pt’) (Database=’DREXDB’, Reason=’Copy is critical for redundancy according to Red Alert script’))
    [PS] C:Program FilesMicrosoftExchange ServerV14scripts>

    1. Paul Cunningham

      “critical for redundancy” usually means only one copy (or one healthy copy of the database. If there is only one healthy copy of the database then the script can’t switchover to another copy.

      It looks to me like you’re running Exchange 2010 RTM (ie no service packs) and I don’t remember if there are any bugs or caveats with the maintenance scripts when used with that version.

      But firstly you should look into those databases because it seems they may not be healthy.

      1. Claudiu

        Modify [UInt32] $AtLeastNCopies = in $exscriptsCheckDatabaseRedundancy.ps1

  24. Zahoor Rather

    i got the below error after executing the script. I am applying Windows patches only this time.

    [PS] C:Program FilesMicrosoftExchange ServerV14scripts>.StartDagServerMaintenance.ps1 -serverName SAJDDREX01
    WARNING: [07:51:38.612 UTC] Call-ClusterExe: cluster.exe did not succeed, but 5 was not a retry-able error code. Not
    attempting any other servers. This may be an expected error by the caller.
    WARNING: The Resume operation won’t have an effect on database replication because database ‘DREXDB’ hosted on server
    ‘SAJDDREX01’ is the active mailbox database.
    Log-Error : [07:51:38.628 UTC] Start-DagServerMaintenance: Failed to suspend the server SAJDDREX01 from hosting the Pri
    mary Active Manager, returned 5.
    At C:Program FilesMicrosoftExchange ServerV14scriptsStartDagServerMaintenance.ps1:170 char:14
    + Log-Error <<<< ($StartDagServerMaintenance_LocalizedStrings.res_0004 -f $serverName,$LastExitCode,"S
    tart-DagServerMaintenance") -stop
    + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Log-Error

    IS this normal
    ExchangeVersion : 0.10 (14.0.100.0)

  25. ZAHOOR RATHER

    thanks.
    Just like to add here that once I have tested the DAG.But that time both the servers are up and running. only the Databases were active on DR site Exchange server. and emails were going through. But once the main site Exchange server was down I was not able to connect outlook to DR exchange server any more.

    my CAS array host name is point to the exchange server ip address of their respective sites.
    How can I achieve the client access to the mail boxes when the DB is active on DR site exchange group and the main site Exchange server is totally down.

    thanks.

  26. ZAHOOR RATHER

    Thanks.
    you said “Yes you will need to change the CAS namespace while you update the server.”
    What do you mean by changing the CAS namespace please.

    I use outlookhq for main site Cass array name and outlookdr for dr site Cass array name.
    all the outlook clients at main site get auto discovery with outlookhq and Is working fine so far.

    So how could I test the disaster scenario so that my users can access the emails from DR site exchange server if my main site exchange server is down. [DAG is in place ]

    Do I need to create any connectors under transport options?

    thanks.

    1. Paul Cunningham

      By CAS namespace I mean the CAS array name and the URLs for other services like OWA.

      Choose a testing window that is outside of your business hours when you can do some testing. You need to work out what happens when you switchover your databases to the DR site. I can’t see your configuration so I’m not going to try to predict exactly what will happen.

  27. Zahoor Rather

    Hi Paul If I have 2 exchange 2010 servers holding all roles setup in a DAG Each server is on different Site

    does it matter which mailbox server should be updated first;

    the one that holds the active maibox db or the one the holds the passive mailbox db

    EXserver1=cas/hub/mbx (main site) (also the main point of entry for the cassarray)
    Exserver2=cas/hub/mbx (DR Site)
    server3=no exchange just FSW server (Main Site)

    cassarray is setup but we are using a manual switching of IP via the DNS server

    Now i have to apply Microsoft Patches and might be some Exchange patches/rollups as well.

    Do i need to do any thing like running any maintenance scripts mentioned above in the article. What happens if apply Microsoft Patches on FSW server and reboot it.How the DAG memebrs will behave during the FSW server reboot.
    thanks.

    I have question about outlook client access accessing the exchange DB’s from Dr Exchange server if main site server is down.how to achieve it.

    Appreciate your efforts.

    thanks once again.
    ZAHOOR

    1. Paul Cunningham

      Yes you will need to change the CAS namespace while you update the server.

      You can do either server first, that is up to you. The server should not be hosting any active databases when you update it.

      Yes you should use the maintenance scripts.

      The DAG will stay online while the FSW is patched and rebooted, because there are still two DAG members able to form quorum.

      Your DR question is interesting. Sounds like you’ve got a two-site DAG that you’ve never actually tested running from the DR site before.

  28. Mark Adams

    Hi Paul,

    I have a question, regarding StartDagServerMaintenance.ps1 script. We have a DAG with two members, one active and one passive. Having put the active member into maintenance mode with the StartDagServerMaintenance.ps1 script run from the passive member. Everything worked as it should the passive member is now active and all the mailbox db’s are up and running. I have shut down the member thats in maintenance mode to add more memory.
    When I power up the DAG member that’s been put into maintenance mode via the StartDagServerMaintenance.ps1 script, will it still be in maintenance mode or will it try and take over to become the active member?

    Thanks,

    1. Paul Cunningham

      It will stay in maintenance mode, even after a restart, until you run the script to stop maintenance mode.

      Generally speaking think of your DAG members as equal partners. The activation preference for database copies is not something that the DAG actively seeks to maintain, it is used only as one of many factors in best copy selection (during a failover) or when running the script to rebalance the DAG. So at no time will a DAG member suddenly seize back a database from another healthy DAG member.

  29. Wayne

    Hi Paul

    I’d like to know what to do with my Public Folders whilst pacthing i’m using the scripts great, but should i just forget about them or is there something I need to be doing during whilst using the maintenance scripts? Thanks

  30. gReGsKi

    I would like to know how many Exchange admins [ahem] server admins actually follow these steps when they patch, we have a lab where we just patch Server A in a two multi role server DAG reboot it, then patch Server B and reboot it, then balance out the databasees evenly among them and call it an evening, no problems so far

    to be fair we didn’t go to Exchange 2010 until SP3 so maybe things are more better with SP 3 but we don’t bother with any of the procedures above and use Exchanges built in intelligence

  31. Emanuele

    Many thanks!
    It’s ok for Exchange 2010 SP3 RU 1 🙂

  32. Dave

    Thanks paul…as aways you’ve been a great help….

  33. Dave

    Hi Paul If I have 2 exchagne servers holding all roles setup in a dag

    does it matter which mailbox server should be updated first;

    the one that holds the active maibox db or the one the holds the passive mailbox db

    server1=cas/hub/mbx (active) (also the main point of entry for the casarray)
    server2=cas/hub/mbx (passive)
    server3=no exchange just FSW server

    casarray is setup but we are using a manual switching of IP via the DNS server

    thanks

    Dave

    1. Paul Cunningham

      There is no order in a DAG because there is no “active server” or “passive server”. There is only servers that host either active or passive database copies.

      So the answer is that when updating a DAG member you should make sure it is only hosting passive database copies at the time, which is part of the process demonstrated above.

      In your case, given the extra factor of how you are handling the CAS Array, I would do server 2 first, then cut everything over from server 1 -> server 2, then update server 1.

  34. Kanta Prasad

    Super Like Paul……..

    Thanks,
    Kanta Prasad

  35. K S Kumar

    Thanks for the Excellent Article. This helped me in upgrading my exchange servers to Service Pack 3 without any downtime.

  36. David

    paul i have two server

    should I upate all servers and reboot all of them or should i update one reboot it and the update the second one

    thanks

    Dave

    1. Paul Cunningham

      Well if you do them all at once all your Exchange services will be offline/unavailable.

      One at a time means you can keep services up.

  37. Jack

    MS is pushing hard on multiple role server that combine Hub, CAS and DAG mailbox servers on the same server. What is your thought on performing upgrade on the multi-role E2010 servers?

    1. Paul Cunningham

      Thoughts? The process is basically the same. You just need to combine the preparation tasks for a CAS array member that is also a DAG member.

  38. Gregski

    i just want to do it in the GUI, lol, how do I do that

  39. Carol Ostos

    Hey Paul, we had to apply some Windows patches to our Exchange Server and so I decided to set the Exchange Mailbox Servers in Maintenance Mode, while running StartDagServerMaintenance I got the following messages

    Log Error- Failed at command ‘Move-DagActiveManager’ with ‘could not move the cluster group’
    Log Error -Move-CriticalMailboxResources: An error ocurred while moving critical resources off server ‘mailboxserver1’

    Note:
    a) We have a 2 node DAG, mailboxserver1 was hosting the active copies and mailboxserver2 was hosting the passive copies.
    b) MailboxServer1 was the PAM

    After realizing the script might have not done all the required steps, I performed the steps manually, installed the OS patches, reboot server and then used the StopDagServerMaintenance script which returned a warning

    Call-Cluster.exe did not succeed, but 5058 was not a retry-able error code, Not attempting any other servers, This may be an expected error by the caller.

    Checked the CopyAutoActivationPolicy and it got changed back to Unrestricted.

    Bottom line, I was able to perform all the operations manually, just thought share this with you guys in case there was something I should be aware of or be worried about.

    Thanks in advance.
    Carol

  40. Woter

    Excellent doco. Thank you. Having used this on Exch 2010 SP2 RU2, It appeard to me that the two-member DAG issue had come back to haunt me, however, it appears that the SP2 version doesn’t do the Suspend-DatabaseCopy as suggested above. Perhaps a reason why, is given by TIMMCMIC in the comments here:

    http://blogs.technet.com/b/timmcmic/archive/2011/07/25/exchange-2010-sp1-startdagservermaintenance-ps1-fails-when-a-server-contains-databases-with-a-single-copy.aspx?CommentPosted=true#commentmessage

    Thanks for the excellent documentation. The activation prefrence stuff was new to me. Cool.

  41. Chris

    You’re the PRO and all known guy, I enjoy it everytime …

  42. Jared

    Good Doco Paul,
    I’m about to do an upgrade to Exchange 2010 SP1 to SP2 and just looking around for some stuff on it, i’ve been told i should be weary as you cant use the maintenancemode scripts in a 2 DAG environment?

    Cheers

    1. Paul Cunningham

      I’ve used the maintenance scripts in a 2 member DAG (2 Mailbox servers + File Share Witness) before with no problems. What are the issues they warned you about?

        1. Paul Cunningham

          Read down the comments in that article and you’ll see it is (a) an issue that occurs with 2 copies of a database in a +3 member DAG, and (b) an issue that has been fixed in subsequent rollups anyway (probably why neither of us are seeing the issue today).

  43. Amit

    Hi,

    Is it possible to seprate DAG configured database on different drive. For example In Server A. DB’s on G drive there are two DB’s db1 & db2 & logs stored on H drive. Active DB’s on Server A & Passive DB’s on server B. Now I want to seprate the E drive stored db2 to another drive. Can we proceed with move database path option. Is there any impact during moving active node db1 to another drive during that process what will happen on passive node Db1.
    Is this process works,

    Any pointers ?.

    Thansk,
    Amit

      1. Amit

        Thanks… Paul for details information.

        Thanks,
        Amit

  44. Novice

    Paul,

    Thank you so much for publishing typical tutorials.

    To upgrade RAM on one of Mailbox servers (2 mailbox member servers in one DAG group), I need to shutdown the server.

    Do I need to run the Maintenance script to put the one mailbox server in mantenance mode or just switchover the active databases to second server followed by server restart?

    Any help would be greatly appreciated. Thank you again!

    1. Paul Cunningham

      Yes, this would be a good way of prepping a server to shut down for hardware maintenance like that.

      1. Novice

        Paul,

        Thanks for your reply. I know that I’m commenting on your post and not looking for an official support.

        I come to know that the built-in maintenance script will fail if the DAG contains only two members. Microsoft fixed this issue in SP2. But my Ex is currently running on SP1 with Rollup Update 5 and I’m trying to upgrade to SP2 with Rollup Update 2.

        Any alternative suggestions in putting the server down to apply SP2?

        Also, I forget to Suspend the Database on one of the Mailbox Server (to turn the server off for upgrading RAM) and moved databases to another server. After reboot and resync, the Replay Queue Length and Activation Preference numbers changed. However right databases are mounted on right servers as before. Is it going to be a critical problem?

        Thank you again!

      2. Paul Cunningham

        To prep for updates without the benefit of being able to run the script just use the RTM instructions in the article above.

  45. Marek

    Great tutorial, it has been very helpful for me during upgrading my EX2010 SP1.
    Many thanks Paul !
    🙂

    Marek

  46. yves

    Nice article.
    The chapter name where you explain StopDagServerMaintenance.ps1 is not correct it is mentioned as
    “Returning an Exchange Server 2010 RTM DAG Member to Production” but the procedure is for returning an Exchange 2010 SP1 dag member to production.

    Also in this chapter i think there should a remark about the fscutility /enable. (if you disabled it before).

  47. RDFTS

    It seems it would be better to run the StartDagServerMaintenance.ps1, do the updates, run StopDagServerMaintenance.ps1. This automatically does the block and move databases for you all in one script. Then the RedistributeActiveDatabases.ps1 script to move the databases back to the defined server.

    1. Paul Cunningham

      Correct, I just haven’t updated the article since SP1 gave us those scripts 🙂

  48. I spent a lot of time recently trying to organize a process, as well as create cookbooks for the deployment of Exchange 2010 with Windows 2008 r2 in a Hyper-V environment using separate Edge and Hub transport servers. My big problem, which was not resoved until I came upon your tutorials on ExchangeServerPro.com, was “What specific roles and features were required for the two servers. You provided not only the answer to my question but also “code copy” access that I was able to deploy in a very short period of time. I have created a copy of a manual that I will use for my engineers when deploying the solutions for my clients. It includes five (5) of your articles from the website. The manual is a work in process, as I find additional articles that address specific needs, and they will be added to the document.

    Thanks for your great work in preparing this material. I can appreciate what you have done in this endeavor and I, and I am sure many others “out there” sing your praise, as well they should.

    Best regards.

    Chris

    1. Paul Cunningham

      Hi Chris, thanks for the feedback. Glad you are finding the stuff here useful.

Leave a Reply