External User Lockouts and Continuous Login Pop-Ups

Alex Rodrigue 0 Reputation points
2025-11-03T18:01:11.5566667+00:00

I recently set up half of the users in my company to transition to a hybrid O365 environment, on-prem exchange with O365 licenses using Azure AD sync, but left some users fully on-prem. The fully on-prem users are having issues with Outlook consistently asking for their password, and locking them out in Active Directory when they enter the password. They are using Office 2019 and 2021.

I have cleared credential manager, and made the following registry changes with no luck: [HKEY_CURRENT_USER\Software\Microsoft\Exchange] "AlwaysUseMSOAuthForAutoDiscover"=dword:00000000 "ExcludeExplicitO365Endpoint"=dword:00000001 "ExcludeHttpsAutoDiscoverDomain"=dword:00000000 "ExcludeHttpsRootDomain"=dword:00000000 "ExcludeScpLookup"=dword:00000001

Any help would be greatly appreciated.

Exchange | Exchange Server | Other
Exchange | Exchange Server | Other
A robust email, calendaring, and collaboration platform developed by Microsoft, designed for enterprise-level communication and data management.Miscellaneous topics that do not fit into specific categories.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Teddie-D 7,260 Reputation points Microsoft External Staff Moderator
    2025-11-04T03:08:07.04+00:00

    Hi @Alex Rodrigue 

    Thank you for posting your question in the Microsoft Q&A forum. 

    When Azure AD Connect is enabled, Outlook may still attempt to query the Office 365 Autodiscover endpoint (autodiscover-s.outlook.com), even if the user isn’t licensed for Exchange Online. This happens because the user’s UPN now exists in Azure AD, which triggers parts of the Autodiscover process that target Office 365. 

    You were on the right track with your registry keys, but some settings still allow external HTTPS lookups. Specifically, setting ExcludeHttpsAutoDiscoverDomain and ExcludeHttpsRootDomain to 0 permits Outlook to reach out externally, which can redirect to Office 365 if your DNS or Autodiscover virtual directory isn’t properly isolated. Additionally, Office 2019/2021 can cache OAuth discovery behavior based on prior hybrid connectivity, which may contribute to persistent login prompts. 

    Here are some steps you can take to mitigate the issue: 

    1.Make sure that autodiscover.company.com (your primary SMTP domain) resolves only to your on-prem Exchange server for internal and external clients. 

    Run: nslookup autodiscover.company.com 

    If it resolves to Microsoft 365, update your public DNS to point to your on-prem Autodiscover service. 

    2.You can expand your Autodiscover exclusions to fully block cloud-based Autodiscover attempts for on-prem-only users, apply the following registry settings: 

    [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\AutoDiscover]  "ExcludeExplicitO365Endpoint"=dword:00000001  "ExcludeHttpsAutoDiscoverDomain"=dword:00000001  "ExcludeHttpsRootDomain"=dword:00000001  "ExcludeScpLookup"=dword:00000000  "ExcludeSrvRecord"=dword:00000000  "ExcludeLastKnownGoodUrl"=dword:00000000 

    3.Since you’ve already cleared Credential Manager, also reset Outlook profiles to remove any cached modern auth attempts: 

    -Close Outlook 

    -Run: %localappdata%\Microsoft\Outlook 

    -Rename the folder ̣(Before renaming the folder, make sure to back up the Signatures and RoamCache folders if you want to preserve your email signatures and autocomplete data.)

    -Recreate profile manually using Control Panel > Mail > Profiles > Add and set it as default. 

    4.If your Exchange on-prem still uses Basic or NTLM authentication (not Hybrid Modern Auth), ensure Outlook isn’t attempting OAuth. 

    Disable OAuth to prevent Outlook from attempting modern authentication: 

    [HKEY_CURRENT_USER\Software\Microsoft\Exchange] "AlwaysUseMSOAuthForAutoDiscover"=dword:00000000 

    And also: 

    [HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Identity]  "EnableADAL"=dword:00000000  "DisableADALatopWAMOverride"=dword:00000001 

    This forces Outlook to use legacy authentication for on-prem profiles. 

    I hope this helps resolve the login loop and lockout issues. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.  


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.