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:
Then save and try the RDP file again. The username should correctly prepopulated with the prefix as .\localuser