In Exchange, creating a DAG using the GUI is very easy, you fill in your DAG name, Witness Server and Witness Directory and optional to enter an IP address, let’s look at how to do this using Powershell in Exchange 2019.

Exchange should create the witness folder for you but in my Lab I only have a domain controller so will manually create it. You need to give the Exchange Trusted Subsystem rights to it and as this is a DC there is no local groups.

Exchange 2019 - create a new mailbox with powershell
Exchange 2019 - create a new mailbox with powershell

Now launch the Exchange Management Shell (EMS) and run the following command:

  • New-DatabaseAvailabilityGroup -Name GroupName -WitnessServer “Server” -WitnessDirectory C:\EXDAG
Exchange 2019 - create a new mailbox with powershell

Wait for a couple of seconds and it should create the DAG for you. Once done you can check the properties of the DAG as shown below and using the PowerShell command:

  • Get-DatabaseAvailabilityGroup -Identity DAGName | fl
Exchange 2019 - create a new mailbox with powershell

Next step is to add member servers to the newly created DAG you created, to do so you can run the following command:

  • Add-DatabaseAvailabilityGroupServer -Identity DAGName -MailboxServer ServerName
Exchange 2019 - create a new mailbox with powershell

This will install Windows Failover Clustering on your Exchange server/s. Can take a while.

Hope it helps.

    wpChatIcon

    Discover more from Everything-PowerShell

    Subscribe now to keep reading and get access to the full archive.

    Continue reading