Home Service Manager

New servers, problem with exchange connector

Service_Desk2Service_Desk2 Member IT Monkey ✭
edited October 2019 in Service Manager

Hi,

in our first step to upgrade to SCSM 2019 we installed new win 2019 servers and then changed the workflow server to the new server (still using scsm 2016 ur5)

And here the exhange connector broke because of "reasons" and we have now tried to reinstall the dll files and MP but we cant get neither exchange connector 3.0 or 3.1 to work.

i have enabled extended logging but it doesn't say that much

"Exchange Connector: Unable to validate credentials, please refer to the event logs for more information (Error Type=MissingMethodException, Message=Method not found: 'Microsoft.Exchange.WebServices.Data.FindItemsResults`1<Microsoft.Exchange.WebServices.Data.Item> "

the only things i can find when searching is that the versions of the DLL files are wrong.

according to this post i have the right versions for Microsoft.SystemCenter.ExchangeConnector.dll and Microsoft.SystemCenter.ExchangeConnector.Resources.dll but not for Microsoft.Exchange.Webservices.dll

https://support.microsoft.com/en-us/help/4089862/could-not-load-type-when-creating-exchange-connector-in-system-center

And the problem here is that i can't dowload the right version of Microsoft.Exchange.Webservices.dll (14.03.0067.001) anywhere.

Our old 2012r2 server had the version 14.03.0032.000 and when we install the only available EwsManagedApi from microsoft we get the version 15.00.0913.015

Anyone have any tips?

Best Answer

Answers

  • Service_Desk2Service_Desk2 Member IT Monkey ✭

    thank you very much! it worked great as soon as i got this dll

  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭

    Good to hear!

  • VikVik Member IT Monkey ✭

    @Konstantin_Slavin-Bo and @Service_Desk2 do you guys have the version 1.2 by any chance?

    I'm setting up SCSM 2012 R2 and the i still get the error " The connection to the server was unsuccessful. Please check the server name and/or credentials entered" I assume is the API version that is causing this.

  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭

    @Vik

    You're in luck! Except the fact that you're setting up SCSM 2012! 😋

  • VikVik Member IT Monkey ✭
    edited August 2021

    I know right?! 2012 R2 is eerrrrr....old.

    Thanks for the file @Konstantin_Slavin-Bo. Much appreciated. Do you happen to know which version of Exchange Connector does SCSM 2012 R2/Exchange 2013 require? I've got 3.0 and 3.1, just installed the API 1.2 but i get same error. 😔

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    edited August 2021

    I suppose the good news is that there is really only two DLLs to choose from. The aforementioned v1.2 or v2.2. But what's true in both cases is that I believe the error would be far more specific if it were a versioning issue.

    Most issues I've seen with Exchange connectors are the result of:

    • Issues with AutoDiscover requiring it to be hardcoded into the settings
    • Getting Impersonation (role) confused with Full Access (permission)
    • A firewall outside of the SCSM WF server blocking connectivity to Exchange on this API


    I've found the easiest test to perform is trying to connect with your own Inbox as a Run As Account. This helps eliminate some of scenarios above and gives you a way to compare a known working configuration against what you're trying to get setup.

    Alternatively, if you're more incline to PowerShell the following script demonstrates basic Exchange Connectivity by defining a connection via the DLL, and then displaying messages in the Inbox. This is a read-only operation so it will not jeopardize any subsequent runs of the Exchange Connector. You can try this with your own account and/or starting PowerShell as the account you are trying to configure in SCSM.

    #define the variables we'll need to connect, if you use impersonation instead of windows authentication you'll need to supply credentials
    $exchangeEWSAPIPath = "C:\Program Files\Microsoft\Exchange\Web Services\1.2\Microsoft.Exchange.WebServices.dll"
    $exchangeAuthenticationType = "windows"
    $workflowEmailAddress = "some.address@corp.net"
    $username = ""
    $password = ""
    $domain = ""
    $UseAutodiscover = $true
    #define the endpoint if $UseAutodiscover is set to $false
    $ExchangeEndpoint = ""
    
    #load Exchange Web Services assembly and define connection to Exchange
    [void] [Reflection.Assembly]::LoadFile("$exchangeEWSAPIPath")
    $exchangeService = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService
    $exchangeService.UseDefaultCredentials = $true
    $exchangeService.AutodiscoverUrl($workflowEmailAddress)
    
    #determine how to connect to Exchange based on the variables that were initially defined
    switch ($exchangeAuthenticationType)
    {
        "impersonation" {$exchangeService.Credentials = New-Object Net.NetworkCredential($username, $password, $domain)}
        "windows" {$exchangeService.UseDefaultCredentials = $true}
    }
    if ($UseAutoDiscover -eq $true) {
        $exchangeService.AutodiscoverUrl($workflowEmailAddress)
    }
    else {
        $exchangeService.Url = [System.Uri]$ExchangeEndpoint
    }
    
    #define search parameters, search on the defined message classes and get messages that are older than the current time
    $inboxFolderName = [Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox
    $inboxFolder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($exchangeService,$inboxFolderName)
    $itemView = New-Object -TypeName Microsoft.Exchange.WebServices.Data.ItemView -ArgumentList 1000
    $propertySet = New-Object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)
    $propertySet.RequestedBodyType = [Microsoft.Exchange.WebServices.Data.BodyType]::Text
    $dateTimeItem = [Microsoft.Exchange.WebServices.Data.ItemSchema]::DateTimeReceived
    $now = get-date
    $searchFilter = New-Object -TypeName Microsoft.Exchange.WebServices.Data.SearchFilter+IsLessThanOrEqualTo -ArgumentList $dateTimeItem,$now
    
    #load the items in the Inbox using the the $searchFilter from above, in this case - load ANY kind of message (calendar, encrypted, regular email, OOO, etc.)
    $inbox = $exchangeService.FindItems($inboxFolder.Id,$searchFilter,$itemView)
    
    #loop through the inbox
    foreach ($message in $inbox)
    {
        $message
    }
    
  • VikVik Member IT Monkey ✭

    I've tried with my account and workflow account and i get the same error.


  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭

    What are you connecting to?

    On prem or Outlook Online?

  • VikVik Member IT Monkey ✭
    edited August 2021

    On Prem, Exchange Server 2013. @Brian_Wiest

    So, workflow account:

    • Has mailbox in Exchange Server.
    • Is part of Domain Admins and Administrators
    • Part of local Admin in Server
    • EWS API 1.2 installed and dlls copied to SC folder.
    • Exchange connector 3.1 installed and Dlls copied to SC folder.
  • Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭

    Have you checked for any firewall/networking/routing rules that could be preventing you from accessing autodiscover or the specific URL set for the URI?

  • VikVik Member IT Monkey ✭

    I can access the url from Internet Explorer on Service Manager Server, so i take it that FW is not the issue.

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭

    Which URL? OWA or EWS? They are technically two different endpoints on Exchange.

  • VikVik Member IT Monkey ✭

    https://exchange.domain.com/ews/exchange.asmx can be accessed from the server. And Exchange server is set to accept the connection.

  • VikVik Member IT Monkey ✭

    So, i have added some registry keys so i can get some logs when creating the Exchange Connector and i get these:


    Exchange Connector: Connector ExMailProcessor failed to validate connection user=SMWorkflow, domain=ourdomain.co.uk, impersonation=: Message=The request to autodiscover the exchange server URL did not return a valid response. Please try again later or specify the URL manually. (Message: The Autodiscover service couldn't be located.)


    Exchange Connector: The request to autodiscover the exchange server URL did not return a valid response. Please try again later or specify the URL manually. (Message: The Autodiscover service couldn't be located.)

    Additional Details:

    Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException: The Autodiscover service couldn't be located.

      at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings[TSettings](String emailAddress, List`1 redirectionEmailAddresses, Int32& currentHop)

      at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetLegacyUserSettings[TSettings](String emailAddress)

      at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetLegacyUserSettings(String emailAddress, List`1 requestedSettings)

      at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(String userSmtpAddress, UserSettingName[] userSettingNames)

      at Microsoft.Exchange.WebServices.Data.ExchangeService.GetAutodiscoverUrl(String emailAddress, ExchangeVersion requestedServerVersion, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)

      at Microsoft.Exchange.WebServices.Data.ExchangeService.AutodiscoverUrl(String emailAddress, AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback)

      at Microsoft.SystemCenter.ExchangeConnector.ExchangeConnection..ctor(IExchangeConnectorLogger logger, String loginUsername, String loginDomain, String loginPassword, String impersonationEmailAddress, String serverUrl, Boolean onlyRedirectOffice365)

      at Microsoft.SystemCenter.ExchangeConnector.ExchangeConnection.ValidateConnection(IExchangeConnectorLogger logger, String loginUsername, String loginDomain, String loginPassword, String impersonationEmailAddress, String serverUrl, Boolean onlyRedirectOffice365, String& errorMessage)


    I know for a fact that Autodiscover is working as i used Linux with a EWS email client which pulled our exchange server config automatically.

  • VikVik Member IT Monkey ✭

    Hi Guys,

    Just deploying SCSM 2019. Whats is the current working version of Exchange Connector and EWS API for SCSM 2019, please?

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭

    They are -

    • Microsoft Exchange Connector 4.1
    • EWS 2.2
  • VikVik Member IT Monkey ✭
    edited January 2022

    Thanks @Adam_Dzyacky ,

    Do you happen to have EWS 2.2 in hand, or can point me to where to download, please? All are pointing to NuGet.

  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭

    It's included with Exchange Connector 4.1

Sign In or Register to comment.