Autodiscover not working HTTP 401 Unauthorized

Alex Bedard 0 Reputation points
2025-05-06T02:44:30.5866667+00:00

Having trouble getting our autodiscover working, looks like it may have broken after the last major CU, but could have been earlier.

Exchange 2019 on latest CU, all roles on single server.

Did a rebuild of the virtual folder, certificates are all valid, services all running, but getting the same error.

Trying to access mail.contoso.com/autodiscover/autodiscover.xml prompts for a username and password but doesn't accept anything we enter.

Email and outlook is working fine otherwise.

Remote Connectivity analyzer response:

An HTTP 401 Unauthorized response was received from the remote Unknown server. This is usually the result of an incorrect username or password. If you are attempting to log onto an Microsoft 365 service, ensure you are using your full User Principal Name (UPN).
HTTP Response Headers: request-id: 1192a9f0-465c-4f7e-9ecd-417eaacaac39
X-OWA-Version: 15.2.1544.14
Server: Microsoft-IIS/10.0
WWW-Authenticate: Negotiate WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="autodiscover.contoso.com"

X-Powered-By: ASP.NET X-FEServer: EXCHANGE2019

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

Date: Tue, 06 May 2025 02:28:15 GMT

Content-Length: 0

Exchange | Exchange Server | Management
Exchange | Exchange Server | Management
The administration and maintenance of Microsoft Exchange Server to ensure secure, reliable, and efficient email and collaboration services across an organization.
{count} votes

2 answers

Sort by: Most helpful
  1. Amit Singh 5,306 Reputation points
    2025-05-06T03:56:09.28+00:00

    Hi @Alex Bedard , The issue is likely related to authentication settings on the autodiscover virtual directory or IIS config. Outlook works because it uses other methods, but web-based access (used by tools) is more sensitive to these settings. You can check these blog1 and blog2 for configure autodiscover service in Exchange Server and fix IIS virtual directory error.

    https://free.blessedness.top/en-us/powershell/module/exchange/set-autodiscovervirtualdirectory?view=exchange-ps

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    If the response is helpful, please click "Accept Answer" and upvote it.


  2. Justin Emlay 0 Reputation points
    2025-10-16T21:16:57.35+00:00

    I'm getting the same thing. Going through everything to start a hybrid migration. What I noticed is the Microsoft Remote Connectivity Analyzer is now junk. I keep getting random results for the same mailbox. Anywhere from SSL is no good, to port 443 is closed to OOF is set (which it is not). Never had a problem with the tool before now. It also hard fails on the first 401. Same deal with Test-OutlookWebServices. I can run it many times over and half the time it fails while the other half of the time it passes without issue. You really get a feel for it with Outlook's Test Email Configuration. That one runs instantly. So I can sit there and rapid fire that test and I noticed I'll usually get one or two 401's then a success. So that one tries multiple times before it gives up. For a visual:

    401
    401
    200

    200

    200

    401
    200

    401
    401
    200

    No clue what is going on. Absolutely zero config change. Everything runs 100% fine. Only changes are CU's. Microsoft messed something up that's for sure.

    I suggest using the Outlook tool before you chase ghosts from their bad online test tool.

    0 comments No comments

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.