I have a windows service and it's running a bit problematic. Sometimes it crashes or sometimes connection to the server is lost but it does nothing for it. Therefore, I have to check the logs of the service (log names change every day, like the date of that day) and restart the service with PowerShell scripts if it doesn't change in a while (eg 1 minute). How can I do this with PowerShell scripts.
Asked
Active
Viewed 106 times
0
-
2What have you tried so far? – uSlackr Mar 14 '23 at 20:47
-
An easy fix for the crashes could be to take a look at the recovery options for the service. This allows you to take automatic actions when the service crashes. You can find this in the eventlog afterwards as event 7031. – GetShifting Mar 16 '23 at 07:10
-
Crash is not correct word for the situation, it seems running but it not operate. So if service not write log i can understand it not work and need restart. – oktay Mar 17 '23 at 10:07