Quantcast
Channel: Sysinternals Forums
Viewing all articles
Browse latest Browse all 10386

PsTools : start remote windows service

$
0
0
Author: MarioMiranda
Subject: start remote windows service
Posted: 09 May 2017 at 3:17pm

Hello, i'm new on pstool and I need help to create a monitoring tool.
I just need to start windows services (on differents pc's) complying with 2 requirements:
-Start up type different to "manual"
-Status different to "stopped"
(Because when me or someone else it's doing a scheduled works, we set these configs and the idea it's the script recognize this and don't screw up the current work)

Additional information:
These services have similar name with the PC, for example:
Servers:
ServerNº101
ServerNº103
ServerNº108

Services: 
ServiceNº101a, ServiceNº101b, ServiceNº101c
ServiceNº103a, ServiceNº103b, ServiceNº103c
ServiceNº108a, ServiceNº108b, ServiceNº108c

At the moment I only achieved to create a locally batch file and run every 20mins with "taskschd.msc" (but not even detecting the startup type):
FOR %%a IN (%Svcs%) DO (SC query %%a | FIND /i "RUNNING" IF ERRORLEVEL 1 SC start %%a)

I want to use a dedicated machine (that use an network admin account) to show the status of all of this machines, for example: 
-Running OK = if the status of the 3 services its running normal
-Stopped = if some of the services have problems and the script be able to start automatically
-Scheduled work = if detects "stopped" and "manual"

Viewing all articles
Browse latest Browse all 10386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>