Can't sign into your account when you try to connect to an Azure Windows VM

This article discusses how to troubleshoot the error "We can't sign into your account" when you try to connect to an Azure Windows VM using Remote Desktop Protocol (RDP).

Symptoms

When you try to connect the Windows VM using RDP, you receive the following error message:

We can't sign into your account
This problem can often be fixed by signing out of your account and then signing back in. If you don't sign out now, any files you create or changes you make will be lost.

In the Applications Event log, you see Event ID 1511 is logged for each RDP connection attempt.

ID: 1511
Level: Error
Source: Microsoft-Windows-User Profiles Service
Machine: RDPDemo.contoso.net
Message: Windows cannot find the local profile and is logging you on with a temporary profile. Changes you make to this profile will be lost when you log off.

Cause

The issue can occur if the local profile of the user is corrupt, and Windows is unable to create a new local profile for the RDP session.

Solution

Before proceeding with any of the solutions in this document, back up your VM OS disk by taking a snapshot. If you need to revert any changes made while troubleshooting, you can use the snapshot to recreate the disk.

Online repair by using Azure Serial Console

  1. Connect to the VM using the Azure Serial Console, then start a PowerShell session. If the Azure Serial Console doesn't work, connect to the VM using remote PowerShell. For more information, see How to use remote tools to troubleshoot Azure VM issues.

  2. After you connect to the VM, run the following command to list the user profiles entries. Locate any profiles that have the ".bak" extension on the end of the name.

    reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" /s | more
    
  3. Identify the profile entry for the affected user by looking at the value for the key "ProfileImagePath".

  4. Remove the user profile backup entry for the affected user (ends with ".bak"), do not remove entries for the built-in system accounts S-1-5-18, S-1-5-19, and S-1-5-20:

    reg delete "HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ProfileList\<GUID>.bak"
    
  5. Try to connect to the VM and see if the problem is resolved.

  6. If the problem still occurs, you can try removing the user profile entry for the affected user.

Offline repair

If you're unable to access the VM using the Azure Serial Console or other remote tools, then the repair must be done in offline mode.

  1. Follow the steps 1-3 of the VM Repair process to create a Repair VM. A copied OS disk of the failed VM will be attached to the Repair VM automatically. Usually the disk is attached as drive F.
  2. Connect to the Repair VM.
  3. On the Repair VM, start Registry Editor (regedit.exe). Select the HKEY_LOCAL_MACHINE key, select File > Load Hive from the menu. Locate and load the SOFTWARE hive file in the F:\Windows\System32\config folder, and then type RepairSOFTWARE as the name for the hive.
  4. Navigate to RepairSOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList.
  5. Identify the profile entry for the affected user by looking at the value for the key "ProfileImagePath".
  6. Remove the user profile backup entry for the affected user (ends with ".bak"), do not remove entries for the built-in system accounts S-1-5-18, S-1-5-19, and S-1-5-20.
  7. Use step 5 of the VM Repair process to mount the repaired OS disk to the failed VM.
  8. Start the failed VM and try to connect to the VM using RDP. If the problem continues to occur, you can try removing the user profile entry for the affected user.

Next steps

If your Azure issue isn't addressed in this article, visit the Azure forums on MSDN and Stack Overflow. You can post your issue in these forums, or post to @AzureSupport on Twitter. You also can submit an Azure support request.

To submit a support request, go to the Azure support page and select Get support.

Contact us for help

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.