Book Image

Microsoft Exchange Server Powershell Cookbook (Update)

Book Image

Microsoft Exchange Server Powershell Cookbook (Update)

Overview of this book

Table of Contents (21 chapters)
Microsoft Exchange Server PowerShell Cookbook Third Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a Database Availability Group


The initial setup and configuration of a Database Availability Group is done using a single cmdlet named New-DatabaseAvailabilityGroup. In this recipe, we'll take a look at how you can automate the creation of a DAG using the Exchange Management Shell.

How to do it...

To create a DAG, use the New-DatabaseAvailabilityGroup cmdlet:

New-DatabaseAvailabilityGroup -Name DAG '
-WitnessServer CAS1 '
-WitnessDirectory C:\FSW '
-DatabaseAvailabilityGroupIPAddresses 192.168.1.55

The previous command creates a new Database Availability Group named DAG. The file share witness server is set to a Client Access server named CAS1, and the path for the directory is also specified, along with an IP address that will be used only by the DAG cluster resources.

How it works...

When you run the New-DatabaseAvailabilityGroup cmdlet, the only requirement is that you use a unique name for the DAG. In the previous example, we specified the information for the file share witness...