question

KevinBohlmann-2367 avatar image
0 Votes"
KevinBohlmann-2367 asked $$ANON_USER$$ answered

Inactive TS Ports: Windows Server 2019 Printer Redirect

Environment: Windows 10 Pro Location Computer: Located in an office Environment
Windows Server 2019 Server : Located in a separate office Environment
Problem:
This environment has been set up so Windows 10 local machine can use remote desktop to the server in order to access the backend of the database systems in place. The local Windows 10 machine is using Printer redirection over Remote Desktop in order to allow printing from the server to the printer located in the Windows 10's office environment. Over time we have noted an increase in inactive TS ports on the printer ports on the Windows Server.

My question is if these ever increasing ports is going to create performance issues with the server, and if there is a way to prevent this from occurring.

remote-desktop-serviceswindows-server-print
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

$$ANON_USER$$ avatar image
1 Vote"
$$ANON_USER$$ answered $$ANON_USER$$ edited

Hi

Actually, the inactive TS ports should be deleted during the restart of the Terminal Server. And it's not available to prevent Remote Desktop Service Device Redirector Service from creating a new port each session. However, the following suggestions show which possibilities are available ways with the question on your concerned.

Firstly, by default, it can only be deleted manually. Of course, the user can delete the inactive port registry periodically by running the following PowerShell script when logging off the user session.
Use PowerShell to delete the inactive port registry, please refer to this link. https://www.bvanleeuwen.nl/faq/?p=1423
Using GPO to Running PowerShell Startup (Logon) Scripts, please refer to this link. http://woshub.com/running-powershell-startup-scripts-using-gpo/

Secondly, you can enter get-hotfix in the PowerShell of Windows 10 and the Windows Server 2019 to see which patches are currently installed. Check and install the latest patch in Windows 10 and Windows Server 2019 to see if the issue fixed.

Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

If the answer is helpful, please click "Accept Answer" and upvote it.

Best regards

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

$$ANON_USER$$ avatar image
1 Vote"
$$ANON_USER$$ answered KevinBohlmann-2367 commented

Hi, dear

For your concern about several issues that have been associated with a high number of inactive Terminal Server ports. This behavior may cause performance issues such as slow boot, delayed logon times to RDP sessions, system hangs, failure to redirect printers, or slow server performance due to registry bloat from all the ports.

This issue occurs because the Remote Desktop Services Device Redirector service creates a new port every time that an RD session is established.
However, the inactive ports are not recycled. Instead, the inactive ports for the redirected printers accumulate under the following registry key on the server:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses{28d78fad-5a12-11d1-ae5b-0000f803a8c2}##?#Root#RDPBUS#0000#{28d78fad-5a12-11d1-ae5b-0000f803a8c2}\

In such cases, if you want to manually delete the inactive ports, please try to delete them via registry entry as mentioned above. However, it may affect your production RDS system, and relate service reboot might be necessary.

If the answer is helpful, please click "Accept Answer" and upvote it.

Best regards

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is it possible to prevent Remote Desktop Service Device Redirector Service from creating a new port each session?

0 Votes 0 ·
$$ANON_USER$$ avatar image
0 Votes"
$$ANON_USER$$ answered

Hi,

Haven't received your message in a few days, was your issue resolved?

I am proposing previous helpful replies as "Answered". Please feel free to try it and let me know the result. If the reply is helpful, please remember to mark it as an answer which can help other community members who have the same questions and find the helpful reply quickly.

Best regards,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.