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