Server Version#: Version 1.27.1.5916
Player Version#: Web Player Version 4.76.1
I have had crash issues with the Plex Server on my Windows 10 computer, as have many other folks. I wanted to post the restart job that I set up in Task Scheduler, and the powershell and VB script that I found to work for my circumstances. YMMV, please test before you use the script.
Powershell script, saved as StartPlex.ps1:
$Prog = "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe"
$Running = Get-Process prog -ErrorAction SilentlyContinue
if (!$Running) {Start-Process $Prog}
In order to launch the powershell script without a window popping up on the screen, you can call the .ps1 file from a VB script. Got the VB script from this site: Stack Overflow How to Run PS Script Without Window
VB Script, saved as ps-run.vbs:
Set objShell = CreateObject("Wscript.Shell")
Set args = Wscript.Arguments
For Each arg In args
objShell.Run("powershell -windowstyle hidden -executionpolicy bypass -noninteractive ""&"" ""'" & arg & "'"""),0
Next
I set up a Task Scheduler task;
Create Task
General Tab:
Name: Check Plex Server Status
Run when the current user logged into the computer
Triggers Tab:
One Time, set start date and time
repeat task every 5 minutes indefinitely
Enabled checked
Actions Tab:
Start a program
Program: wscript
Add Arguments: c:\yourdirectory\ps-run.vbs c:\yourdirecctory\StartPlex.ps1
Conditions and Settings tab defaults.
When I stop the Plex Server, and let the task run, it starts it right back up. I had it crash last night, and the script got it back within the 5 minutes.
Good luck, hope this can help someone.