Hi ,
I'm using EWS API 2.2 to interact with Exchange 2013.
I have several users on my exchange server and I've noticed that every time I tried to login it is taking too long between my users.
I have a loop for my users and for each one of them I'm reading their inbox.
The code that I use to connect is the below
ServicePointManager.ServerCertificateValidationCallback = New _
RemoteCertificateValidationCallback(AddressOf CertificateValidationCallBack1)
Dim Myexchange As New ExchangeService(Me.ExchangeVersion1)
Dim MyCredentialCache As System.Net.CredentialCache
MyCredentialCache = New System.Net.CredentialCache
Dim credential As ICredentials = CredentialCache.DefaultNetworkCredentials
If Me.UseDefaultCredentials = "N" Then
MyCredentialCache.Add(New System.Uri(Me.WebServiceUrl), _
Authentication_Type, _
New System.Net.NetworkCredential(UserName, PassWord,
Domain) _
)
Else
MyCredentialCache.Add(New System.Uri(Me.WebServiceUrl), Authentication_Type, credential)
End If
Myexchange.Credentials = MyCredentialCache
Myexchange.Url = New Uri(Me.WebServiceUrl)
If Me.UseTrace Then
Dim TC As New EWSTrace.TraceListener
TC.TracePath = Me.TracePath
Myexchange.TraceFlags = TraceFlags.All
Myexchange.TraceEnabled = True
Myexchange.TraceListener = TC
End If
MyExchangeService = Myexchange
Private Shared Function CertificateValidationCallBack1(ByVal sender As Object, ByVal certificate As System.Security.Cryptography.X509Certificates.X509Certificate, ByVal chain As System.Security.Cryptography.X509Certificates.X509Chain, ByVal sslPolicyErrors
As System.Net.Security.SslPolicyErrors) As Boolean
Return True
End Function
As you can see from above I'm using the default classic code which works of course.
But When I change between the users it will take me to authenticate two minutes to connect for each one of them.
Is it something that I must do in my exchange code or something that I must change in my exchange installation.
Everything is installed on my network , I'm not using something like office 365.
thank you