Hi @SenhorDolas
You will also find some server name under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider\Servers
The Print Spooler service will also never remove past print servers from this location.
The registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider is used to store connections to shared printers data. This is a per user setting which is why the user SIDs exist. This key is supposed to be removed when the RDS session is exited and the system calls remove printer connections.
If you are clear user profiles using PowerShell then remove printer connection is not getting called which would explain why the connections are not getting removed from the registry.
When the same user logs back in and a connection to a shared queue is added, the spooler should just place the new GUID printer under the key for the SID.
The new printer name is the same but the GUID will be different. If the user makes a connection to the same queue every time they connect, I suspect there a many GUID printers that actually point to the same shared queue.
If the users actually log out from RDS, I do expect the keys to be removed. If they just exit the session, the keys should still exist when they log on using the same session information.
If you are programmatically removing profiles, this will not touch the registry keys for connection to shared queues.
You can remove the connections to the shares by deleting the registry keys. The print spooler will not get rid of the data it reads from these keys until the Print Spooler service is restarted though.
Are you just attempting to get rid of registry bloat?
Take a look on any computer which has added a connection to a shared queue. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Providers\Client Side Rendering Print Provider
This is absolutely by design.
I have requested folks to delete these key on print servers where they have added connections to the same print server using GPP. I do not do RDS. I'm a print server type of person.
Thanks