none
The Autodiscover service couldn't be located. RRS feed

  • Question

  • Please help me out sruggling in this for a long time..

    error:  The Autodiscover service couldn't be located.
     my code is
    try
                {
                    // Connect to Exchange Web Services as user1 at contoso.com.
                    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010);
                    ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
                    service.Credentials = new WebCredentials("ews@MydomainName.com", "password");
                    //service.UseDefaultCredentials = true;
                    service.AutodiscoverUrl("ews2@MydomainName.com", ValidateRedirectionUrlCallback);
                    //service.Url = new Uri("https://serverName.DomainName.com/ews/Exchange.asmx"); 
                   
                    // Create the e-mail message, set its properties, and send it to user2@contoso.com, saving a copy to the Sent Items folder.
                    EmailMessage message = new EmailMessage(service);
                    message.Subject = "Interesting";
                    message.Body = "The proposition has been considered.";
                    message.ToRecipients.Add("ews1@MydomainName.com");
                    message.SendAndSaveCopy();

                    // Write confirmation message to console window.
                    //Console.WriteLine("Message sent!");
                    //Console.ReadLine();
                }
                catch (Exception ex)
                {
                    //Console.WriteLine("Error: " + ex.Message);
                    //Console.ReadLine();
                }

     


    i browsed-  https://MyserverName.DomainName.com/autodiscover/autodiscover.xml
     it displays

      <?xml version="1.0" encoding="utf-8" ?>
    - <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
    - <Response>
    - <Error Time="17:35:23.3125000" Id="3155127929">
      <ErrorCode>600</ErrorCode>
      <Message>Invalid Request</Message>
      <DebugData />
      </Error>
      </Response>
      </Autodiscover>

    please give me a right solution for this as soon as faster

    Tuesday, December 7, 2010 1:22 PM

Answers

  • Hi,

     

    Is there any error message when trying to open Exchange server or EMC?

     

    At this stage, I suggest you back up Exchange server database and try to reinstall .Net Framework 3.5 on the problematic machine.

     

    If there is any error message, please post it here for research. Also, please open Event Viewer and check whether there is any Event error. If so, please post it here.

     

    Thanks.

    Novak


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Novak Wu Friday, December 17, 2010 7:40 AM
    Monday, December 13, 2010 2:59 AM

All replies

  • Hiya,

    Do you have an autodiscover DNS record, such as autodiscover.domainname.com with an appropriate SSL certificate?

    Steve


    Steve Goodman
    Check out my Blog for more Exchange info or find me on Twitter

    Tuesday, December 7, 2010 2:09 PM
  • how do i check this whether it has autodiscover DNS record with appropriate SSL certificate?

    As im new to this i don have much knowlwdge in this

    please help me out

     


    shenbagaraj
    • Proposed as answer by Rommel D Friday, June 29, 2012 12:28 PM
    Wednesday, December 8, 2010 6:57 AM
  • Hi Shenbagaraj,

    A good first point of call is the Exchange Remote Connectivity Analyser.

    You should be able to test autodiscover, and it will let you know what doesn't look correct and why.

    Steve


    Steve Goodman
    Check out my Blog for more Exchange info or find me on Twitter

    Thursday, December 9, 2010 12:52 PM
  • Hi steve

       Its working well for me now i can programmatically send and receive mails.

    but when i tried to create users using powershell scripts WsManConnectioninfo class in missing in System.Management.Automation ...

    i uninstall it in GAC now im receiving error "mmc could not create snapin "   and could not open the exchange server and powershell can u help me out.. very urgent :-(


    shenbagaraj
    Friday, December 10, 2010 6:09 AM
  • i uninstall System.management.Automation from GAC and reinstall the dll which is in reference folder but now exchange server itself is not opening.
    shenbagaraj
    Friday, December 10, 2010 6:12 AM
  • Hi,

     

    Is there any error message when trying to open Exchange server or EMC?

     

    At this stage, I suggest you back up Exchange server database and try to reinstall .Net Framework 3.5 on the problematic machine.

     

    If there is any error message, please post it here for research. Also, please open Event Viewer and check whether there is any Event error. If so, please post it here.

     

    Thanks.

    Novak


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Novak Wu Friday, December 17, 2010 7:40 AM
    Monday, December 13, 2010 2:59 AM
  • Can you please provide the sample code of connection with Exchange Server....

    That will be a gr8 help for me..

    Thursday, December 23, 2010 8:06 AM
  • Can you please provide the sample code of connection with Exchange Server....

    That will be a gr8 help for me..


    Probably best to try a new thread in the Exchange development forums, and to be a little more specific with regards to what you're trying to achieve.

     

    Steve

    Steve Goodman
    Check out my Blog for more Exchange info or find me on Twitter

    Thursday, December 23, 2010 8:37 AM
  • Hi cshenbagaraj,

    Are you able to solve the issue?

    Please let me know. iam facing the same issue.

    Thanks in advance.


    Sandra
    Friday, January 21, 2011 10:19 AM
  • hi,

    I don't know how to get this enabled.. I am writing a powershell script that will move mail messages from Inbox to another folder for a specified user mailbox.. While trying for this, I got an error message..

    Exception calling "AutodiscoverUrl" with "2" argument(s): "The Autodiscover service could not be locat
    At C:\ad\MoveItems.ps1:244 char:27
    +         $service.AutodiscoverUrl <<<< ($Mailbox, {$True});
        + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : DotNetMethodException

    Can you please help me on this..

    Tuesday, June 4, 2013 3:05 PM
  • I pick up the same script from somewhere, to do the same. When i prepare my server (SBS2011 Standard) with .net 3.5 and EWS evrything looks fine.

    Starting the script about one month ago, it runs through without any errors. But from today, i pick this

    script the first time again after a while. The same error appeared:

    Exception calling "AutodiscoverUrl" with "2" argument(s): "The Autodiscover service could not be locat
    At C:\ad\MoveItems.ps1:244 char:27
    +         $service.AutodiscoverUrl <<<< ($Mailbox, {$True});
        + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : DotNetMethodException

    Maybe a patch run causes this problem. Auto update service is enabled on this server....

    greets

    CHN

    Friday, August 2, 2013 10:11 AM
  • I experienced this error:

    Connect-OSCEXOWebService : Exception calling "AutodiscoverUrl" with "2" argument(s): "The Autodiscover service couldn't be located."
    At line:1 char:1
    + Connect-OSCEXOWebService -Credential(Get-Credential exchange.service@ ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Connect-OSCEXOWebService], MethodInvocationException
        + FullyQualifiedErrorId : AutodiscoverLocalException,Connect-OSCEXOWebService
     

    It turned out, after some troubleshooting, that the error occurred because I had created a new account, exchange.service, to run the connect-OSCEXOWebService command, but I had the left the

     Make this user change their password when they first sign in

    box ticked in the account details.

    Once I un-ticked this box (and signed into the mailbox to double-check), the command ran without error.

     


    • Edited by GBSII Monday, February 13, 2017 12:56 PM
    Monday, February 13, 2017 12:53 PM
  • Hi Shenbagaraj,

    Could you please share the code how you were able to do this as I have tried all possible steps to send mails trough my code but its not working.

    Thanks,

    Suraj Singh

    Sunday, July 30, 2017 4:24 PM
  • In my case, my project was running under .net 4.5 and it was defaulting to using TLS 1.2 (which my Exchange server didn't support).  So I had to tell my program to use TLS 1.0 and then it started working.

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls

    Friday, July 27, 2018 8:57 PM
  • Give the Credentials only here like below mentioned 

    $Credentials= Get-Credential

    $Credentials= Get-Credential
    .\Remove-DuplicateItems.ps1 -Identity admin@M365n854236.onmicrosoft.com  -Credentials $Credentials -Retain Oldest -Type Mail -Impersonation -DeleteMode MoveToDeletedItems -Mode Full -Verbose

    .\Remove-DuplicateItems.ps1 -Identity admin@M365n854236.onmicrosoft.com -Credentials $Credentials -Type All -Impersonation -DeleteMode SoftDelete -Mode Quick -Verbose

    Wednesday, October 16, 2019 11:43 AM