Connecting with Office 365-Autodiscover could not be located

Hi ,

I have built a VB project where I was using API 1.2 to connect to exchange server 2010 using webservices.

To be more specific , I was connecting in my Office 365 which had exchange 2010.

I was using the below code where the Me.ExchangeVersion1 is an enumaration.

1 for exchange 2007 ,etc... Exchange 2013 has number 4.

But I'm getting now in exchange 2013(office 365) and error which says.

The Autodiscover service couldn't be located.

 I'm changing the exchangeversion to 4 and leave the rest of the code intact.       

Am I doing anything wrong ?

I have asked a long time ago about if there will be changes between API 1.2 and API 2.0 and ,don't remember the name ,someone from Microsoft told me that no changes will be made unless you want to use new features of Exchange 2013 which I didn't want that. In other words , business as usual. Can anyone assist me on this ? Is it something that I need to look for ?Or change in my code ?

 Public Function GetBinding() As ExchangeService
        ' Create the binding.
        Dim service As New ExchangeService(Me.ExchangeVersion1)

        ' Define credentials.
        service.Credentials = New WebCredentials(UserName, PassWord)


        ' Use the AutodiscoverUrl method to locate the service endpoint.
        Try


            service.AutodiscoverUrl(UserName, _
                    New AutodiscoverRedirectionUrlValidationCallback( _
                        AddressOf MycustomClass.RedirectionUrlValidationCallback))


        Catch ex As AutodiscoverRemoteException
            Me.ErrorCode = -1
            Me.SetErrorMessage(ex.Message)
            Throw ex
        End Try


        Return service
    End Function

  ' Create the callback to validate the redirection URL.
    Private Shared Function RedirectionUrlValidationCallback(ByVal redirectionUrl As String) As Boolean
        ' Perform validation.
        Return (redirectionUrl = _
                "https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml")
    End Function


June 13th, 2013 12:19pm

Any ideas for what to look for ?
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2013 7:57am

The first thing would be to test AutoDiscover with the same credentials your using in https://www.testexchangeconnectivity.com/ (use the Office365 Tab)

The next thing would be to enable Tracing and look at the Autodiscover Traces to see where its failing http://msdn.microsoft.com/en-us/library/exchange/dd633676(v=exchg.80).aspx

Cheers
Glen

June 20th, 2013 10:23am

Hi Glen ,

I have already tried those.

Here is a strange thing that is happening. 

I'm performing a loop through all the exchange users I have.

I'm connecting to the first two users , everything works OK. I am able to read their inbox-es  , their emails etc...

When the loop is going to the third account I get the error for all the rest.

If I try after a while for the third account that I have the problem it is working!!!!. That means that the credentials , my code and everything else is correct.

I have a suspicion that the "Cloud" sees that after the second user someone is trying to hack it ???? and it locks ???? Is this possible ?

If I do this one user each time the code is working fine. The problem is that after the second user if I do this in one loop the cloud kind of Locks ??? Not sure though.

Is there any property that I can change , or a power shell command to avoid this ?

Until last last Wednesday I was able to work and loop through the users without problem. But something changed (don't know what ) in the cloud and I'm facing this issue.

I checked the autodiscovered service and I got this

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

Request error: The remote name could not be resolved: 'mycompany.onmicrosoft.com'

No Autodiscover endpoints are available for host myserver.onmicrosoft.com

But this is not accurate because If I login to the first user and wait , works , If I login to the second user and wait it works etc etc....

I run out of ideas.

Appreciate any help on this.

thank you

Free Windows Admin Tool Kit Click here and download it now
July 3rd, 2013 3:57am

What do the traces look like when its failing ?

It could be throttling by default you can't have any more then 10 simulatenous connections with one account. What you could try to do as a test is use Impersonation http://msdn.microsoft.com/en-us/library/exchange/gg194012%28v=exchg.140%29.aspx, this will mean the throttling budget of the mailbox your accessing will be charged rather then the service account your using. Are you using the same accout in other applications ?

You should be able to tell with the Traces why its failing, with 2013 you can bypass Autodiscover and just use the loadbalencer address https://outlook.office365.com/ews/exchange.asmx to test if this makes a differance http://blogs.msdn.com/b/mstehle/archive/2013/04/17/changes-in-managing-affinity-for-ews-subscriptions.aspx.

Cheers
Glen

July 3rd, 2013 7:01am

Hi Glen ,

I'm not using the same account in other applications. I have 20 exchange users and I'm connecting to the cloud in a loop. 

I'm only having one connection each time. I'm connecting one time ,  reading the inbox for one user (all the messages) , the sent items folder and then I set the MyExchangeService variable to null. Setting the service = nothing means that I'm disconnecting. Correct ?Then I'm taking the other user ,  connecting to the cloud , reading inbox, sent items etc etc.

Is there any other command for disconnecting ? I searched for "dispose" or "close" or "clear" but I didn't find any similar.That is why I used the MyService=nothing.

I cannot use 2013 because the company has 2010. Telling them to upgrade to 2013 has to do with the cloud service. They will have to contact with the provider , don't know how this will it cost etc etc etc....A lot of trouble if you understand my point.

I will try and use the impersonating user and see what happens.

I'll check and revert

thank you

Free Windows Admin Tool Kit Click here and download it now
July 4th, 2013 3:37am

What trace files do you want me to send you ?
July 4th, 2013 3:44am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics