Dear experts,I am looking for a script that checks if a .exe is still running and otherwise reboots it. I already found a lot on the internet that should work, but I don't get it working. Can someone help me with this? Unfortunately I have very little knowledge of Powershell myself, so I like dummy language. I think I can run this *.ps1 with Taskplanner and check every 15 minutes, or someone has a better option.

With kind regards,FvdF.

The model below seems very extensive to me but I don't know what to change. As an example I have "notepad".

An .exe is just a process. Just look for the .exe name and if not found, just start it.

What you are showing here is a .bat/.cmd script not PowerShell.

Since you say you are not a PowerShell person, it's really vital you get up to speed to avoid as much confusion and frustration as possible. Also, you need to do this to be able to understand any code anyone gives you or you decide to search for and download.

Never, ever run code you do not fully understand the consequences of. You could cause major damage to your system or infect / corrupt / destroy your corporate network.

# Results from running the above under both conditions, started and not started.

The executable is already running

Get-Process -Name notepad | Stop-Process -Force

WARNING: The executable is not running, starting it.

Lastly, if your are doing thsi locally, then the above works as is. If this is to try to do this on a remote host, this willnot work, as using PowerShell on a remote host requires that PowerShell Remoting be properly configured on the local and remote host and you need proper permissions to use it. Do, a search for PowerShell Remoting and read up on it.

PowerShell is just a tool, and you really don't need PowerShell to do this, but you need to standardize on somehting and since the MS managmetn focus for automation is PowerShell, that is where you need to target.