Exchange ошибка 401

Проблемы

Microsoft Outlook несколько раз запросит учетные данные пользователей, даже если они введите правильные учетные данные. На стороне клиента (Outlook 401″ сообщение об ошибке с кодом состояния HTTP. Некоторые пользователи успешно устраняют эту проблему, масштабирование контроллеров доменов.

Решение

Чтобы устранить эту проблему, установите следующее обновление:

Накопительный итог обновления 11 Exchange Server 2019 г. или более поздней версии накопительного Exchange Server 2019 г.

Ссылки

Узнайте о терминологии, используемой корпорацией Майкрософт для описания обновлений программного обеспечения.

Нужна дополнительная помощь?

Нужны дополнительные параметры?

Изучите преимущества подписки, просмотрите учебные курсы, узнайте, как защитить свое устройство и т. д.

В сообществах можно задавать вопросы и отвечать на них, отправлять отзывы и консультироваться с экспертами разных профилей.

  • Remove From My Forums
  • Question

  • We are getting some autodiscover errors on our Exhcange server 2007 box.  We have SBS 2008 Premium and have 1 box running ‘SBS’ which is the domain controller and Exchange server and second box that runs Server 2008 and SQL.  Outlook, ActiveSync,
    OWA are all working fine, we are having trouble with our spam software though.  It is VIPRE Email security, formally called Ninja.  I worked with their support and we determined it is a Autodiscover issue.  When we run test-outlookwebservices
    we get this error: The remote server returned an error: (401)   Unauthorized.  

    I have read a bunch on the topic and found a few things and it seems most everyone is getting around it by disabling the loopback check but that does not appear to be the best, the most secure or the reccomended solution.  What
    is the best way to fix this??  Do I need another cert??  I have one GoDaddy Cert already for our external domain name so we don’t get cert errors when using OWA.

    Thanks for any help.

Hey SW community,

I know that there have been a few topics discussing this issue already, but none of the solutions fixed it so far for me. I have the feeling it’s probably an easy fix but I can’t see it. I’ve been trying for a week to fix it.

We’ve published our Exchange 2016 directories (on Windows Server 2016) through nginx (on Ubuntu 20.04.1 LTS). We’re using Exchange Version 15.1 ‎(Build 2044.4)‎, should be the newest CU, iirc. OWA is accessible from external locations and works fine.
Autodiscover doesn’t want to work tho. Internal autodiscover works fine again, but the external autodiscover shows the following error (MS connectivity analyzer):

Attempting to send an Autodiscover POST request to potential Autodiscover URLs.
Autodiscover settings weren’t obtained when the Autodiscover POST request was sent.
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 Office 365 service, ensure you are using your full User Principal Name (UPN).

All other test steps succeed:

— Attempting to resolve the host name
— Testing TCP port 443 on host
— Testing the SSL certificate
— Checking the IIS configuration

I tried to play with the authentication settings of the autodiscover virtual directory but that broke the internal outlook connection (constant password prompts). Also deleted and recreated my autodiscover vd. Test-OutlookWebServices works.

I’ve also looked at the following threads:

— https://community.spiceworks.com/topic/2198860-exchange-2016-autodiscover-failure-401-unauthorized-s… (Created BackConnectionHostNames but that didn’t really do anything besides unbinding my back end certifiate for exchange)
— https://social.technet.microsoft.com/Forums/ie/en-US/f1c6b257-6d8c-4701-87c8-d332cb17cbc7/exchange-2… Opens a new window — (Kernel mode was already disabled)
— https://www.reddit.com/r/exchangeserver/comments/75p99q/autodiscover_401_issues/ Opens a new window (Reset virtual directory)

I receive the expected error 600 response when opening the autodiscover URL directly (internal). When opening the URL from an external connection, the site will ask for a password over and over again, but won’t proceed to the XML.
The same behaviour occurs in Microsoft Outlook 2016 and when opening the EWS URL directly, it’ll ask for a password constantly but won’t connect.

It just screams authentication settings into my face but I don’t see what I can and can’t change to make this work.

Does anyone here maybe have an idea?

Cheers!
Max

PS, this is the full MS protocol:

Attempting to send an Autodiscover POST request to potential Autodiscover URLs.
Autodiscover settings weren’t obtained when the Autodiscover POST request was sent.

The Microsoft Connectivity Analyzer is attempting to retrieve an XML Autodiscover response from URL https://autodiscover.domain.tld:443/Autodiscover/Autodiscover.xml Opens a new window for user user@domain.tld.
The Microsoft Connectivity Analyzer failed to obtain an Autodiscover XML 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 Office 365 service, ensure you are using your full User Principal Name (UPN).
HTTP Response Headers:
Connection: keep-alive
request-id: b930db52-7615-44cd-9ea3-7d7da35540af
Content-Length: 0
Server: Microsoft-IIS/10.0
WWW-Authenticate: Basic realm=»autodiscover.domain.tld»
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
X-Powered-By: ASP.NET
X-FEServer: SVEXC001
Date: Wed, 12 Aug 2020 05:58:10 GMT

  • Remove From My Forums
  • Question

  • Hello,

    I am trying to create appointment from Exchange Web Service, If I am trying to login to exchange server from URL then its working and allowing me to login to my exchange server but if I am trying to connect from my C# application then I am getting this error «The
    request failed. The remote server returned an error: (401) Unauthorized.»

    My current code is as below:

    ExchangeService service = new ExchangeService();
    service.Credentials = new WebCredentials("XXXusername", "pwd", "exchange.domain.com");
    
    service.Url = new Uri("https://exchange.domain.com/EWS/Exchange.asmx"); 
    Appointment appointment = new Appointment(service);
    appointment.Subject = "Status Meeting";
    appointment.Body = "The purpose of this meeting is to discuss status.";
    appointment.Start = new DateTime(2017, 1, 30, 9, 0, 0);
    appointment.End = appointment.Start.AddHours(2);
    appointment.Location = "Conf Room";
    appointment.RequiredAttendees.Add("xyz@domain.com");
    appointment.Save(SendInvitationsMode.SendToNone);

    If I am trying to login from url and its also working fine.
    exchange.domain.com
    username — XXXusername
    pwd — «pwd»

    Also I have tried to login web service from URL and its work for me.

    Please anyone suggest what’s the wrong with C# code and how I can make working it.

    Thanks.

Answers

  • You credentials aren’t specified correctly you should use either downlevel format which is domainusername which would be

    service.Credentials = new WebCredentials("XXXusername", "pwd");

    (Note you don’t specify the domain as you have already included it in the downlevel format)

    or use

    service.Credentials = new WebCredentials("username", "pwd","XXX");

    (Where XXX is the NetBIOS domain name not the FQDN like you have used) this is recommended method because of potential issue with UPN suffixes

    https://support.microsoft.com/en-us/help/2933452/-401-unauthorized-error-when-you-use-an-ews-application-to-impersonate-a-user-in-office365-dedicated-itar

    or use the Active Directory User Principal name which includes the domain name eg

    service.Credentials = new WebCredentials("username@upndomain.com", "pwd");

    Cheers
    Glen

    • Marked as answer by

      Tuesday, January 31, 2017 5:49 PM

When I try sending email using the EWS API, I get the following error: (in message.Send();)

The request failed. The remote server returned an error: (401) Unauthorized.

My code is the following:

ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2007_SP1);

//WebService Uri
try
{
    exchangeService.Url = new Uri("https://exchangeserver/ews/exchange.asmx");
}
catch (Exception ex)
{
    throw new Exception(string.Format("WebService Uri:" + ex));
}

//Credentials
try
{
    exchangeService.Credentials = new WebCredentials("user@domain", "pwd", "domain");
}
catch (Exception ex)
{
    throw new Exception(string.Format("Credentials:" +  ex));
}

//Send a mail
try
{
    EmailMessage message = new EmailMessage(exchangeService);
    message.Subject = "Test";
    message.Body = "Test";
    message.ToRecipients.Add("destination@domain");
    message.Save();
    message.Send();
}
catch (Exception ex)
{
    throw ex;
}

I read other posts on this site concerning this issue but they couldn’t resolve my issue.

Shadow The Spring Wizard's user avatar

asked Nov 22, 2012 at 17:07

GwenGuts's user avatar

2

Try changing this:

 exchangeService.Credentials = new WebCredentials("user@domain", "pwd", "domain");

into this:

 exchangeService.Credentials = new WebCredentials("user", "pwd", "domain");

Sometime the Login credentials depends on how Exchange/Active Directory it’s configured.
It could be user@domain or domainuser

answered Nov 22, 2012 at 17:22

Carlos Landeras's user avatar

Carlos LanderasCarlos Landeras

11k11 gold badges56 silver badges82 bronze badges

2

In my case, I needed to add to the EWS Virtual Directory under the IIS site the list of allowed URLs.

  1. Go to the IIS management, click the EWS node, under the Default Web Site, then double-click the Request Filtering.

  2. Go to the URL tab, and on the right, click Allow URL.

  3. Enter the URLs by which you will invoke the service, e.g. example.com/ews/ or server.example.com/ews/

In addition, related to similar issues, I needed to add all hosts (*) to the winrm trusted host (by default it had only the local IP listed).

TylerH's user avatar

TylerH

20.7k65 gold badges73 silver badges98 bronze badges

answered Jan 22, 2014 at 17:30

KirilStankov's user avatar

This issue can cause the two way authentication provide by Microsoft office 365. Better create a app password and pass that instead of outlook password.

exchangeService.Credentials = new WebCredentials("email", "app-pwd");

alexander.polomodov's user avatar

answered Jul 5, 2018 at 7:47

KSampath's user avatar

1

Понравилась статья? Поделить с друзьями:
  • Exchange ошибка 1003
  • Exchange ошибка 0x80070005 0x0004dc 0x000524
  • Exchange обнаружена ошибка сертификата безопасности прокси сервера
  • Exchange server ошибка
  • Exchange 2016 ошибка установки