Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Set the new RDP port (replace 13389 with your desired port number)
- $newPort = 13389
- Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "PortNumber" -Value $newPort -Type DWord
- # Allow the new port through the firewall
- New-NetFirewallRule -DisplayName "Allow RDP on Port $newPort" -Direction Inbound -Protocol TCP -LocalPort $newPort -Action Allow
- # Restart the Remote Desktop service to apply changes
- Restart-Service TermService -Force
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement