利用powershell來更改RDP的連線Port

 以系統管理員的身份開啟powershell



在powershell的命令列上依序執行下列步驟:

1、設定port的變數


$port_num = 33889


2、更改RDP上的預設port


Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value $port_num 


3、如果已設定過防火牆可省略下列步驟,其中-profile設定為any,表示全部適用


New-NetFirewallRule -DisplayName 'RDPPORTLatest-TCP-In' -Profile 'Any' -Direction Inbound -Action Allow -Protocol TCP -LocalPort $port_num

 
New-NetFirewallRule -DisplayName 'RDPPORTLatest-UDP-In' -Profile 'Any' -Direction Inbound -Action Allow -Protocol UDP -LocalPort $port_num



ora-38029: object statistics are locked