PowerShell for Windows Admins

Jun 29 2016   10:57AM GMT

Cleaning up entries on Remote Desktop Connection

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

Tags:
Powershell
Registry settings

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

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: