{"id":542,"date":"2012-03-25T16:03:20","date_gmt":"2012-03-25T16:03:20","guid":{"rendered":"https:\/\/pipe2text.com\/?page_id=542"},"modified":"2012-03-25T16:15:35","modified_gmt":"2012-03-25T16:15:35","slug":"configuring-your-adfs-2-0-farm-to-use-a-sql-mirror","status":"publish","type":"page","link":"https:\/\/pipe2text.com\/?page_id=542","title":{"rendered":"Configuring your ADFS 2.0 Farm to use a SQL Mirror"},"content":{"rendered":"<p>Hi All,<\/p>\n<p>In this blog I will discuss the steps taken to make an ADFS Server which is using SQL as its configuration database to be mirror aware. Mirroring your database can help in making your ADFS Server Farm more redundant in the event of a server outage. In order to compete the steps in this blog, you will need to have and ADFS 2.0 server which is using SQL for it&#8217;s configuration database and a mirrored copy of the database will need to be created on\u00a0a second SQL server. Creating the actual SQL mirrored copy is out of the scope of this blog. For information about creating an ADFS Server to use SQL as it&#8217;s configuration database please see <a title=\"Configuring ADFS Server as the First server in the ADFS Farm using SQL for the Conguration Database\" href=\"https:\/\/pipe2text.com\/?page_id=319\">Configuring ADFS Server as the First server in the ADFS Farm using SQL for the Configuration Database<\/a>.<\/p>\n<p style=\"text-align: left;\">1. Create a mirror copy of the ADFS Configuration and Artifact Database on a second SQL server.<\/p>\n<p style=\"text-align: left;\">2. Make sure your ADFS Service Account has the proper permissions to the mirrored database the same as it does for the master copy.<\/p>\n<p style=\"text-align: left;\">3. Now you will need to configure the ADFS Server to use the failover configuration database by following these steps:<\/p>\n<p>Please Note: You will need to complete the following steps on all ADFS servers in the farm.<\/p>\n<p style=\"text-align: left;\">a. Logon to your ADFS Server and open PowerShell as Administrator.<\/p>\n<p style=\"text-align: left;\">b. Stop the ADFS Server from the by typing &#8220;net stop adfssrv&#8221;.<\/p>\n<p style=\"text-align: left;\">c. Now run the following 3 PowerShell commands replacing <em>OriginalSqlServerName<\/em> with the name of your original SQL instance and replace <em>MirrorSQLServerName<\/em> with the name SQL instance that has the mirrored copy:<\/p>\n<p>$temp= Get-WMIObject -namespace root\/ADFS -class SecurityTokenService<\/p>\n<p>$temp.ConfigurationdatabaseConnectionstring=\u201dData Source=<em>OriginalSqlServerName<\/em>; Failover Partner=<em>MirrorSQLServerName<\/em>;Initial Catalog=AdfsConfiguration;Integrated Security=true\u201d<\/p>\n<p>$temp.put()<\/p>\n<p>d. Now you can start the ADFS service back up by typing &#8220;net start adfssrv&#8221;.<\/p>\n<p>e. To verify the new setting you can run the following PowerShell command:<\/p>\n<p>Get-WmiObject -namespace root\/adfs -class securitytokenservice<\/p>\n<p>You will see the \u201cConfigurationdatabaseConnectionstring\u201d property\u00a0has been\u00a0updated to include the failover SQL Server instance.<\/p>\n<p>4. Next step will be to configure the ADFS Farm\u00a0so the\u00a0Artifact Resolution database\u00a0can use the mirrored copy for failover following the steps below:<\/p>\n<p>Please Note: This will only need to be run on one server in the ADFS Server Farm but the ADFS service will need to be restarted on all ADFS Servers in the farm after it is run.<\/p>\n<p>a. Logon to your ADFS Server and open PowerShell as Administrator and\u00a0run the following 2 PowerShell\u00a0commands replacing <em>OriginalSqlServerName<\/em> with the name of your original SQL instance and replace <em>MirrorSQLServerName<\/em> with the name SQL instance that has the mirrored copy:<\/p>\n<p>Add-PSSnapin Microsoft.ADFS.Powershell<\/p>\n<p>Set-adfsproperties \u2013artifactdbconnection \u201dData Source=<em>OriginalSqlServerName<\/em>; Failover Partner=<em>MirrorSQLServerName<\/em>;Initial Catalog=AdfsArtifactStore;Integrated Security=true\u201d<\/p>\n<p>After running the commands above you will receive the following warning:<\/p>\n<p>\u201cWARNING: PS0038: This action requires a restart of the AD FS 2.0 Windows Service. If you have deployed a federation server farm, restart the service on every server in the farm.\u201d<\/p>\n<p>b. Restart the ADFS Service on every server in the farm.<\/p>\n<p>c. To verify the new setting you can run the following PowerShell command from any server in the farm:<\/p>\n<p>Get-ADFSProperties<\/p>\n<p>You will notice the \u201cArtifactDBConn\u201d property has been updated with the failover SQL Server instance.<\/p>\n<p>At this point you are done. Now you can test by shutting down the master copy of the database and testing your farm. You can also review the ADFS event viewer logs for failover events.\u00a0As always I recommend testing all of this\u00a0in a lab scenario first. If you have any questions or feedback, please feel free to\u00a0leave a comment. I hope this helps.<\/p>\n<p>Related Links:<\/p>\n<p><a title=\"Installing Active Directory Federation Services (ADFS) 2.0\" href=\"https:\/\/pipe2text.com\/?page_id=285\">Installing Active Directory Federation Services (ADFS) 2.0<\/a><\/p>\n<p><a title=\"Configuring ADFS Server as the First server in the ADFS Farm using SQL for the Conguration Database\" href=\"https:\/\/pipe2text.com\/?page_id=319\">Configuring ADFS Server as the First server in the ADFS Farm using SQL for the Configuration Database<\/a><\/p>\n<p><a title=\"Adding an additional ADFS Server to your ADFS Farm when using SQL for the Configuration Database\" href=\"https:\/\/pipe2text.com\/?page_id=395\">Adding an additional ADFS Server to your ADFS Farm when using SQL for the Configuration Database<\/a><\/p>\n<p><a title=\"Installing and Configuring an ADFS 2.0 Proxy Server\" href=\"https:\/\/pipe2text.com\/?page_id=399\">Installing and Configuring an ADFS 2.0 Proxy Server<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi All, In this blog I will discuss the steps taken to make an ADFS Server which is using SQL as its configuration database to be mirror aware. Mirroring your database can help in making your ADFS Server Farm more &hellip; <a href=\"https:\/\/pipe2text.com\/?page_id=542\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"class_list":["post-542","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=542"}],"version-history":[{"count":17,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/542\/revisions"}],"predecessor-version":[{"id":562,"href":"https:\/\/pipe2text.com\/index.php?rest_route=\/wp\/v2\/pages\/542\/revisions\/562"}],"wp:attachment":[{"href":"https:\/\/pipe2text.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}