I'm looking for a way to automate the shutdown of my Plex server using Task Scheduler, specifically to shut it down every day at 11 PM. I can handle it manually, but I often forget, and when I do, Plex runs updates in the background that end up crashing my PC. Any tips on how to accomplish this?
5 Answers
You can find the process name and use `Stop-Process -Name yourProcessName` to tackle the issue. It's fairly easy! Also, don't forget to look into the potential root causes of why the PC crashes.
You'll want to set Task Scheduler to run a PowerShell script that includes your shutdown commands. Check out this step-by-step guide I found that walks you through the whole process. It makes things pretty straightforward! [Here's the link](https://o365reports.com/2019/08/02/schedule-powershell-script-task-scheduler/).
Just make sure you’ve got the right process name when setting up your script. I had issues with that before. If it runs fine manually but not from Task Scheduler, double-check your settings there!
If it helps, you could use `shutdown.exe -r -t 0`, but just remember that this will restart your PC, not just shut down Plex. Make sure that's what you want to do!
Instead of just scheduling a shutdown, you might want to figure out what's causing the issue in the first place. If you're looking to just kill the Plex service, you could use the `Stop-Service` command. It'll help you manage things without needing to restart your PC.
I’m not really sure what’s causing the problem, and I’m still learning about all of this. Can you point me to any resources that might help?
I've used the right name, but it still doesn't work correctly with Task Scheduler. It runs but doesn't shut down Plex.