1

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 
$db.AddFailoverServiceInstance("10.12.10.10")
$db.update

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

2
  • 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. Jan 14 '20 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 '20 at 9:19
0

Try below code,

$db = Get-SPDatabase | Where-Object { $_.TypeName -eq "Configuration Database" }
$db.AddFailoverServiceInstance("10.12.10.10")
$db.update()

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.

SOURCE

5

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.