Remote Desktop Connection Fails for Local Account on Domain Computer

I tried saving an RDP file with a prepopulated username to connect to a remote server using a local account on that server.  The local machine was an Azure AD joined to the same domain as the remote server.

Typically the username would be .\localuser or servername\localuser however in both cases the prefix is stripped out and the username shows up as simply localuser.  If you supply the correct password you get the error: The logon attempt failed

If you click the More choices button, you discover the username is now appended @domain.com.  If you choose the option for Use a different account, then add back the prefix from above the connection will be successful.  However I wanted the RDP file to do this step automatically.

The solution is to modify the RDP file using a text editor.

Find and modify the line username:s:value to be similar to the following:

username:s:servername\.\localuser

Then save and try the RDP file again. The username should correctly prepopulated with the prefix as .\localuser

 

 

Rename Windows 10 User Account Username and Profile Folder

This is a quick guide for changing both the login username and profile folder for a user account in Windows 10.

  1. Log in with an account that has administrator rights and is not the one you want to modify
  2. Computer Management -> Local Users and Groups ->Users
  3. Right click and rename the desired user
  4. Navigate to C:\Users
  5. Right click and rename the folder of the user account
  6. Open Registry Editor and locate the following:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
  7. Under ProfileList there are several keys corresponding to SIDs of various user accounts. Inspect each one, looking at the value of ProfileImagePath.  This stores the location of the profile folder, and one will have a value that matches what was renamed in step 4.
  8. Once located, right click on ProfileImagePath and choose Modify.
  9. Provide the new folder path and click OK
  10. Reboot to flush out any remaining references