Cleaning up entries on Remote Desktop Connection

I use RDP between my main laptop and the machine on which my lab resides. When I rebuild the lab the entries in the Remote Desktop Connection for the old machine still remain.

There isn’t a direct way to remove those entries. But you can remove them from the registry.

First view the entries

Get-ChildItem -Path ‘HKCU:\SOFTWARE\Microsoft\Terminal Server Client\’

    Hive: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Terminal Server Client

Name                           Property
—-                           ——–
Default                        MRU0 : RSLaptop01
                               MRU1 : serverrs01
                               MRU2 : server02

The partial list above shows you that the property names are MRU* 

You can view individual entries

Get-ItemProperty -Path ‘HKCU:\SOFTWARE\Microsoft\Terminal Server Client\Default\’ -Name MRU2

MRU2         : server02
PSPath       : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Terminal
               Server Client\Default\
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Terminal
               Server Client
PSChildName  : Default
PSDrive      : HKCU
PSProvider   : Microsoft.PowerShell.Core\Registry

You can now delete as required – for instance

Remove-ItemProperty -Path ‘HKCU:\SOFTWARE\Microsoft\Terminal Server Client\Default\’ -Name MRU2

This entry was posted in Powershell, Registry. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s