{"id":107527,"date":"2022-08-23T05:42:10","date_gmt":"2022-08-23T05:42:10","guid":{"rendered":"https:\/\/www.stellarinfo.com\/blog\/?p=107527"},"modified":"2024-05-28T10:46:50","modified_gmt":"2024-05-28T10:46:50","slug":"using-set-databaseavailabilitygroup-cmdlet-exchange-powershell","status":"publish","type":"post","link":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/","title":{"rendered":"How to Use Set-DatabaseAvailabilityGroup Cmdlet?"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><?xml encoding=\"utf-8\" ?><p><strong>Set-DatabaseAvailabilityGroup<\/strong> is a PowerShell cmdlet used to make changes to the Database Availability Group (DAG) that can&rsquo;t be done or performed via Exchange Admin Center (EAC) or Exchange Management Console (EMC). For instance, selecting\/changing the TCP port, changing Witness Server and Witness Directory, disabling cross-site RPC client access, configuring network discovery, enabling Datacenter Activation Coordination or DAC mode, etc.<\/p><p>This article discusses how to use the Set-DatabaseAvailabilityGroup cmdlet with various switches and parameters to manage the DAG.<\/p><h2 class=\"wp-block-heading\" id=\"steps-to-use-set-databaseavailabilitygroup-cmdlet\"><strong>Steps to Use Set-DatabaseAvailabilityGroup Cmdlet<\/strong><\/h2><p>Follow the steps discussed below to learn how to use the Set-DatabaseAvailabilityGroup cmdlet in Exchange Server 2010, 2013, 2016, and 2019.<\/p><h3 class=\"wp-block-heading\" id=\"h-step-1-assign-roles-and-permissions\"><strong>Step 1: Assign Roles and Permissions<\/strong><\/h3><p>To use <strong>Set-DatabaseAvailabilityGroup<\/strong> for managing, configuring, or updating the DAG cluster, you must have the required roles and permissions assigned to your username or account. In addition, you must have the &lsquo;<strong>Database Availability Groups<\/strong>&lsquo; role assigned to your user account. To assign this role via Exchange Admin Center, follow these steps:<\/p><ul class=\"wp-block-list\">\n<li>Open <strong>EAC<\/strong> and go to <strong>permissions &gt; admin roles<\/strong>.<\/li>\n\n\n\n<li>Double-click on the&rsquo;<strong>Organization Management<\/strong>&lsquo; and assign the &lsquo;<strong>Database Availability Groups<\/strong>&lsquo; role to the required user or your account.<\/li>\n<\/ul><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"541\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-in-exchange-admin-center-1024x541.png\" alt=\"grant database availability groups permissions roles in exchange admin center\" class=\"wp-image-107529 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-in-exchange-admin-center-1024x541.png 1024w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-in-exchange-admin-center-300x159.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-in-exchange-admin-center-768x406.png 768w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-in-exchange-admin-center.png 1184w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><ul class=\"wp-block-list\">\n<li>After assigning the role, restart the <strong>Microsoft Exchange Information Store<\/strong> Service.<\/li>\n<\/ul><p>You may also assign the &lsquo;<strong>Database Availability Groups<\/strong>&lsquo; role by using the following PowerShell cmdlet in Exchange Management Shell (EMS) as administrator.<\/p><pre class=\"wp-block-code command_container\"><code>New-ManagementRoleAssignment -Role \"Database Availability Groups\" -User administrator<\/code><\/pre><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"233\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-using-PoweRShell-cmdlets-1024x233.png\" alt=\"grant database availability groups permissions roles using PoweRShell cmdlets\" class=\"wp-image-107530 apply-gradient-on-post-images\" srcset=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-using-PoweRShell-cmdlets-1024x233.png 1024w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-using-PoweRShell-cmdlets-300x68.png 300w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-using-PoweRShell-cmdlets-768x175.png 768w, https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/grant-database-availability-groups-permissions-roles-using-PoweRShell-cmdlets.png 1190w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><p>This command will assign the required<strong> &lsquo;Database Availability Groups&rsquo; <\/strong>role to the user &lsquo;<strong>administrator<\/strong>.&rsquo;<\/p><h3 class=\"wp-block-heading\" id=\"h-step-2-set-databaseavailabilitygroup-syntax\"><strong>Step 2: Set-DatabaseAvailabilityGroup Syntax<\/strong><\/h3><p>Before using the Set-DatabaseAvailabilityGroup cmdlet, you must know the right syntax to avoid errors.<\/p><p><strong>Set-DatabaseAvailabilityGroup -Identity &lt;DatabaseAvailabilityGroupIdParameter&gt;<\/strong><\/p><ul class=\"wp-block-list\">\n<li>[-AllowCrossSiteRpcClientAccess &lt;SwitchParameter&gt;]<\/li>\n\n\n\n<li>[-WitnessDirectory &lt;NonRootLocalLongFullPath&gt;]<\/li>\n\n\n\n<li>[-WitnessServer &lt;FileShareWitnessServerName&gt;]<\/li>\n\n\n\n<li>[-AlternateWitnessDirectory &lt;NonRootLocalLongFullPath&gt;]<\/li>\n\n\n\n<li>[-AlternateWitnessServer &lt;FileShareWitnessServerName&gt;]<\/li>\n\n\n\n<li>[-DatabaseAvailabilityGroupIpAddresses &lt;IPAddress[]&gt;]<\/li>\n\n\n\n<li>[-DatacenterActivationMode &lt;Off | DagOnly&gt;]<\/li>\n\n\n\n<li>[-DiscoverNetworks &lt;SwitchParameter&gt;]<\/li>\n\n\n\n<li>[-DomainController &lt;Fqdn&gt;]<\/li>\n\n\n\n<li>[-NetworkCompression &lt;Disabled | Enabled | InterSubnetOnly | SeedOnly&gt;]<\/li>\n\n\n\n<li>[-NetworkEncryption &lt;Disabled | Enabled | InterSubnetOnly | SeedOnly&gt;]<\/li>\n\n\n\n<li>[-ReplicationPort &lt;UInt16&gt;]<\/li>\n\n\n\n<li>[-WitnessDirectory &lt;NonRootLocalLongFullPath&gt;]<\/li>\n\n\n\n<li>[-WitnessServer &lt;FileShareWitnessServerName&gt;]<\/li>\n<\/ul><h3 class=\"wp-block-heading\" id=\"h-step-3-use-the-set-databaseavailabilitygroup-cmdlet\"><strong>Step 3: Use the Set-DatabaseAvailabilityGroup Cmdlet<\/strong><\/h3><p>Below, we have discussed the Set-DatabaseAvailabilityGroup cmdlets to perform the following operations in a Database Availability Group.<\/p><h4 class=\"wp-block-heading\" id=\"h-set-witness-server-and-witness-directory\"><strong>Set Witness Server and Witness Directory<\/strong><\/h4><p>To set Witness Server and Directory for DAG, you can use the <strong>-WitnessServer<\/strong> and <strong>&ndash;WitnessDirectory<\/strong> parameters. The command is as follows:<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity &lt;DatabaseAvailabilityGroupIdParameter&gt; -WitnessServer &lt;FileShareWitnessServerName&gt; -WitnessDirectory &lt;NonRootLocalLongFullPath&gt;<\/code><\/pre><p>For instance,<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity \"DAG01\" -WitnessServer WS3 -WitnessDirectory &ldquo;C:\\DAG01DIR&rdquo;<\/code><\/pre><p>The command sets Witness Server <strong>WS3 <\/strong>and Witness Directory <strong>C:\\DAG01DIR <\/strong>for DAG <strong>DAG01<\/strong>. Before executing, make sure to change the path and the DAG name in the command.<\/p><h4 class=\"wp-block-heading\" id=\"h-set-or-change-witness-directory\"><strong>Set or Change Witness Directory<\/strong><\/h4><p>To set or change only the Witness Directory for DAG, you can use the <strong>-WitnessDirectory <\/strong>parameter.<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity &lt;DatabaseAvailabilityGroupIdParameter&gt;] -WitnessDirectory &lt;NonRootLocalLongFullPath&gt;<\/code><\/pre><p>For instance,<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup &ndash;Identity \"DAG01\" -WitnessDirectory \"C:\\DAG01DIR\"<\/code><\/pre><p>The command sets Witness Directory <strong>C:\\DAG01DIR<\/strong> for DAG <strong>DAG01<\/strong>. Before executing, make sure to change the path and the DAG name in the command.<\/p><h4 class=\"wp-block-heading\" id=\"h-set-alternate-witness-directory-and-server\"><strong>Set Alternate Witness Directory and Server<\/strong><\/h4><p>Sometimes when Witness Server fails, you need to set an alternate Witness Server and Directory to maintain Quorum and ensure high availability. In such cases, you can use the &ndash;<strong>AlternateWitnessDirectory<\/strong> and <strong>&ndash;AlternateWitnessServer<\/strong> parameters. The command is as follows:<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity &lt;DatabaseAvailabilityGroupIdParameter&gt; -AlternateWitnessDirectory &lt;NonRootLocalLongFullPath&gt; -AlternateWitnessServer &lt;FileShareWitnessServerName&gt;<\/code><\/pre><p>For instance,<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity DAG01 -AlternateWitnessDirectory C:\\DAG02DIR -AlternateWitnessServer WS4<\/code><\/pre><p>The command sets <strong>WS4<\/strong> and <strong>C:\\DAG02DIR <\/strong>as alternate Witness Server and Witness Directory respectively for the DAG <strong>DAG01<\/strong>.<\/p><h4 class=\"wp-block-heading\" id=\"h-configure-dag-to-use-dhcp-for-obtaining-ip-address\"><strong>Configure DAG to Use DHCP for Obtaining IP Address<\/strong><\/h4><p>Since member servers can be resolved by their names, you can setup and configure the member servers in a DAG to obtain the IP addresses automatically. To do this, use the <strong>&ndash;DatabaseAvailabilityGroupIpAddresses<\/strong> parameter. The syntax is as follows:<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity &lt;DatabaseAvailabilityGroupIdParameter&gt; -DatabaseAvailabilityGroupIpAddresses &lt;IPAddress[]&gt;<\/code><\/pre><p>For instance,<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity DAG01 -DatabaseAvailabilityGroupIpAddresses 0.0.0.0<\/code><\/pre><p>This configures the DAG DAG01 to obtain the IP addresses automatically from the network adapter or router.<\/p><h4 class=\"wp-block-heading\" id=\"h-assign-static-ip-to-dag-members\"><strong>Assign Static IP to DAG Members<\/strong><\/h4><p>Although assigning static IP isn&rsquo;t a requirement as long as the name can resolve the DAG member servers, you can assign static IP to each DAG member if needed or based on your organization&rsquo;s preferences using the <strong>-DatabaseAvailabilityGroupIpAddresses<\/strong> parameter.<\/p><p>The command is as follows:<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity DAG01 -DatabaseAvailabilityGroupIpAddresses 192.168.0.8<\/code><\/pre><p>The above command sets Static IP 10.0.0.8 to the DAG DAG01. In addition, you can also configure DAG DAG01 with multiple Static IP addresses using the following command.&nbsp;<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity DAG01 -DatabaseAvailabilityGroupIpAddresses 192.168.0.8,192.168.1.8<\/code><\/pre><h4 class=\"wp-block-heading\" id=\"h-configure-the-tcp-port-for-replication\"><strong>Configure the TCP Port for Replication<\/strong><\/h4><p>By default, all DAG members use the 64327 port for continuous replication. However, you can always modify the port to a different TCP port by using the <strong>-ReplicationPort<\/strong> parameter.<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity &lt;DatabaseAvailabilityGroupIdParameter&gt; -ReplicationPort &lt;UInt16&gt;<\/code><\/pre><p>For instance,<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity DAG01 -ReplicationPort 32400<\/code><\/pre><p>The command sets the TCP port to 32400. You can change it to any open or available port.<\/p><h4 class=\"wp-block-heading\" id=\"h-enable-or-disable-dac-mode\"><strong>Enable or Disable DAC Mode<\/strong><\/h4><p>Database Activation Coordination (DAC) mode is a DAG feature&mdash;disabled by default &mdash;that controls the database mount behavior on the DAG startup. It avoids <a href=\"https:\/\/en.wikipedia.org\/wiki\/Split-brain_(computing)\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"><strong>split-brain<\/strong><\/a> situations (inconsistencies) that may activate two copies on two member servers on the same DAG.<\/p><p>You should enable DAC mode for DAG with two or more members using continuous replication. However, avoid enabling the DAC mode for your DAG infrastructure if you use a third-party replication mode. The parameter used to enable or disable DAC mode is <strong>&ndash;DatacenterActivationMode<\/strong>.<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity &lt;DatabaseAvailabilityGroupIdParameter&gt; -DatacenterActivationMode &lt;DatacenterActivationModeOption&gt;<\/code><\/pre><p>For instance,<\/p><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity DAG01 -DatacenterActivationMode DagOnly<\/code><\/pre><pre class=\"wp-block-code command_container\"><code>Set-DatabaseAvailabilityGroup -Identity DAG01 -DatacenterActivationMode off<\/code><\/pre><p>The former command enables the DAC mode while the latter turns off the DAC mode for DAG <strong>DAG01<\/strong>.<\/p><h2 class=\"wp-block-heading\" id=\"other-set-databaseavailabilitygroup-switches-and-parameters\"><strong>Other Set-DatabaseAvailabilityGroup Switches and Parameters<\/strong><\/h2><p>We have already covered the most common and important parameters that you need to know when it comes to using the Set-DatabaseAvailabilityGroup cmdlet.<\/p><p>In addition, there are several other parameters and switches that you can use with the Set-DatabaseAvailabilityGroup cmdlet. However, many of them are reserved for internal Microsoft use while others may require additional permissions to run. To learn more, you can refer to this <a href=\"https:\/\/docs.microsoft.com\/en-us\/powershell\/module\/exchange\/set-databaseavailabilitygroup?view=exchange-ps\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Microsoft Documentation. <\/a>&nbsp;<\/p><div class=\"note-alert\">\n        <div class=\"tips_container\">\n            <img decoding=\"async\" src=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2024\/05\/tips-con.png\" class=\"img-fluid apply-gradient-on-post-images\" alt=\"tips\">\n            <div class=\"tips_content ml-3\">\n                <span class=\"f700 fmont\">Tips &ndash; <\/span>If you encounter issues with your DAG member server, use <a href=\"https:\/\/www.stellarinfo.com\/article\/use-restore-databaseavailabilitygroup-cmdlet.php\">Restore-DatabaseAvailabilityGroup<\/a> to activate a DAG member server in a cluster when it goes down after Quorum is lost.\n            <\/div>\n        <\/div>\n    <\/div><h2 class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2><p>If the <em>Set-DatabaseAvailabilityGroup<\/em> cmdlet fails to configure or change the Witness Server or Witness Directory, the Quorum will no longer be maintained and may be lost. This may damage the Database Availability Group and cause inconsistencies in the member server or database. In such a case, you must set up a new DAG infrastructure and add the servers to the new DAG. You can then restore the database and mailboxes from backup or use a third-party&nbsp;<a href=\"https:\/\/www.stellarinfo.com\/edb-exchange-server-recovery.htm\">Exchange recovery software<\/a>, such as Stellar Repair for Exchange, to move the mailboxes from the old DAG member servers to new ones. The software can help extract the mailboxes and items from the database on the failed Exchange DAG member servers to PST files. You may also directly export the mailboxes recovered from the database to a new live Exchange member server or Office 365.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Set-DatabaseAvailabilityGroup is a PowerShell cmdlet used to make changes to the Database&hellip; <a class=\"more-link\" href=\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/\">Continue reading <span class=\"screen-reader-text\">How to Use Set-DatabaseAvailabilityGroup Cmdlet?<\/span><\/a><\/p>\n","protected":false},"author":32,"featured_media":107528,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[],"class_list":["post-107527","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-exchange-server","entry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Use Set-DatabaseAvailabilityGroup Cmdlet?<\/title>\n<meta name=\"description\" content=\"Learn how to use the Set-DatabaseAvailabilityGroup cmdlet to manage the DAG and switch or change Witness Server and Witness Directory.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Set-DatabaseAvailabilityGroup Cmdlet?\" \/>\n<meta property=\"og:description\" content=\"Learn how to use the Set-DatabaseAvailabilityGroup cmdlet to manage the DAG and switch or change Witness Server and Witness Directory.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Stellar Data Recovery Blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/raavisingh\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-23T05:42:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-28T10:46:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ravi Singh\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/ravi51ngh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ravi Singh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/\"},\"author\":{\"name\":\"Ravi Singh\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/7dea10d15c0307370e21d7da07d0cd11\"},\"headline\":\"How to Use Set-DatabaseAvailabilityGroup Cmdlet?\",\"datePublished\":\"2022-08-23T05:42:10+00:00\",\"dateModified\":\"2024-05-28T10:46:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/\"},\"wordCount\":1071,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg\",\"articleSection\":[\"Exchange Server Recovery\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/\",\"url\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/\",\"name\":\"How to Use Set-DatabaseAvailabilityGroup Cmdlet?\",\"isPartOf\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg\",\"datePublished\":\"2022-08-23T05:42:10+00:00\",\"dateModified\":\"2024-05-28T10:46:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/7dea10d15c0307370e21d7da07d0cd11\"},\"description\":\"Learn how to use the Set-DatabaseAvailabilityGroup cmdlet to manage the DAG and switch or change Witness Server and Witness Directory.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#primaryimage\",\"url\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg\",\"contentUrl\":\"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg\",\"width\":1000,\"height\":600,\"caption\":\"How to Use Set-DatabaseAvailabilityGroup Cmdlet?\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.stellarinfo.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Set-DatabaseAvailabilityGroup Cmdlet?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#website\",\"url\":\"https:\/\/www.stellarinfo.com\/blog\/\",\"name\":\"Stellar Data Recovery Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.stellarinfo.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/7dea10d15c0307370e21d7da07d0cd11\",\"name\":\"Ravi Singh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9e95cad83fe279b559794f62193f34300d01db8f9f2ec45ce529b7ecde3796ba?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9e95cad83fe279b559794f62193f34300d01db8f9f2ec45ce529b7ecde3796ba?s=96&d=mm&r=g\",\"caption\":\"Ravi Singh\"},\"description\":\"Ravi Singh is a Senior Writer at Stellar\u00ae. He is an expert Tech Explainer, IoT enthusiast, and a passionate nerd with over 7 years of experience in technical writing. He writes about Microsoft Exchange, Microsoft 365, Email Migration, Linux, Windows, Mac, DIY Tech, and Smart Home. Ravi spends most of his weekends working with IoT (DIY Smart Home) devices and playing Overwatch. He is also a solo traveler who loves hiking and exploring new trails.\",\"sameAs\":[\"https:\/\/stellarinfo.com\/blog\",\"https:\/\/facebook.com\/raavisingh\",\"https:\/\/instagram.com\/ravi.s1ngh\",\"https:\/\/linkedin.com\/in\/ravi-singh-5a65356a\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/ravi51ngh\",\"https:\/\/youtube.com\/ravisingh9\"],\"url\":\"https:\/\/www.stellarinfo.com\/blog\/author\/ravi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use Set-DatabaseAvailabilityGroup Cmdlet?","description":"Learn how to use the Set-DatabaseAvailabilityGroup cmdlet to manage the DAG and switch or change Witness Server and Witness Directory.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Set-DatabaseAvailabilityGroup Cmdlet?","og_description":"Learn how to use the Set-DatabaseAvailabilityGroup cmdlet to manage the DAG and switch or change Witness Server and Witness Directory.","og_url":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/","og_site_name":"Stellar Data Recovery Blog","article_author":"https:\/\/facebook.com\/raavisingh","article_published_time":"2022-08-23T05:42:10+00:00","article_modified_time":"2024-05-28T10:46:50+00:00","og_image":[{"width":1000,"height":600,"url":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg","type":"image\/jpeg"}],"author":"Ravi Singh","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/ravi51ngh","twitter_misc":{"Written by":"Ravi Singh","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#article","isPartOf":{"@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/"},"author":{"name":"Ravi Singh","@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/7dea10d15c0307370e21d7da07d0cd11"},"headline":"How to Use Set-DatabaseAvailabilityGroup Cmdlet?","datePublished":"2022-08-23T05:42:10+00:00","dateModified":"2024-05-28T10:46:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/"},"wordCount":1071,"commentCount":0,"image":{"@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg","articleSection":["Exchange Server Recovery"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/","url":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/","name":"How to Use Set-DatabaseAvailabilityGroup Cmdlet?","isPartOf":{"@id":"https:\/\/www.stellarinfo.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#primaryimage"},"image":{"@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#primaryimage"},"thumbnailUrl":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg","datePublished":"2022-08-23T05:42:10+00:00","dateModified":"2024-05-28T10:46:50+00:00","author":{"@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/7dea10d15c0307370e21d7da07d0cd11"},"description":"Learn how to use the Set-DatabaseAvailabilityGroup cmdlet to manage the DAG and switch or change Witness Server and Witness Directory.","breadcrumb":{"@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#primaryimage","url":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg","contentUrl":"https:\/\/www.stellarinfo.com\/blog\/wp-content\/uploads\/2022\/08\/How-to-use-set-databaseavailabilitygroup-cmdlet.jpg","width":1000,"height":600,"caption":"How to Use Set-DatabaseAvailabilityGroup Cmdlet?"},{"@type":"BreadcrumbList","@id":"https:\/\/www.stellarinfo.com\/blog\/using-set-databaseavailabilitygroup-cmdlet-exchange-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.stellarinfo.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Use Set-DatabaseAvailabilityGroup Cmdlet?"}]},{"@type":"WebSite","@id":"https:\/\/www.stellarinfo.com\/blog\/#website","url":"https:\/\/www.stellarinfo.com\/blog\/","name":"Stellar Data Recovery Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.stellarinfo.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/7dea10d15c0307370e21d7da07d0cd11","name":"Ravi Singh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.stellarinfo.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9e95cad83fe279b559794f62193f34300d01db8f9f2ec45ce529b7ecde3796ba?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9e95cad83fe279b559794f62193f34300d01db8f9f2ec45ce529b7ecde3796ba?s=96&d=mm&r=g","caption":"Ravi Singh"},"description":"Ravi Singh is a Senior Writer at Stellar\u00ae. He is an expert Tech Explainer, IoT enthusiast, and a passionate nerd with over 7 years of experience in technical writing. He writes about Microsoft Exchange, Microsoft 365, Email Migration, Linux, Windows, Mac, DIY Tech, and Smart Home. Ravi spends most of his weekends working with IoT (DIY Smart Home) devices and playing Overwatch. He is also a solo traveler who loves hiking and exploring new trails.","sameAs":["https:\/\/stellarinfo.com\/blog","https:\/\/facebook.com\/raavisingh","https:\/\/instagram.com\/ravi.s1ngh","https:\/\/linkedin.com\/in\/ravi-singh-5a65356a\/","https:\/\/x.com\/https:\/\/twitter.com\/ravi51ngh","https:\/\/youtube.com\/ravisingh9"],"url":"https:\/\/www.stellarinfo.com\/blog\/author\/ravi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts\/107527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/comments?post=107527"}],"version-history":[{"count":9,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts\/107527\/revisions"}],"predecessor-version":[{"id":168048,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/posts\/107527\/revisions\/168048"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/media\/107528"}],"wp:attachment":[{"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/media?parent=107527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/categories?post=107527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stellarinfo.com\/blog\/wp-json\/wp\/v2\/tags?post=107527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}