0

I have a local service which interacts with a SQL database.

This service stays up when SQL database goes down.

What I need is a PowerShell script that checks the remote SQL service and based on the result it must start or stop the local service.

Any help would be highly appreciated

1 Answers1

0

You can check if SQL server port is open on a remote host. See this answer for details about how to do this How to check Network port access and display useful message? The port number is depending on SQL server you're using. For example, for MS SQL default port is 1433 and for MySQL - 3306.

montonero
  • 1,363
  • 10
  • 16