After you use the Remote Desktop Connection tool to make a connection to another computer, the name of the computer to which you connected is added to the Remote Desktop Connection Computer box. This makes it easy for you to quickly select the same computer at a later time.
However, the Remote Desktop Connection tool does not provide a way to clear the list of computers or remove one or more entries from the Computer box.
Below a PowerShell script to clear the RDP history.
Get-ChildItem "HKCU:\Software\Microsoft\Terminal Server Client" -Recurse | Remove-ItemProperty -Name UsernameHint -Ea 0
Remove-Item -Path 'HKCU:\Software\Microsoft\Terminal Server Client\servers' -Recurse 2>&1 | Out-Null
Remove-ItemProperty -Path 'HKCU:\Software\Microsoft\Terminal Server Client\Default' 'MR*' 2>&1 | Out-Null
$Docs = [environment]::GetFolderPath("mydocuments") + '\Default.rdp'
Remove-Item $Docs -Force 2>&1 | Out-Null
The list of all destination connections (including previous connections) are stored in an MRUnumber value in the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default
Every new connection is given the value of MRU0, and the other values are then sequentially moved down in number. The MRU value can contain a Fully Qualified Domain Name or an IP address of the computer to which you connect.
I really like to hear what you have to say about this article:
- Was this article helpful for you or do you have any questions?
- Do you have additions, suggestions or any other ideas?
- Just let me know by leaving a comment below.
Thank you for spending some time at my site and in my blog. I hope you come to visit again soon 😉