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.

*_-

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more