Difference between revisions of "Sc.exe"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "$sumohost = "myhostname"; Invoke-Command -ComputerName $sumohost -ScriptBlock { sc.exe failure sumo-collector reset=3600 actions= restart/30000 }")
 
Line 1: Line 1:
 +
Set service to restart automatically. Set-Service does not do this
 +
 
$sumohost = "myhostname"; Invoke-Command -ComputerName $sumohost -ScriptBlock { sc.exe failure sumo-collector reset=3600 actions= restart/30000 }
 
$sumohost = "myhostname"; Invoke-Command -ComputerName $sumohost -ScriptBlock { sc.exe failure sumo-collector reset=3600 actions= restart/30000 }
 +
 +
```
 +
sc.exe Qfailure "zabbix agent 2"
 +
sc.exe failure "zabbix agent 2" reset=3600 actions= restart/30000
 +
SC failure YOUR_SERVICE_NAME reset= 0 actions= restart/0/restart/0/restart/0
 +
```

Revision as of 19:25, 9 July 2021

Set service to restart automatically. Set-Service does not do this

$sumohost = "myhostname"; Invoke-Command -ComputerName $sumohost -ScriptBlock { sc.exe failure sumo-collector reset=3600 actions= restart/30000 }

sc.exe Qfailure "zabbix agent 2"
sc.exe failure "zabbix agent 2" reset=3600 actions= restart/30000
SC failure YOUR_SERVICE_NAME reset= 0 actions= restart/0/restart/0/restart/0