KRB_AP_ERR_MODIFIED Error Code

Admin Jerad 20 Reputation points
2026-11-26T20:50:56.0033333+00:00

Hi Microsoft support team, I have this issue Incorrect or duplicate Service Principal Name but when I check, everything seems fine. Any where else to check this from?

Windows for business | Windows Server | User experience | Authentication with Azure Virtual Desktop
0 comments No comments

2 answers

Sort by: Most helpful
  1. Ronald Sabiiti 2,970 Reputation points Independent Advisor
    2026-11-26T21:28:06.3233333+00:00

    Hello Jerad,

    KRB_AP_ERR_MODIFIED typically indicates an SPN mismatch, duplicate SPN, or incorrect service account configuration.

    Please verify the SPN registration and check for duplicates:

    setspn -Q <SPN>
    setspn -X
    klist purge
    

    If the SPN is registered to the wrong account, remove it and register it to the correct service account. Ensure AD replication has completed before testing again.

    References:

    Hope this helps!

    Ronald.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-11-26T20:51:47.5066667+00:00

    Identify the exact SPN in Kerberos Event ID 4, then query that SPN forest-wide rather than relying only on the SPN list displayed for the expected server or service account.

    KRB_AP_ERR_MODIFIED means the target could not decrypt the service ticket; duplicate SPNs are only one possible cause. An SPN assigned to the wrong account, use of an unexpected DNS alias, an account-key mismatch, clock skew, or an encryption-type mismatch can produce the same error.^1^

    1. Find the SPN that is actually failing

    On the affected client:

    1. Open Event Viewer → Windows Logs → System.
    2. Find Kerberos, Event ID 4 for the failed connection.
    3. Record:
      • Server name
      • Target name/SPN, such as TERMSRV/host.contoso.com, HOST/host.contoso.com, or cifs/host.contoso.com
      • Any related Kerberos or KDC events from the same timestamp

    Run the ticket test from the affected user’s session—not from a different administrator session:

    klist
    klist get <service-class>/<exact-hostname>
    klist
    

    Use the exact hostname or alias used by the AVD client or application. A ticket requested for the server’s canonical name does not validate a connection made through an alias.

    2. Search for the exact SPN across AD

    From an elevated command prompt on a domain controller:

    setspn -Q <exact-SPN>
    setspn -L <DOMAIN\ExpectedAccount>
    

    For multiple trusted forests, run:

    setspn -X <exact-SPN>
    

    The requested SPN must resolve to the account that actually runs the service. Depending on the service, that can be the session host’s computer account or a custom service account. A custom-account SPN must be unique across the forest—and across associated forests in a multi-forest environment. Microsoft documents Enterprise Administrator permissions for these searches.^2^

    If the SPN is on the wrong account, correct only that entry:

    setspn -D <exact-SPN> <WrongAccount>
    setspn -S <exact-SPN> <CorrectAccount>
    

    Use -S, not -A, because -S checks for duplicates before adding. Removing the wrong SPN is potentially disruptive, so first verify which identity the target service is currently running under. An SPN on the wrong AD object causes the KDC to encrypt the ticket with that object’s key, which the actual server cannot decrypt.^3^

    3. Check whether the client is reaching a different computer

    From both the affected AVD session host/client and the target server, test the exact name from Event ID 4:

    nslookup <exact-target-name>
    nltest /dsgetdc:<domain-name> /force /kdc
    

    Check for:

    • A stale DNS record
    • A CNAME or load-balanced name resolving to an unintended host
    • Short name and FQDN resolving differently
    • An alias used by the application but absent from the intended SPN
    • Inability of either system to locate a domain controller

    Microsoft’s Kerberos checklist specifically calls for validating DNS from both the client and target, domain-controller availability, time synchronization, related events, and required network paths.^1^

    4. If this AVD deployment uses Microsoft Entra Kerberos

    This branch applies only if the connection uses a Cloud TGT or Microsoft Entra Kerberos—not ordinary AD DS Kerberos. In the affected user’s AVD session, run:

    dsregcmd /status
    klist cloud_debug
    klist get <service-class>/<server-fqdn>
    klist
    

    Review AzureAdPrt, CloudTgt, and—where applicable—OnPremTgt. If a valid service ticket is issued but the resource rejects it with KRB_AP_ERR_MODIFIED, check:

    • Whether the SPN belongs to the correct AD DS account
    • Whether an alias changed the requested SPN
    • Whether the synchronized Microsoft Entra Kerberos resource key still matches the current AD DS account key, particularly after an account-password change

    Ticket issuance alone does not prove the resource can decrypt the ticket. Microsoft Entra Kerberos documentation identifies stale synchronized resource keys as a distinct conditional cause.^4^

    If the SPN ownership, DNS target, ticket flow, and keys are all correct, correlate the client, session host, target server, and domain-controller Kerberos events for one failed attempt. Pay particular attention to Event IDs 4, 14, 16, and 27, because they distinguish decryption failures from clock and encryption-type problems.^1^


    References

    1. Kerberos authentication troubleshooting guidance
    2. Kerberos generates KDC_ERR_S_PRINCIPAL_UNKNOWN or KDC_ERR_PRINCIPAL_NOT_UNIQUE error
    3. Kerberos Service Principal Name on Wrong Account
    4. Troubleshoot Microsoft Entra Kerberos
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.