Hi,
Let's follow the steps below.
First of all, please back up the problematic server and registry key.
1.Manually remove all printers from the control panel.
2.Download PSExec and run the following script in PowerShell as administrator to remove existing obsolete entries: (place pstools in this path: C: \ temp \ PSTools \ Psexec.exe)
Start-Process -FilePath cmd.exe -Verb Runas -ArgumentList '/k C:\temp\PSTools\Psexec.exe -I -s powershell.exe'
Remove-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\SWD\PRINTENUM*" -Recurse
Remove-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceClasses*" -Recurse
Remove-Item -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider*" -Recurse
PsExec v2.34
https://learn.microsoft.com/en-us/sysinternals/downloads/psexec
3.Configure the registry key and restart the terminal server 2019, finally we can check the result.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\RemovePrintersAtLogoff
Value = 0
4.Some Window Server 2019 Terminal Servers need to install the latest update to fix this issue.
If the answer is helpful, please click "Accept Answer" and upvote it.
Best regards