Skip to content

Est. 2011ยทMicrosoft Partner ID 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

Free Fix LDAP 49

LDAP 49 with data 52e: bind failures that are really bad credentials

11 min read Updated October 5, 2026 Windows Server: AD, DNS & Group Policy

Fix it now

LDAP error 49 only tells you the bind was refused. The value printed after the word data in the same message is a Windows status code in hexadecimal, and that is the diagnosis: 52e is a wrong password, 525 is an account the directory could not find, 530 and 531 are policy refusing the logon.

Run these against the domain controller the application actually binds to, replacing <name>

Get-ADUser <name> -Properties Enabled,LockedOut,PasswordExpired,PasswordLastSet,BadLogonCount
Get-ADUser -Filter "sAMAccountName -eq '<name>'" -Server dc01.contoso.com
Search-ADAccount -LockedOut
  1. Find the sub-code before you change anything. It is the short hexadecimal value after data in the extended message, and it is a Windows status code: 52e is 1326 ERROR_LOGON_FAILURE, 525 is 1317 ERROR_NO_SUCH_USER, 530 is 1328 ERROR_INVALID_LOGON_HOURS, 531 is 1329 ERROR_INVALID_WORKSTATION.
  2. For 52e, prove the password before resetting it. Bind by hand with the LDAP test tool from the AD DS administration tools, over SSL on TCP 636, using the exact credential string the application sends.
  3. For 525, change the shape of the bind identity rather than the password. Try the distinguished name, then the user principal name, then the down-level domain and account name, and stop at the first that binds.
  4. Once you know which one it is, update the credential everywhere the application holds it – configuration file, service logon account, saved connection – and restart the service so it stops replaying the old value.

Failed binds count towards account lockout like any other failed logon. If the application is retrying on a timer, stop it before you start testing, or you will spend the afternoon unlocking the account you are trying to fix.

If the bind now succeeds you are done. If not, the next section explains what each part of that error message is and why only one part of it is worth reading.

Why it happens

The protocol result is LDAP 49, which Microsoft publishes as LDAP_INVALID_CREDENTIALS, 0x31, “The supplied credential is invalid.” That is all the standard allows a directory to say. Returning anything more precise would let an unauthenticated caller work out which account names exist, so every refusal – wrong password, disabled account, wrong logon hours – comes back as the same number.

Active Directory attaches a Windows-specific extended message alongside it, and that message has three parts. The leading eight-digit value is a security status: 0x80090308 is SEC_E_INVALID_TOKEN, “The token supplied to the function is invalid”, and 0x8009030C, SEC_E_LOGON_DENIED, “The logon attempt failed”, turns up in the same position. Then a DSID, which is an internal source location. Then data and a short hexadecimal value.

That last value is the one that matters, and it is not an arbitrary directory code. It is a Windows status code written in hexadecimal, which is why the readings hold up: 52e is 1326, the ordinary bad-password failure; 525 is 1317, no such account; 530 is 1328, time restrictions; 531 is 1329, this account may not sign in to this computer. Read it that way and the message stops being a wall of hex and becomes a single answer.

The practical consequence is that 52e and 525 send you to two different people. A 52e is a credential problem and belongs with whoever owns the application’s stored password. A 525 usually is not a directory problem at all – the account exists, but the application is asking for it by a name or in a place the directory cannot match.

The stored credential is out of date

You have this one if Sub-code 52e, and the failures started at a password change, a rotation run or a migration rather than at a code change.

  1. Confirm the password by binding manually with the same account, over SSL on port 636, before you reset anything.
  2. Update the credential in every place the application keeps it. A configuration file and a service logon account are commonly both set, and changing one leaves the other failing.
  3. Restart the application or service so it drops the cached value.
  4. Watch the account afterwards: Get-ADUser <name> -Properties LockedOut,BadLogonCount should stop climbing.

If the account is already locking repeatedly, deal with that first. A service retrying every 30 seconds against a domain with a low lockout threshold will interrupt every test you run.

The bind identity is in a form the directory cannot resolve

You have this one if Sub-code 525, and the same password works elsewhere or in a browser sign-in.

  1. Try each accepted form by hand until one binds: the full distinguished name, the user principal name, or the down-level domain and account name.
  2. Confirm the account exists where you are looking: Get-ADUser -Filter "sAMAccountName -eq 'svc_app'" -Server dc01.contoso.com
  3. If the application is configured with a search base, confirm the account sits inside it.
  4. Set the application to whichever form worked, and write it down for whoever does this next.

Logon hours or a workstation restriction is refusing the bind

You have this one if Sub-code 530 or 531, and the failures follow a clock or a particular server rather than a password change.

  1. For 530, open the account in Active Directory Users and Computers and widen the logon hours if the service legitimately runs outside them.
  2. For 531, add the machine the application runs from to the account’s list of permitted computers, or clear the restriction if it no longer means anything.
  3. A service account running on several servers needs every one of those servers listed, including any node of a cluster.
  4. Retry from the same host once the change has replicated to the domain controller the application uses.

The application is binding to the wrong directory or the wrong port

You have this one if Sub-code 525 for every account you try, including ones you can see plainly in the console.

  1. Check which server and port the application is using. TCP 389 and 636 reach a domain controller for its own domain; TCP 3268 and 3269 reach a global catalog, which holds a partial view of every domain in the forest.
  2. Confirm the search base matches the domain the accounts actually live in.
  3. In a multi-domain forest, point the application at a global catalog if it needs to find accounts outside the domain controller’s own domain.
  4. Retest by hand against the same server and port before changing the application again.

Full reference

The sub-code table, and where each number comes from

data value Windows status code What it means Where the fix belongs
52e 1326 ERROR_LOGON_FAILURE The user name or password is incorrect The credential the application stores
525 1317 ERROR_NO_SUCH_USER The specified account does not exist The bind identity format, or the directory being searched
530 1328 ERROR_INVALID_LOGON_HOURS The account has time restrictions that prevent signing in right now The logon hours on the account
531 1329 ERROR_INVALID_WORKSTATION This user is not allowed to sign in to this computer The permitted-computers list on the account
532 1330 ERROR_PASSWORD_EXPIRED The password for this account has expired The account, not the application
533 1331 ERROR_ACCOUNT_DISABLED The account is currently disabled The account, not the application

Microsoft publishes those status codes; it does not publish a page that maps the LDAP data field onto them. The mapping is reliable because the values are the status codes written in hexadecimal, but treat any list that gives a sub-code a meaning with no matching Windows status as guesswork.

Ports, and which one you should be testing on

Port Service What you reach
389/TCP and UDP LDAP A domain controller, its own domain only
636/TCP LDAP over SSL The same, inside TLS
3268/TCP Global catalog LDAP A partial, forest-wide view
3269/TCP Global catalog LDAP over SSL The same, inside TLS

Test on 636. A simple bind on 389 sends the password with no protection at all, and a domain controller configured to require signing will refuse it outright with LDAP 8 rather than telling you anything about the credential – which sends you off diagnosing a password that was never the problem. If you do need a plain 389 bind to reproduce something, do it deliberately, briefly, and put it back.

Reproducing the bind by hand

  1. Install the AD DS administration tools if they are not already present, which is where the LDAP test tool ships.
  2. Connect to the domain controller by name on port 636 with SSL selected. If the connection itself fails, the problem is the certificate or the network, not the credential.
  3. Bind with the exact string the application sends, character for character, including domain prefixes and trailing spaces.
  4. Read the whole error, not the summary line. Applications routinely print “invalid credentials” and discard the extended message containing the answer.
  5. Repeat with each identity form in turn if you are chasing a 525.

When the sub-code says 52e and the password is definitely right

  • Check for a trailing space or a smart quote in the stored value. Configuration files copied out of a document carry both.
  • Check that the application is not URL-encoding or truncating the password. Long passwords with punctuation are where this shows up.
  • Check whether the account was reset with the change-at-next-logon flag set, which produces 773 rather than 52e but is often reported to you as “the password is wrong”.
  • Check you are testing against the same domain controller. A password change that has not replicated yet gives a genuine 52e on one server and success on another.
  • Confirm the account is not locked: Search-ADAccount -LockedOut returns everything currently locked out in the domain.

What not to do with this message

Do not relay the extended message back to an unauthenticated user. The whole reason LDAP 49 is deliberately vague is that a precise answer confirms which account names exist, and an application that helpfully prints the sub-code on a sign-in page has undone that for you. Keep it in your own logs and in diagnostic sessions.

Do not reset the password as a first move on a 52e. A reset that is not co-ordinated with the application’s stored copy turns one failing service into two, and on a service account shared by several systems it can take the rest out with it. Prove the credential by binding manually first; if the manual bind succeeds, the password is right and the application is sending something else.

Every code this article covers

Code What it points at Source
LDAP 49 LDAP_INVALID_CREDENTIALS, 0x31: the supplied credential is invalid. Every bind refusal arrives as this code regardless of the real reason Microsoft Learn
LDAP 52e Windows status 1326, ERROR_LOGON_FAILURE: the user name or password is incorrect Microsoft Learn
LDAP 525 Windows status 1317, ERROR_NO_SUCH_USER: the specified account does not exist Microsoft Learn
LDAP 530 Windows status 1328, ERROR_INVALID_LOGON_HOURS: the account has time restrictions that prevent it signing in now Microsoft Learn
LDAP 531 Windows status 1329, ERROR_INVALID_WORKSTATION: this user is not allowed to sign in to this computer Microsoft Learn
0x80090308 SEC_E_INVALID_TOKEN: the token supplied to the function is invalid. It is the security status at the front of the message and it narrows nothing; 0x8009030C, SEC_E_LOGON_DENIED, appears in the same position Microsoft Learn

Confirm the fix worked

  1. A manual bind over SSL on port 636 succeeds with the exact credential and identity form the application is configured with.
  2. The application restarts and connects without writing a new error.
  3. Get-ADUser <name> -Properties LockedOut,BadLogonCount shows the counters no longer climbing.
  4. Search-ADAccount -LockedOut does not list the account an hour later.
  5. The domain controller stops logging failed logons for that account from that client address.

Questions people ask about this

Does fixing this cost anything?

No. Reading a sub-code, correcting a bind identity format and updating a stored password are all free and use tools you already have. Nothing about LDAP 49 is a licensing problem.

Why does the application say invalid credentials when the account is only disabled?

Because at the protocol level every one of these refusals is LDAP 49. The directory does not use a separate result code for account state; it puts the detail in the extended message, which is exactly why the sub-code is worth reading.

Can I stop Active Directory returning the sub-code?

Not by configuration, and you would not want to – it is the only diagnostic you have. What you can control is whether your own application passes the message on to end users, and it should not.

Is testing binds by hand safe in production?

Yes, in the sense that a bind changes nothing. It is not free of consequences though: failed test binds count towards lockout exactly like the application’s own, so watch the counter while you work.

The sub-code is 525 but I can see the account in the console. What now?

You are almost certainly asking the wrong directory or asking in the wrong form. Check the server and port the application uses, check the search base, and try the distinguished name, the user principal name and the down-level name in turn.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

Free Fix Event ID 1056: DHCP has no credentials for dynamic DNS registration on a DC Free Fix Event ID 5313: GPOs filtered out and never applied to the target computer Free Fix Error 8453 replication access denied: repairing AD replication permissions License Error Event ID 5827: Netlogon blocks vulnerable secure channel connections
โ† Back to Knowledge Base