You're staring at STATUS_INVALID_ACCOUNT_NAME (0xC0000062)
I get it — you entered what you thought was a perfectly valid username, and Windows just shrugged. This error usually pops up during login, application access, or when running a command that authenticates against an account. The message "The name provided is not a properly formed account name" is Microsoft's way of saying the format is wrong, not that the account doesn't exist. Let's fix it without wasting time.
First, Check the Account Name Format
This is the most common cause. Windows expects account names in one of two formats:
- Down-Level Logon Name:
DOMAIN\UserName(backslash, not forward slash). Example:WORKGROUP\JohnorCONTOSO\jsmith - User Principal Name (UPN):
user@domain.com(only for domain-joined machines or Microsoft accounts)
If you typed username@local or COMPUTERNAMEusername (missing the backslash), that's your problem. For a local account, use COMPUTERNAME\Username. To find your computer name, run hostname in a command prompt.
Real-world trigger: I see this most often when someone copies a username from an email signature that includes a space or a comma — Windows chokes on those. Also, when using RunAs or net use commands, the separator matters.
If Format Is Correct, Check for Typos and Special Characters
Windows allows most special characters in usernames, but there are hard no-goes: backslash (except as domain separator), forward slash, angle brackets, pipes, and double quotes. If your username contains any of these, you'll get the error. Also, trailing spaces — people miss them all the time. Use echo "%USERNAME%" to see the exact string.
Still Broken? It Might Be a Domain or Trust Issue
If the account is a domain account, the error can appear when the computer can't contact the domain controller or when the trust relationship is broken. This is common after a password change on the machine account or a time sync failure. Try these steps in order:
- Verify the domain name is correct — use the NetBIOS name (e.g.,
CONTOSO) not the DNS name (contoso.com) for the down-level format. - Run
nltest /dsgetdc:DOMAINto see if the machine can find a domain controller. If it fails, you have a network or trust issue. - Reset the machine account password with
netdom resetpwd /server:DC /userd:DOMAIN\Admin /passwordd:*from an elevated prompt. This requires admin rights on the domain. - If trust is completely broken, rejoin the domain — remove it, reboot, re-add it.
The Weird Registry Edge Case (Advanced)
On older Windows versions (Windows 7, Server 2008 R2), there's a registry key that can cause this error even with perfect formatting. Look in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa for a value called LimitBlankPasswordUse. If it's set to 1 and you're trying to use a blank password account (local or guest), Windows will reject the name. Set it to 0 to allow blank passwords — but please don't do that unless you understand the security implications. Better to give the account a password.
Less Common Variations
Here are a couple I've seen on my help desk blog comment section:
- Group Policy Block: A domain GPO can restrict which account name formats are allowed. Check
Network access: Allow anonymous SID/Name translationinsecpol.msc. - Application-Specific: Some older apps (I'm looking at you, SQL Server 2008) expect the UPN format but use it internally wrong. Try the down-level format instead.
- Kerberos vs NTLM: If your app uses Kerberos, the UPN must match the SPN exactly. Mismatch gives this error. Use
setspn -L usernameto check.
How to Prevent This From Happening Again
Three things:
- Standardize account name formats in your organization. Train users to always use
DOMAIN\usernamefor network resources. - Audit for special characters in usernames at creation time. No spaces, no backslashes, no quotes. Keep it alphanumeric plus hyphens or underscores.
- Monitor domain trust health with a regular
nltest /sc_query:DOMAINscript. Catch trust issues before they trigger login errors.
That's it. You should be past the 0xC0000062 error now. If not, check the Event Viewer under Windows Logs > Security — look for event ID 4776 or 4625, which will give you the account name Windows actually tried to use. Sometimes the mismatch is right there in plain text.