Twitter Feed
Tweets by SundownSolLtd

Configuring SharePoint 2013 failover partner settings using PowerShell

5th August


This post is short and sweet and should hopefully cover everything you need to know about retrieving and setting the failover partner status for your databases

To get the current settings for any single database you can use the following command:

Get DB single DB Info
Get-SPDatabase | select name, server, failoverserver | ?{$_.name -match "Profile_DB"}

To get the failover partner settings for all DBs you can use the following:

Get Failover Information for all DBs
Get-SPDatabase | select id, name, server, failoverserver|out-Gridview

Set Failover Information for all DBs
To set the failover partner settings for a particular DB use the following block – replacing with your settings as appropriate:

$db = get-spdatabase <DB_GUID_HERE> #this is your GUID from get-spdatabase command from above

$db # this is to verify you have the right DB

$db.AddFailoverServiceInstance("YOUR_SQL_FAILOVER_")# insert your failover SQL server

$db.Update() # Updates the settings

To confirm the settings have taken you can re-run the list all command:

Get-SPDatabase | select id, name, server, failoverserver|out-Gridview

Hopefully you someone will find this useful :)

Follow Us