DEV Community

Gürkan Biçer
Gürkan Biçer

Posted on

Powershell ile RDP Port Değiştirmek

RDP portunu değiştirmek için Regedit yolunu nasıl hatırlayabilirim?

Eğer benim gibi yüzlerce sunucu kuruyor veya yönetiyorsanız, RDP port değiştirmek için Regedit ve Windows Firewall üzerinden işlem yapmanız acı verici olabilir. Bu nedenle, bir powershell script hazırladım.

Powershell'i administrator olarak açın. Aşağıdaki komutları kopyalayın ve Powershell ekranına yapıştırın. Bu komutlar, RDP portu değiştirecek ve Windows Firewall için gerekli kuralları ekleyecek.

portvalue değişkenine dilediğiniz port numarasını yazabilirsiniz.

$portvalue = 3581
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value $portvalue 
New-NetFirewallRule -DisplayName 'RDPPORT-TCP-In' -Profile 'Any' -Direction Inbound -Action Allow -Protocol TCP -LocalPort $portvalue 
New-NetFirewallRule -DisplayName 'RDPPORT-UDP-In' -Profile 'Any' -Direction Inbound -Action Allow -Protocol UDP -LocalPort $portvalue
Enter fullscreen mode Exit fullscreen mode

Remote Desktop servisini yeniden başlatmayı unutmayın.

*_-

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay