Sc.exe

From UVOO Tech Wiki
Revision as of 19:25, 9 July 2021 by Busk (talk | contribs)
Jump to navigation Jump to search

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