Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup fails with TaskScheduler #58

Closed
shanester64 opened this issue Mar 3, 2022 · 10 comments
Closed

Backup fails with TaskScheduler #58

shanester64 opened this issue Mar 3, 2022 · 10 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@shanester64
Copy link

Running Win10
From the log file..
Stopping Plex Media Server process:
Plex Media Server.exe
Error stopping Plex Media Server. ERROR: The process "Plex Media Server.exe" with PID XXX could not be terminated.

Running with highest permissions.

@alekdavis
Copy link
Owner

I assume it works if you run it manually, right? If so, it means the process is not running with highest permissions when invoked from the scheduler.

@shanester64
Copy link
Author

shanester64 commented Mar 4, 2022 via email

@alekdavis
Copy link
Owner

What happens if you run it from the Actions panel in the Task Scheduler?

@shanester64
Copy link
Author

shanester64 commented Mar 4, 2022 via email

@alekdavisintel
Copy link

Hey, Ken. I wish I could help you, but I really do not know why this would happen. Obviously, when the script runs from the Task Scheduler, it does not have enough privileges to stop services, even though you say the option is checked. Task Scheduler is a weird beast (it has other issues as well), but I do not have sufficient knowledge to troubleshoot it over message exchange (and even in person). I would check Windows Even log to see if there are any more specific errors. Maybe there is some policy applied to the account that you use that prevents this. Really hard to say. I can explain what, how and why the script does what it does, but the Task Scheduler part is not really my area of expertise, especially since I have not heard from anyone about this particular issue since I released the script a few years ago. I wish I could be more helpful.

@albino1
Copy link

albino1 commented Mar 4, 2022

If it's some sort of Task Scheduler specific permission issue maybe hide it in a batch script and just call the batch script instead?

@alekdavisintel
Copy link

I'm not sure what you're saying, but I'm sure it will not help.

@albino1
Copy link

albino1 commented Mar 5, 2022

I'm saying if Task Scheduler has a permission issue of some sort, then just have Task Scheduler run a batch script with the PowerShell line inside of it, then the PowerShell line is being executed independently of any theoretical Task Scheduler restrictions.

To be clear, I don't think it will work either, but I also don't think Task Scheduler should have any problems in the first place, especially if it works when you just right-click and run it from inside of Task Scheduler.

@alekdavis
Copy link
Owner

That's not how Windows security works (I mean your assumption about this being helpful). In essence, it's already what happens: Task Scheduler invokes PowerShell (scripting), which runs the backup script. You can introduce 100 more scripts in between (Task Scheduler-script 1-script2-...-script 100-PowerShell-backup script), but it will not be of much use.

@albino1
Copy link

albino1 commented Mar 7, 2022

Apologies, I was hoping it would maybe be a possible workaround, but yeah, not an option.

@alekdavis alekdavis self-assigned this Jul 6, 2022
@alekdavis alekdavis closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2022
@alekdavis alekdavis added the help wanted Extra attention is needed label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants