Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Remote Desktop "Windows Security error: Your credentials did not work": check the account name format first

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

Microsoft's page on specific Remote Desktop errors for Windows virtual machines in Azure lists "Windows Security error: Your credentials did not work" with one cause: "The target VM can't validate your account name and password." Start with the account name you typed, because the server decides where to validate it from the part before the backslash.

Type ComputerName\UserName for a local account and DomainName\UserName for a domain account. If the server was promoted to a domain controller in a new forest, Microsoft says the local administrator account you signed in with is converted to a domain account and the local account is deleted. Sign-in with Microsoft Entra credentials has its own list of causes, covered below.

What the error means

Microsoft's page gives one cause: "The target VM can't validate your account name and password."

It says: "A Windows-based computer can validate the credentials of either a local account or a domain account." It gives the syntax for each:

  • For local accounts, use the ComputerName\UserName syntax (example: SQL1\Admin4798).
  • For domain accounts, use the DomainName\UserName syntax (example: CONTOSO\peterodman).

The page also warns about one case that changes the account list. If you promote a VM to a domain controller in a new Active Directory forest, "the local administrator account that you signed in with is converted to an equivalent account with the same password in the new forest and domain. The local account is then deleted." Its example is the local account DC1\DCAdmin, deleted when the machine was promoted for the corp.contoso.com domain, with a new domain account CORP\DCAdmin created with the same password.

Microsoft's pages are written for Windows VMs in Azure. They do not say whether the same text applies to servers hosted elsewhere, and they give no Windows version range.

Likely causes

Cause What you see How to confirm
The account name has no prefix, or the wrong one "Your credentials did not work" for an account that works elsewhere Compare what you typed with ComputerName\UserName or DomainName\UserName
The server was promoted to a domain controller in a new forest and you use the old local administrator name The old ComputerName\UserName fails, the domain form works Ask whether the machine was promoted; try DomainName\UserName with the same password
The password is wrong Fails for every form of the name Check the password for the account itself, not only at this prompt
Entra sign-in: the PC is not joined or hybrid joined to the same directory, or a registered PC leaves out the AzureAD\ prefix "Your credentials didn't work." Microsoft's list below
Entra sign-in: the AADLoginForWindows extension was uninstalled, or the policy for online identities is off, or the password is temporary, or a legacy per-user MFA setting is Enabled/Enforced Same message Microsoft's list below

A different message has a different cause. "This computer can't connect to the remote computer" is a sign-in rights problem: Microsoft's page says the account "does not have Remote Desktop sign-in rights", that every Windows computer has a Remote Desktop users local group with the accounts and groups that can sign in remotely, and that members of the local administrators group also have access. That message is not this one.

Another message has another cause. "An authentication error has occurred. The Local Security Authority cannot be contacted." means, in Microsoft's words, that "The target VM can't locate the security authority in the user name portion of your credentials." Microsoft explains that portion as the VM's computer name for a local account or the Active Directory domain name, so check its spelling.

Prove the cause before changing anything

None of these steps change the server.

  1. Read the name you typed, character by character. The part before the backslash must be the server's own computer name for a local account, or the domain name for a domain account.
  2. Try the same password with the other form of the name. If the server was promoted, the domain form is the one Microsoft's page describes.
  3. Ask whoever runs the server whether it was promoted to a domain controller.

Example (illustrative): at contoso.com.au the server dc01 was an ordinary server with a local account DC01\Admin1. After it was promoted to a domain controller in a new domain, the administrator keeps typing DC01\Admin1 and gets "Your credentials did not work." The password is unchanged, so the same password with CONTOSO\Admin1 is the form to try, as Microsoft's page describes for this case.

For an Entra-joined machine, Microsoft's Entra page says you can view the device and single sign-on state by running this (the page does not name the machine; run it on the PC that fails):

dsregcmd /status

Its stated goal is "AzureAdJoined : YES" and "AzureAdPrt : YES".

Fix

Local and domain accounts

Retype the name in the right form and the password. No change is made to the server. Microsoft's page says to "Make sure that the account name is a name that the virtual machine can verify as a valid account, and that the password is correct."

The same pages describe a password reset for the local administrator account in the Azure portal, and refer to a separate article for it. Microsoft's pages describe no way back to the old password.

Entra sign-in: "Your credentials didn't work."

Microsoft's Entra page writes the message as "Your credentials didn't work." and gives these solutions:

  • "The Windows 10 or later PC that you're using to initiate the remote desktop connection must be Microsoft Entra joined, or Microsoft Entra hybrid joined to the same Microsoft Entra directory."
  • A Microsoft Entra registered PC (not joined or hybrid joined) can start a connection from Windows 10 build 20H1, and then you "must enter credentials in the format AzureAD\UPN (for example, AzureAD\john@contoso.com)."
  • "Verify that the AADLoginForWindows extension wasn't uninstalled after the Microsoft Entra join finished."
  • The security policy "Network security: Allow PKU2U authentication requests to this computer to use online identities" must be enabled on both the server and the client. Microsoft's page gives no console steps for it, and a policy change belongs to whoever owns that policy.
  • "Verify that the user doesn't have a temporary password. Temporary passwords can't be used to sign in to a remote desktop connection."
  • Microsoft's page also says: "If you configure a legacy per-user Enabled/Enforced Microsoft Entra multifactor authentication setting and you see the error, you can resolve the problem by removing the per-user MFA setting." It gives no steps here, and the setting belongs to whoever owns the tenant.

For the temporary password, Microsoft says to sign in with the user account in a web browser, for instance to the Azure portal in a private browsing window, and, if prompted, set a new password.

Before the user does it, write down the account name and list everything that uses the old password.

Risk: setting a new password for the account replaces the old one at once. Anything that still uses the old password fails at its next sign-in with that account. There is no way back to the old password; the only recovery is to set another one.

Then the user signs in with the account in the browser, sets the new password when prompted, and tries Remote Desktop again. There is no way back from setting a new password.

A separate message on the same page, AADSTS293004, applies when the computer name typed into the Remote Desktop client does not match a host name attribute of the device. Microsoft's example is a short name like device_1 on the device and a fully qualified name typed in the client.

If the message on your screen is "The sign-in method you're trying to use isn't allowed", the cause is different, and Microsoft ties it to multifactor authentication.

Confirm the fix

  • Sign in again with the corrected name. The session should start.
  • For Entra sign-in, run dsregcmd /status on the PC that fails and confirm both values read YES.
  • If the sign-in still fails, the message may have changed. Read it again and match it to the table.

What to watch afterwards

  • Promotions. Microsoft says a promotion into a new forest converts the local administrator account to a domain account, so shared instructions that give ComputerName\UserName for that machine go out of date.
  • Passwords that were set as temporary.

Risks and limits

These commands have not been run or lab-tested.

Microsoft's pages describe Windows VMs in Azure and give no wider scope. The two messages differ in wording between pages, "did not work" and "didn't work", and are treated as separate entries. Local-account checks need an account that can already sign in or console access to the server.

Sources