MS-AZ-Q1:How to Change the Default RDP Port Number in the Azure Virtual Machine

Step-by-Step Guide to Changing the RDP Port in Azure VPS Machine -

  1. Setup the VM Machine’s Firewall Rule for RDP

    1. Create a Inbound Rules.

  2. Setup Registry in the VM Machine for RDP (if needed)

    1. Change a PortNumber Script from regedit

  3. Setup the Azure Portal for Custom RDP 

    1. Create a Rule for RDP on NSG (Network Security Group)

    2. Run Script for RDP Run Command

    3. Change the Port Number Access from Connect Option from Left-side Nav Pane.

    Step-01: Create a New Inbound Rule for the RDP Port


    =>
    Control Panel\All Control Panel Items\Windows Defender Firewall\Advanced Settings.



    =>Click on Right Button Mouse above Inbound Rules Option at the left side nevigation bar + Create New Rules & Select Port + Click Next Button



    =>Write the Specific Port on the Local Ports Field & Click Next




    => Please follow the instructions according to the below pictures until click on finished button.










    => Verify the Firewall Rule Profile






    Step-02: Access the Registry Editor for RDP Port Number Access. (If Needed)

    => (Win+R) Open Run dialoge Box + `Enter regedit`
    =>The following path:
    ``HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp``
    => 
    Modify the PortNumber Entry or Create new DWORD (32-bit) Value. => Modify the Decimal value field. => Run `cmd` as Administrator + Enter following command for RDP services - net stop termservice && net start termservice => Restart the VM => For verifying RDP Services -
    "netstat -an | find “<new_port_number>"

    Step-03: Azure Portal Configuration for RDP Services
    => From NSG, RDP Service Configuration -
        1. Sign in to the Azure portal.     2. In Virtual Machines, select the VM that has the problem.     3. In Settings, select Networking.     4. In Inbound port rules, check whether the port for RDP is set correctly. The following is an example of the configuration: -         "Priority: 300          Name: Port_33091          Port(Destination): 33091          Protocol: TCP          Source: Any          Destinations: Any          Action: Allow"


    => From Operations Option + Click On Run Command + scroll Down and Click on SetRDPPort + Enter a value on RDPPORT Field then Click on RUN Button. Please follow the below pictures instructions accordingly.





    => Click on Connect Option from Left Nav Pane and Follow below the picture's instructions -

























    Hands-on-Session Given Below -





Popular posts from this blog

RHCSA-EX200: Vendor Exam Problem Solving

CCNA Class 05: IPv4 and IPv6 Addresses Introduction

CCNA Class 01: Basic Networking & Network Architecture