PowerShell Script to Check Remote Server Ping and Trigger SQL AOAAG Failover if remote server is down

Hi,

our requirement is to have a powershell script that checks ping status of a remote server and trigger or execute MSSQL AOAag Failover using powershell script.

to begin with I have this below script that pings the remote server, so if reply fails then we want to execute db failover. how to do? the script will run on MSSQL AOAAG itself

=============

Test-Connection-ComputerNamens1-xms1.dm.com

if fails

then execute db failover.

=================================

August 31st, 2015 8:27pm

Here's a starter:

If (!(Test-Connection -ComputerName computerName -Count 1 -Quiet)) {

    #failover
    ...

}

Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 11:14pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics