Already happy you created the app.
@Tedeling I actually don’t use the log, what’s a good number of lines before rollover you think?
OK, So here’s a quick (ish) install quide…
-
Download the App from Page1
-
Download SQL from Microsoft (I’m using 2016 preview, but whatever)
-
Install IIS, depends on Windows version, but easiest user way is to goto ‘Turn Features on or off’ from the start menu, select IIS server, and make sure you also check the .Net4 extensions
-

-
Install SQL (depends on edition, just make sure you have the DB Engine and management tools) and unpack the ZIP of the app into a folder of your choice.
-
Open SQL Studio, connect to local machine, then open a New Query and paste the contents of the PlexSentry\SQL Server - Build Commands.txt contents into it and Run it. This will create a new database and configure it for you.
-
Open the PlexSentry folder (the one with the EXE in it) and open the .config file in notepad
-
Fill in the SQL connection information, something like
<add key="PlexSentryDB" value="Data Source=localhost;Initial Catalog=PlexSentry;Integrated Security=SSPI;" />
- Fill in all the values shown. So you need your PLEX username in masterName along with it’s email address and password. Servername should be the name of the machine or IP address, port is 32400 (unless you have manually changed it) setup your mail settings after that, by default it’s using gmail, but if you have another provider use that.
- Save the file, then from a command shell launch the PlexSentry.exe file. You should get output on the screen
- Now open IIS Admin, and create a new web site, put it on a port/host header and when asked point the directory to the Website folder from the unpacked ZIP.
- Open the Website folder, and goto UI_Site\js and open the script-Plex-common.js file in notepad
- Edit the top 3 values to be the external nam of your server “http://your.plex.serveraddress:32400” and the internal one to your internal IP/Name (example) “http://192.168.1.50” and set the port to “32400”
- Save that and now open up your web.config file in the web root. If you don’t have one yet not to worry, goto IIS Manager and click the PlexSentry site, then the Connections button

Then click the Add, and add a new connection string, make sure it’s name is PlexSentry, something like
- That should do it, Open the site up in your browser and see what you get
TroubleShooting
If you get anything odd, using chrome press F12, then reload the web page, and see where the RED error loading is. Usually it’s the database.aspx that fails, if that’s the case your connection string/sql is not right. Things to check are that TCP connections are enabled in SQL, and that the user is allowed to connect to the DB. Easiest way to make sure permisions are right is to create a new SQL user, and gice it right’s to the DB, then in the connection string change the Integrated Security to User ID=UserName;Password=Password and see if that works.
If you get no thumbnails, it’s because the address in the script-Plex-common.aspx has the wrong servername/address/port in it.
I hope that helps.if not I’ve attached my web.config to this post, edit it to your liking and put it in your Webroot (just take the .txt off the end)
@smckay79 said:
@random.server quick one for you. Say all I want is transcoded sessions, how can I kill everything except 3mbps transcoded sessions?Also, is there a way to remove all shared sections for offenders except say 1 shared section. My plan is to have a message in there about having multiple streams running or sharing of account info.
Thanks.
I wish this was possible…I share with 10 or so people on a 30Mbps UP line, processor is more than powerful enough to manage all the users however if they select higher than 4Mbps (or god forbid direct-stream/direct-play) it causes others to have playback issues due to bandwidth saturation.
I don’t know why Plex themselves have never implemented this feature in the Server application.
There’s always the option of putting a reverse proxy in front of Plex, and then changing the request’s as they come in I suppose, not done it, but I assume it would work. Change the request for direct stream to one of a transcode request, sure the client would play it either way.
Also I assume that the client ‘probes’ the server to work out what’s available to request etc, and if you block the direct request requests, I assume it would fail back to transcode. May look into it at some point.
First amazing job @random.server .
I got it work fine but i saw an issue after some tests.
I have a demo user with restriction 1 trancode only.
I start watching from my iphone first and then ps4.
Both were transcoding so plexsentry killed ps4 proccess
But if i go and press play again from ps4 and start watching, it doesnt kill it again
I tried opposite also first ps4 then iphone. Same
Any idea ?
Thanks
@miniop Can you send me the log? Is it possible that ps4 became a direct play?
No both were transcoding.
I made another test ps4 and firefox at the same time.
firefox was killed.
Then another test firefox and chrome.
chrome was killed. Then in chrome i play again a movie.
It was never killed both trancoding were playing. sending you the log.
Do you have any debug to enable ?
Thanks
@random.server said:
@Tedeling I actually don’t use the log, what’s a good number of lines before rollover you think?
Well for exactly 24 hours the log shows 279953 lines. Guess that would be a good start?
@charlas said:
You do realize your password is exposed? don’t know if you did it on purpose. Just a heads up 
@random.server First of all amazing job !
After some tests i have found some “bugs”/“notes” . If anyone else is experience these kind of problems.
As base I am using a shared account with limit 1 transcode
A:
If the user has 2 transcodes with the same client it doesn’t kill the connection.
I made some tests with browsers and everything is killed unless the user is using the same browser.
I open chrome and played a show.
Then i opened ie and played a show -> killed
Then i open firefox and played a show-> killed
then i open chrome and played a show-> didnt killed as the same user had 2 transcodes with the same browser and version
B:
Almost the same as A but here the case is if the connection is killed and immediately start the show/movie from beginning it doesn’t kill again the connection
When you play a show from firefox (trancoding both audio/video) and at the same time you play something else from another device like ps4 (audio & video trancoding) it kills one connection fine. But from the device that was killed go back and start again the show from the beggining then it doesnt kill the connection.
C:
After some tests i saw that sometimes (i don’t know why) if the users is transcoding both Audio and Video the connection were killed.
Thanks
For those who is interesting for a basic authentication so the plexsentry not to be access by public :
In your web.config add the code that i am attaching.
In the same folder as web.config create a Logon.aspx page and copy past the attached code.
Change the CHANGEUSERNAME and CHANGEPASSWORD
Refresh iis
And you have a simple authentication page
Hey,
I had an issue today. Plexsentry was running. I am administrator so my Streams-Max is 99.
I tried to watch a movie from Playstation 4 but after 3-4sec my connection was killed.
Retry the same.
In the logs it was showing :
Found orphaned transcoding session (ID -: 8bjglgo2tya)
Attempting to shutdown trying to shutdown 8bjglgo2tya
After stoping plexsentry it was working fine.
Thanks
Looks like user upload limits are being worked on 
@random.server said:
@tedeling , give me a couple of days and I’ll take care of that. @smckay79 there’s not enough info from the web api to see the transcode bit rate, so I can’t do anything about it. I’ve look at removing libraries on the fly and have some code ready, I’ll take another look this weekend.
Awesome, Thanks!
I guess another solution would be to shut down just streams that are direct play or direct stream as the default remote transcode is 3mbps, and my user base does not change any other settings. Thoughts on if this can be done?
Thanks!
Thanks for the great tips. Just running in an issue trying to launch plexsentry.com
D:\PlexSentry\PlexSentry.exe
The application has failed to start because its side-by-side configuration is in
correct. Please see the application event log or use the command-line sxstrace.e
xe tool for more detail.
When I check event logs I see:
Activation context generation failed for “D:\PlexSentry\PlexSentry.exe”.Error in manifest or policy file “D:\PlexSentry\PlexSentry.exe.Config” on line 8. Invalid Xml syntax.
When I check the config line 8 is:
If I remove that, it refers to line 7 which is:
< add key=“PlexSentryDB” value=“Data Source=localhost;Initial Catalog=PlexSentry;Integrated Security=SSPI;” />
Anyone have any idea?
@linn.huynh said:
Thanks for the great tips. Just running in an issue trying to launch plexsentry.comD:\PlexSentry\PlexSentry.exe
The application has failed to start because its side-by-side configuration is in
correct. Please see the application event log or use the command-line sxstrace.e
xe tool for more detail.When I check event logs I see:
Activation context generation failed for “D:\PlexSentry\PlexSentry.exe”.Error in manifest or policy file “D:\PlexSentry\PlexSentry.exe.Config” on line 8. Invalid Xml syntax.When I check the config line 8 is:
If I remove that, it refers to line 7 which is:
< add key=“PlexSentryDB” value=“Data Source=localhost;Initial Catalog=PlexSentry;Integrated Security=SSPI;” />
Anyone have any idea?
Data Source should be the name of your SQL instance and not localhost…something like SERVERNAME\SQLEXPRESS
I’ve tried that and the local host, same error appears which is weird.
So i finally got this setup this morning and after turning it on, it wiped all synced shows for all users :(…is this expected behavior on the first run? If so, you should put something in place to avoid this. Also is there any documentation on what is what? Like what do i put in Sync- Video and Sync-Audio for users?..what does the value mean?