Troubleshoot authentication errors when you use RDP to connect to Azure VM - Virtual Machines (2024)

  • Article

This article can help you troubleshoot authentication errors that occur when you use Remote Desktop Protocol (RDP) connection to connect to an Azure virtual machine (VM).

Note

Was this article helpful? Your input is important to us. Please use the Feedback button on this page to let us know how well this article worked for you or how we can improve it.

Symptoms

You capture a screenshot of an Azure VM that shows the Welcome screen and indicates that the operating system is running. However, when you try to connect to the VM by using Remote Desktop Connection, you receive one of the following error messages:

  • An authentication error has occurred. The Local Security Authority cannot be contacted.
  • The remote computer that you are trying to connect to require Network Level Authentication (NLA), but your Windows domain controller cannot be contacted to perform NLA. If you are an administrator on the remote computer, you can disable NLA by using the options on the Remote tab of the System Properties dialog box.
  • This computer can't connect to the remote computer. Try connecting again, if the problem continues, contact the owner of the remote computer or your network administrator.

Cause

There are multiple reasons why NLA might block the RDP access to a VM:

  • The VM cannot communicate with the domain controller (DC). This problem could prevent an RDP session from accessing a VM by using domain credentials. However, you would still be able to log on by using the Local Administrator credentials. This problem may occur in the following situations:
    • The Active Directory Security Channel between this VM and the DC is broken.
    • The VM has an old copy of the account password and the DC has a newer copy.
    • The DC that this VM is connecting to is unhealthy.
  • The encryption level of the VM is higher than the one that's used by the client computer.
  • The TLS 1.0, 1.1, or 1.2 (server) protocols are disabled on the VM. The VM was set up to disable logging on by using domain credentials, and the Local Security Authority (LSA) is set up incorrectly.
  • The VM was set up to accept only Federal Information Processing Standard (FIPS)-compliant algorithm connections. This is usually done by using Active Directory policy. This is a rare configuration, but FIPS can be enforced for Remote Desktop connections only.

Before you troubleshoot

Create a backup snapshot

To create a backup snapshot, follow the steps in Snapshot a disk.

Connect to the VM remotely

To connect to the VM remotely, use one of the methods in How to use remote tools to troubleshoot Azure VM issues.

Group policy client service

If this is a domain-joined VM, first stop the Group Policy Client service to prevent any Active Directory Policy from overwriting the changes. To do this, run the following command:

REM Disable the member server to retrieve the latest GPO from the domain upon startREG add "HKLM\SYSTEM\CurrentControlSet\Services\gpsvc" /v Start /t REG_DWORD /d 4 /f

After the problem is fixed, restore the ability of this VM to contact the domain to retrieve the latest GPO from the domain. To do this, run the following commands:

sc config gpsvc start= autosc start gpsvcgpupdate /force

If the change is reverted, it means that an Active Directory policy is causing the problem.

Workaround

As a workaround to connect to the VM and resolve the cause, you can temporarily disable NLA. To disable NLA please use the below commands, or use the DisableNLA script in Run Command.

REM Disable the Network Level Authenticationreg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0

Then, restart the VM, and proceed to the troubleshooting section.

Once you have resolved the issue re-enable NLA, by running the following commands, and then restarting the VM:

REG add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v disabledomaincreds /t REG_DWORD /d 0 /fREG add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 1 /f

Troubleshooting

  1. Troubleshoot Domain-joined VMs.
  2. Troubleshoot standalone VMs.

Troubleshoot Domain-joined VMs

To troubleshoot this problem:

  1. Check whether the VM can connect to a DC.
  2. Check the health of the DC.

Note

To test the DC health, you can use another VM that is in the same VNET, subnet, and uses the same logon server.

Connect to the VM that has the problem by using Serial console, remote CMD, or remote PowerShell, according to the steps in the Connect to the VM remotely section.

  1. Determine the DC that the VM is attempting to connect to. run the following command in the console:

    set | find /i "LOGONSERVER"
  2. Test the health of the secure channel between the VM and the DC. To do this, run the Test-ComputerSecureChannel command in an elevated PowerShell instance. This command returns True or False indicating whether the secure channel is alive:

    Test-ComputerSecureChannel -verbose

    If the channel is broken, run the following command to repair it:

    Test-ComputerSecureChannel -repair
  3. Make sure that the computer account password in Active Directory is updated on the VM and the DC:

    Reset-ComputerMachinePassword -Server "<COMPUTERNAME>" -Credential <DOMAIN CREDENTIAL WITH DOMAIN ADMIN LEVEL>

If the communication between the DC and the VM is good, but the DC is not healthy enough to open an RDP session, you can try to restart the DC.

If the preceding commands did not fix the communication problem to the domain, you can rejoin this VM to the domain. To do this, follow these steps:

  1. Create a script that's named Unjoin.ps1 by using the following content, and then deploy the script as a Custom Script Extension on the Azure portal:

    cmd /c "netdom remove <<MachineName>> /domain:<<DomainName>> /userD:<<DomainAdminhere>> /passwordD:<<PasswordHere>> /reboot:10 /Force"

    This script forcibly removes the VM from the domain and restarts the VM 10 seconds later. Then, you need to clean up the Computer object on the domain side.

  2. After the cleanup is done, rejoin this VM to the domain. To do this, create a script that is named JoinDomain.ps1 by using the following content, and then deploy the script as a Custom Script Extension on the Azure portal:

    cmd /c "netdom join <<MachineName>> /domain:<<DomainName>> /userD:<<DomainAdminhere>> /passwordD:<<PasswordHere>> /reboot:10"

Note

This joins the VM on the domain by using the specified credentials.

If the Active Directory channel is healthy, the computer password is updated, and the domain controller is working as expected, try the following steps.

If the problem persists, check whether the domain credential is disabled. To do this, open an elevated Command Prompt window, and then run the following command to determine whether the VM is set up to disable domain accounts for logging on to the VM:

REG query "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v disabledomaincreds

If the key is set to 1, this means that the server was set up not to allow domain credentials. Change this key to 0.

Troubleshoot standalone VMs

Check MinEncryptionLevel

In a CMD instance, run the following command to query the MinEncryptionLevel registry value:

reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v MinEncryptionLevel

Based on the registry value, follow these steps:

  • 4 (FIPS): Check FIPs compliant algorithms connections.

  • 3 (128-bit encryption): Set the severity to 2 by running the following command:

    reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v MinEncryptionLevel /t REG_DWORD /d 2 /f
  • 2 (Highest encryption possible, as dictated by the client): You can try to set the encryption to the minimum value of 1 by running the following command:

    reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v MinEncryptionLevel /t REG_DWORD /d 1 /f

Restart the VM so that the changes to the registry take effect.

TLS version

Depending on the system, RDP uses the TLS 1.0, 1.1, or 1.2 (server) protocol. To query how these protocols are set up on the VM, open a CMD instance, and then run the following commands:

reg query "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server" /v Enabledreg query "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" /v Enabledreg query "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" /v Enabled

If the returned values are not all 1, this means that the protocol is disabled. To enable these protocols, run the following commands:

reg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server" /v Enabled /t REG_DWORD /d 1 /freg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" /v Enabled /t REG_DWORD /d 1 /freg add "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" /v Enabled /t REG_DWORD /d 1 /f

For other protocol versions, you can run the following commands:

reg query "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS x.x\Server" /v Enabledreg query "HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS x.x\Server" /v Enabled

Note

Get the SSH/TLS version x.x from the Guest OS Logs on the SCHANNEL errors.

Check FIPs compliant algorithms connections

Remote desktop can be enforced to use only FIPs-compliant algorithm connections. This can be set by using a registry key. To do this, open an elevated Command Prompt window, and then query the following keys:

reg query "HKLM\SYSTEM\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy" /v Enabled

If the command returns 1, change the registry value to 0.

reg query "HKLM\SYSTEM\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy" /v Enabled /t REG_DWORD /d 0

Check which is the current MinEncryptionLevel on the VM:

reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v MinEncryptionLevel

If the command returns 4, change the registry value to 2

reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v MinEncryptionLevel /t REG_DWORD /d 2

Restart the VM so that the changes to the registry take effect.

Next steps

  • SetEncryptionLevel method of the Win32_TSGeneralSetting class
  • Configure Server Authentication and Encryption Levels
  • Win32_TSGeneralSetting class

If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.

Troubleshoot authentication errors when you use RDP to connect to Azure VM - Virtual Machines (2024)

FAQs

How to troubleshoot RDP issues in Azure? ›

Solution
  1. Step 1: Open CMD instance in Serial console. Access the Serial Console by selecting Support & Troubleshooting > Serial console (Preview). ...
  2. Step 2: Check the values of RDP registry keys. Check if the RDP is disabled by group polices. ...
  3. Step 2: Enable remote desktop services. ...
  4. Step 3: Reset RDP listener.
Mar 27, 2024

What is the authentication issue with RDP? ›

There are multiple reasons why NLA might block the RDP access to a VM: The VM cannot communicate with the domain controller (DC). This problem could prevent an RDP session from accessing a VM by using domain credentials. However, you would still be able to log on by using the Local Administrator credentials.

How to allow RDP to Azure VM? ›

Connect to the virtual machine
  1. Go to the Azure portal to connect to a VM. ...
  2. Select the virtual machine from the list.
  3. At the beginning of the virtual machine page, select Connect.
  4. On the Connect to virtual machine page, select RDP, and then select the appropriate IP address and Port number.

Why can't I connect to my Azure VM? ›

If the Connect button for your VM is grayed out in the portal and you are not connected to Azure via an Express Route or Site-to-Site VPN connection, you need to create and assign your VM a public IP address before you can use RDP. You can read more about public IP addresses in Azure.

How do I troubleshoot an RDP problem? ›

Troubleshooting RDP
  1. Ensure the VM is online and ready.
  2. Check connectivity between your workstation and the VM instance.
  3. Check your Windows instance password.
  4. Check if you're using Windows Server Core.
  5. Check your VPC firewall rules.
  6. Verify the external IP address.
  7. Use of Windows Remote Desktop Services (RDS)

How to check if RDP is enabled on Azure VM? ›

Solution
  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_3389. Port(Destination): 3389. Protocol: TCP.
Jul 10, 2024

How to connect to VM using RDP? ›

To connect with Microsoft Windows Remote Desktop, do the following:
  1. Create a Windows account and password if you do not have one yet.
  2. To connect over the internet, use the external IP address. ...
  3. Open Microsoft Windows Remote Desktop Connection on your Windows machine. ...
  4. In the Computer box, enter the IP address.

How do I Connect to Azure AD RDP? ›

RDP to AzureAD joined PC
  1. First, open remote desktop as if you were going to connect to any other computer.
  2. Type in the computer name or IP address and expand the the Show Options section.
  3. Next, click the Save As button to save the RDP file locally. At this point you can close the Remote Desktop Connection dialog.

How to troubleshoot Azure VM issues? ›

Azure VM cannot connect to another Azure VM in same virtual network
  1. Step 1: Verify that VMs can communicate with each other. ...
  2. Step 2: Check the Network security group settings. ...
  3. Step 3: Check whether you can connect to the destination VM by using Remote Desktop or SSH. ...
  4. Step 4: Perform a connectivity check.
Oct 27, 2022

How to change RDP port in Azure VM? ›

3 actions are required to modify the RDP port.
  1. Enable new port on the VM firewall. Note : The RDP port is the only method to connect to the Azure VM, only remove the classic port 3389 once you have tested the connection with new RDP port. ...
  2. Add new port as RDP port. ...
  3. Add Inbound Security Rule. ...
  4. Troubleshooting.
Dec 14, 2022

How do I test Azure connection to VM? ›

Under Network diagnostic tools, select IP flow verify from the sidebar. Azure Network Watcher's IP flow verify feature will confirm if a rule in your NSG blocks traffic to or from your VM. On the IP flow verify page, fill in the required details: Virtual machine — The target VM you want to test.

How do I troubleshoot a remote server having some issues? ›

Here are some troubleshooting steps you can try in same time:
  1. Check if the Remote Desktop service is running on the server. ...
  2. Check if the server's firewall is blocking Remote Desktop connections. ...
  3. Check if the server is configured to allow Remote Desktop connections. ...
  4. Check if the server's network settings are correct.
Jan 5, 2024

Why is RDP not working on remote server? ›

If remote desktop is not working, connection problems may be the cause. Especially public networks can be a problem. Windows blocks these from time to time to increase the security of the end device. If this is the reason why remote desktop is not working, the network should be changed from public to private.

How do I troubleshoot Azure AD connectivity? ›

Use the ipconfig command-line tool to check the Domain Name System (DNS) settings on the server. Confirm that you can ping the DNS server that's listed in the network properties on the problem computer. Run the nslookup command-line tool. If the DNS server is unreachable, you receive an error message.

Top Articles
Is this considered landlord harassment? what are my rights in this situation? what are the consequences of the landlord?
Can I Improve My Credit Score With a Utility Bill?
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Sen. Ignacio Ratke

Last Updated:

Views: 6022

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Sen. Ignacio Ratke

Birthday: 1999-05-27

Address: Apt. 171 8116 Bailey Via, Roberthaven, GA 58289

Phone: +2585395768220

Job: Lead Liaison

Hobby: Lockpicking, LARPing, Lego building, Lapidary, Macrame, Book restoration, Bodybuilding

Introduction: My name is Sen. Ignacio Ratke, I am a adventurous, zealous, outstanding, agreeable, precious, excited, gifted person who loves writing and wants to share my knowledge and understanding with you.