Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Powershell modifies remote Desktop Port

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

# requires-runasadministratorfunction Set-RegistryValue ($key, $name, $value, $type= "String") {if ((Test-Path $key)-eq $false) {md $key | Out-Null} Set-ItemProperty $key $name $value-type $type} # modify the registry Change the remote port Set-RegistryValue "HKLM:\ SYSTEM\ CurrentControlSet\ Control\ Terminal Server\ Wds\ rdpwd\ Tds\ tcp" PortNumber 3389 Dword Set-RegistryValue "HKLM:\ SYSTEM\ CurrentControlSet\ Control\ Terminal Server\ WinStations\ RDP-Tcp" PortNumber 3389 Dword # Firewall Settings New-NetFirewallRule-DisplayName "New remote Desktop Port"-name "remote desktop tcp in"-Direction Inbound-LocalPort 3389-Protocol TCP-Action Allow New-NetFirewallRule-DisplayName "New remote Desktop Port"-name "remote desktop" Udp in "- Direction Inbound-LocalPort 3389-Protocol UDP-Action Allow New-NetFirewallRule-DisplayName" New remote Desktop Port "- name" remote desktop tcp out "- Direction Outbound-LocalPort 3389-Protocol TCP-Action Allow New-NetFirewallRule-DisplayName" New remote Desktop Port "- name" remote desktop udp out "- Direction Outbound-LocalPort 3389-Protocol UDP-Action Allow

Modify port 3389 to run as an administrator.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report