We’re in the middle of a blizzard in the northeast today and I’m trying to help a remote user connect into her network. However, I believe she has a custom RDP port configured and I need to know which one it is. I can get into a server on her network, but can’t RDP to her system without the port number. I also can’t connect to her registry remotely.

I can, however, connect to her services. I turned on her Remote Registry Service, but still can’t get into the registry. Any thoughts? Are there any other services that need to be started? Is this even possible?

It’s a Windows 7 computer on a domain.

2 Spice ups

Can I ask why they have a custom RDP port?

They had port forwarding set up at one point.

use powershell and find the port number

$computers="computername"
Foreach ($Computer in $Computers) {
$RegBase = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine,$Computer)
$Reg=$RegBase.OpenSubKey(‘SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp’).GetValue(‘PortNumber’)
}
$value +=New-Object -TypeName PSCustomObject -Property @{
ComputerName = $($Computer)
Port=$reg
}
$value |select computername,port
1 Spice up

Lil correction in my script

$computers="computer1","Computer2"
$result=Foreach ($Computer in $Computers) 
{
$RegBase = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine,$Computer)
$Reg=$RegBase.OpenSubKey(‘SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp’).GetValue(‘PortNumber’)
New-Object -TypeName PSCustomObject -Property @{
ComputerName = $Computer
Port=$reg
}
}

$result|select computername,port
1 Spice up

thanks

if its working as expected please mark as best answer and close it.

Make sure to open the firewall remotely as well to allow connectivity.