计算机\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Defaults\FirewallPolicy\FirewallRules
依次修改
RemoteDesktop-UserMode-In-TCP
RemoteDesktop-UserMode-In-UDP
目标待修改字符串
v2.31|Action=Allow|Active=FALSE|Dir=In|Protocol=17|LPort=3389|App=%SystemRoot%\system32\svchost.exe|Svc=termservice|Name=@FirewallAPI.dll,-28776|Desc=@FirewallAPI.dll,-28777|EmbedCtxt=@FirewallAPI.dll,-28752|
调整后的字符串,此处修改LPort=目标端口,默认3389,我们可以改为LPort=13389(端口自定义,与之前的端口调整的保持一致即可)
v2.31|Action=Allow|Active=FALSE|Dir=In|Protocol=17|LPort=13389|App=%SystemRoot%\system32\svchost.exe|Svc=termservice|Name=@FirewallAPI.dll,-28776|Desc=@FirewallAPI.dll,-28777|EmbedCtxt=@FirewallAPI.dll,-28752|