RDP port change for all vm at one time

chirag yadav 1 Reputation point

I want to change my all vms rdp port at one time from 3389 to 3365

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
11,748 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Dave Patrick 426.1K Reputation points MVP

    You can use the PowerShell method here.

    --please don't forget to Accept as answer if the reply is helpful--

    0 comments No comments

  2. Eleven Yu (Shanghai Wicresoft Co,.Ltd.) 10,666 Reputation points Microsoft Vendor


    If all your VMs join the same domain, you can use the domain group policy to deploy the registry to change the port.

    The registry to modify the port is as below.

    Change the listening port for Remote Desktop on your computer



    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  3. Thameur-BOURBITA 29,606 Reputation points


    To change RDP port number , you have to modify the following registry key HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber.
    You can perform the modification manually or use powershell or use Group Policy Preference :

    Computer Configuration -> Preferences -> Windows Settings -> Registry ->select New -> Registry Item
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TCP\" -Name PortNumber -Value 3365

    Before you modify the port number , you have to check if the new port is allowed on Windows firewall. Once you complete the port change , you have to reboot the machine to apply all new settings.

    Please don't forget to mark this reply as answer if it help you to fix your issue

    0 comments No comments