3

can somebody help me with a query I have. I have a device (windows server 2008) at the backend that when it fail we need to restart a service in the server.

I have read that I can send a the command to the device remotly with ( sc \server stop service)

The only concern is that the device is a the backend and there are some firewall rules that don't let us remote control.

SC use any port to send the command that maybe I can open in the firewall?

I have been advice to ask here, I posted before in stack overflow.

2 Answers 2

1

Commands such as sc require the firewall have ports open for RPC. By default this is tcp/135 and 49152 - 65535. As an alternative, you may want to consider using Windows Remote Management. This would be tcp/5985 (or tcp/5986 if using certificate encryption). In that scenario your command would be:

winrs -r:servername sc stop servicename

0

First of all, you should begin to investigate why your service is failing. Check your windows logs for any relevant entries. To help in the short term until you find the cause of your failures, you can set the service to restart automatically after failure within the properties of the service. These settings can be found in the Recovery tab in the service properties. If your thought was to open ports in your firewall to allow SC commands to be sent through the Internet to your service... don't do this. It will open you to all sorts of issues.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .