Comments (15)
Please check #4
from plexbackup.
Thank you, read through that one. And I have tested running the command manually.
Start-Process <PMS> -LoadUserProfile
Run this in Powershell with Administrator, got the same issue as the script.
Run this in Powershell without Administrator, everything seems fine.
Both cases, the PMS shows running under current user in task manager, the only difference is the UAC Virtualization column, first one said "Not allowed", second says "Disabled". Not sure if this is related or not though.
from plexbackup.
The problem is that the script needs to run as Administrator; otherwise, it will not have permissions to stop and start services and processes. If you have any ideas, throw them at me and I'll give them a try.
from plexbackup.
Okay, give this a try. Change line 1808 from:
Start-Process $plexServerExePath -LoadUserProfile
to
runas /trustlevel:0x20000 "$plexServerExePath"
See if this helps.
from plexbackup.
@yangqi Any luck?
from plexbackup.
Hi first of all thanks for the script.
I have the same problem with network shares and came here. I created a test Powershell with various ways to run the Plex Media Server.exe and none of these work (I comment out all of them here but I would uncomment to try different approaches):
The user/pass for my server is plex\plex
`$username = 'plex'
$password = 'plex'
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential $username, $securePassword
#Start-Process -FilePath "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe" -Credential $credential
#runas /trustlevel:0x20000 "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe"
#Start-Process -FilePath "C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe" -LoadUserProfile -Credential $credential
`
The only way I can get it to work as in recognize paths/play video is end the task from tool tray and run it from the Windows Start Menu then it recognizes the paths and plays correctly.
This has me stumped, but it believe it has to do with Administrator permissions for network folders, however I do verify in task manager that the services are running under Plex user correctly so ???
Can you add a reboot option... my Windows Plex server is set to auto login so this would be a workaround... I suppose I can just add this in code myself too for now - Restart-Computer
Would be nice to learn why PowerShell and Plex behaves this way.
from plexbackup.
@Doughboy68: Have you tried my suggestion for @yangqi above? I have been testing it daily for the last week, and it seems to be working for me (I am also using an option to log off all currently logged users). It could be a coincidence, though, since this particular problem comes and goes. Also, it has nothing to do with Plex per se, and it's not an issue of PowerShell, I think. It does not happen when you run the script interactively and only occurs when you run it as a scheduled task. So it looks like some bug in Windows Scheduled Tasks app. Anyway, give my suggestion a try and let me know.
from plexbackup.
I added a reboot option so this is the workaround I am using for now. If anyone figures out why scheduled tasks mess up remote share connection, please let me know.
from plexbackup.
Hi Alek,
Have recently found your script and after some trouble figuring it out (total noob). I've finally got it work and it's awesome!
I have however run into this old issue though #26. I was just wondering if you figured out anything additional since Aug 2020?
I've changed line 2331/2332, and tried both of these below as you suggested and still get the issue unfortunately.
Start-Process $plexServerPath -LoadUserProfile
runas /trustlevel:0x20000 "$plexServerPath"
Was wondering if you've come up with anything since then? Just a bit iffy to run it as a scheduled task at the moment as I'd have to reboot the application everytime.
from plexbackup.
Hi K-Bong. No, haven't figured it out. I suspect it's an issue with Windows Scheduled tasks or something related to the tasking subsystem (since it only happens when the script runs as a scheduled task). I just have mine configured to reboot with autologin.
from plexbackup.
Thanks for responding. I do get the issue when running the script directly from PowerShell, and as a scheduled task by the way.
But it's no biggie, I might just try what you mentioned or just run the script manully, cheers!
from plexbackup.
Oh, in my observation, it was always a Scheduled Tasks issue. Are you saying that even when you run it manually in PowerShell, you get the same problem? That would be even more weird.
from plexbackup.
Yep. I wanted to make sure the script worked first before running the scheduled task. I would see the behaviour throughout the whole thing, whether I ran it from powershell or through task scheduler.
from plexbackup.
That's bizarre. I am wondering if when you run it from PowerShell, the profile by default gets connected to a share with no permissions. I wish I know how to address this one.
from plexbackup.
Yeah. Otherwise it works well, so appreciated. Sure you'll keep us updated if you do figure something out.
from plexbackup.
Related Issues (20)
- issue with backup HOT 5
- Cannot import run-time settings from default configuration file (if any). Invalid JSON primitive: Skip. HOT 1
- Validation error. Backup version does not match HOT 3
- Can't start Plex after backup HOT 6
- After backup completes getting an error when the script attempts to start Plex HOT 3
- Plex Media Server Not Restarting HOT 1
- Email Notification Not Working HOT 2
- Plex Backup Failing-Nothing Changed HOT 16
- question/enhancement HOT 4
- Only receiving the error "Error processing dependencies. You cannot call a method on a null-valued expression." HOT 6
- Fix typo in log message HOT 1
- Add support for PowerShell 7.
- RUNAS ERROR: Unable to run ... 87: The parameter is incorrect. HOT 2
- Plex Backup Fails Through Task Scheduler (Win 10 Pro) HOT 2
- 87: The parameter is incorrect HOT 13
- Create a workaround for the error 87: The parameter is incorrect HOT 1
- Restore didn
- Restore didn't work too well for me HOT 16
- Sub folders not being created by backup process HOT 5
- Add the option to exclude Cache folder HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plexbackup.