<p>We have an ASP.NET application running at a customer site that uses ActiveDirectory for user login via the ActiveDirectoryMembershipProvider. Their primary domain controller that we were pointing to went down this morning, and in getting everything set back up the client was wondering if we could have a redundant connection to two domain controllers; i.e. specifying a primary and a backup AD server. A Google search proved fruitless - does anyone know if this can be done?</p>

[{'answer_id': 54463, 'author': 'Dale Ragan', 'author_id': 1117, 'author_profile': 'https://Stackoverflow.com/users/1117', 'pm_score': 0, 'selected': False, 'text': '<p>It can be done, it will just take some work.</p>\n\n<p>You will need to create a class that inherits off of the ActiveDirectoryMemberhsipProvider and use it has your provider instead.  That way you can maintain most of the functionality.  Then setup a way to specify two connectionStringName properties, one for primary and one for secondary.  You will also need to create the code to read the information from the config since you are changing it.  Then just override the methods where you need to catch when the primary is down and switch to the secondary.  This will be the most reusable way of doing it.</p>\n\n<p>There\'s probably other ways of doing it, but it will probably be hacky and not very reusable.  Like testing the connection before each request and then setting the connectionstring that way.</p>\n\n<p>Based on the <a href="http://msdn.microsoft.com/en-us/library/system.web.security.activedirectorymembershipprovider.aspx" rel="nofollow noreferrer">MSDN documentation</a> on the class, this will probably be the only way to do it.  They don\'t provide the functionality internal.</p>\n'}, {'answer_id': 54473, 'author': 'samjudson', 'author_id': 1908, 'author_profile': 'https://Stackoverflow.com/users/1908', 'pm_score': 3, 'selected': True, 'text': '<p>If ActiveDirectory couldn\'t handle multiple domain controllers then it wouldn\'t be a very good technology.</p>\n\n<p>You just need to make sure in your Membership configuration you are pointing to the \'Domain\' rather than the \'Server\' and then add two or more controllers to your domain.</p>\n\n<p>Generally if you are referring to the domain as "LDAP://server/DC=domain,DC=com" then you should be able to remove the "server" part and refer simply to "LDAP://DC=domain,DC=com"</p>\n\n<p>The following code project gives a long list of things you can do in Active Directory from C#: <a href="http://www.codeproject.com/KB/system/everythingInAD.aspx#7" rel="nofollow noreferrer">http://www.codeproject.com/KB/system/everythingInAD.aspx#7</a></p>\n'}]
['https://Stackoverflow.com/questions/54364', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2144/']