I found a post from 2019 which indicates there was no method for removing orphaned/abandoned users from Plex. It was mentioned to add as a Software Suggestion, as a scheduled task or somesuch..
Is this still the status for orphaned user accounts? I’ve got approximately 60 abandoned accounts in the database and would really like to clean it up.
Are the Software Suggestions publicly accessible?
Server Version#:1.43.1.10561
Player Version#:4.159.0
<If providing server logs please do NOT turn on verbose logging, only debug logging should be enabled>
Have you tried going to Settings→Manage Library Access. If I do that and hover over a user account, it highlights and there is an X at the end of the hightlighted user. I think if you click that X, it should remove the user.
If that doesn’t work, is it possible that maybe your Plex DB is corrupt. Perhaps running ChuckPA’s DBRepair could fix that.
Ah ok, that’s a bit different than how I interpreted your initial. Someone with DB smarts will need to answer that one. I’d think it could be done if you knew how things are stored in the DB.
There should be one table containing all the user names and their individual ID numbers.
And there is another table containg all the playback history, containing both a time stamp, the user ID, and the media ID which has been played.
You need to cross-reference one with the other, then remove all the lines with the user ID of users who no longer exist from the playback history.
The whole will only require basic SQL knowledge.
But still, you want to retain a backup of the primary database file if any mishap occurs during the operation.
P.S.: make the backup only while Plex server is shut down/stopped. Otherwise the backup will be damaged.