How can i update failover server with management shell permanently?

I have executed the following command in management shell:

Get-SPDatabase | Select Name,Server,failoverserver
$db = Get-SPDatabase 

It seems nothing happen after restart the sharepoint server. It seems execute temporarily in the management shell.

  • 1
    You need to use a NetBIOS or FQDN, not IP address. Is there a reason you're using SQL Mirroring instead of SQL Always On? Mirroring is a deprecated technology.
    – Trevor Seward
    Jan 14, 2020 at 16:28
  • @TrevorSeward reasons for SQL mirroring? Using std edition and don’t want to set up shared storage for Always On Failover Clustering is one I can come up with.
    – Greg W
    Jan 15, 2020 at 9:19

1 Answer 1


Try below code,

$db = Get-SPDatabase | Where-Object { $_.TypeName -eq "Configuration Database" }

Get-SPDatabase | select name, failoverserver, type | sort name | ft -auto | Out-String -Width 2000

The result shows all databases have been updated with failover server. However, in fact, the last line should be $db.update() (add the blanket). Without the blanket, the update is in temporary stage only.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.