none
Exchange 2010 hybrid env - upgrade to 2016 impossible - Get-OrganizationConfig - cannot import MSOnline

    Question

  • Context: Exchange 2010 SP3 (RU15) in hybrid deployment with Exchange Online (Office 365). I want to add Exchange 2016 CU3 to the environment. Imagine a scenario where we want to maintain a hybrid environment but sooner or later must migrate the on-prem servers to a later version of Exchange.

    When I attempt to run "setup /PrepareSchema /IAcceptExchangeLicenseTermsOrWhatever", I encounter this error:

    https://support.microsoft.com/en-us/kb/3121439

    It looks like I must run this command:

    "Get-OrganizationConfig | Export-Clixml -Path MyTenantOrganizationConfig.XML".

    This is where the problems start.

    I have WMF 4.0 installed on the Exchange 2010 servers (this is now compatible according to the support matrix):

    Apparently, EMS will still function in PS 2.0 mode (?).

    Anyway...

    If I attempt to connect to O365 in the EMS, the MSOnline module will not import:

    [PS] C:\>Import-Module MSOnline
    Import-Module : Could not load file or assembly 'file:///C:\Windows\system32\WindowsPowerShell\v1.0\Modules\MSOnline\Mi
    crosoft.Online.Administration.Automation.PSModule.dll' or one of its dependencies. This assembly is built by a runtime
    newer than the currently loaded runtime and cannot be loaded.

    On the other hand... I *can* connect to Office 365 using the "regular" PowerShell command line but... cannot run the Get-OrganizationConfig cmdlet (and no, adding the Exchange cmdlets fails):

    Rhoderick Milne addresses a nearly identical problem here:

    https://blogs.technet.microsoft.com/rmilne/2016/05/18/azure-ad-module-this-assembly-is-built-by-a-runtime-newer-than-the-currently-loaded-runtime-and-cannot-be-loaded/

    But I *do* have a newer version of WMF: 4.0 (in his blogpost, WMF 3.0 seems to solve the problem).

    How can I run Get-OrganizationConfig in these circumstances?

    Thank you in advance!


    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

    Saturday, October 15, 2016 8:05 PM

Answers

  • After additional research, the following worked for me.

    The "windows Azure Active Directory Module for PowerShell" was at version 1.0.0 (as shown in Programs and Features).

    I uninstalled this version and installed version 1.1.166.

    I still could not import the MSOnline module in the EMS.

    However, at the "regular" PowerShell prompt, this combination allowed the creation of the necessary .xml file:

    PS C:\> Add-PSSnapin "*exchange*"
    PS C:\>
    PS C:\> Import-Module MSOnline
    PS C:\> Connect-MsolService
    PS C:\>
    PS C:\> Get-OrganizationConfig | Export-Clixml -Path C:\Scripts\MyTenantOrganizationConfig.XML

    I'm posting my solution in case it might be useful for someone els


    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

    Saturday, October 15, 2016 10:11 PM

All replies

  • After additional research, the following worked for me.

    The "windows Azure Active Directory Module for PowerShell" was at version 1.0.0 (as shown in Programs and Features).

    I uninstalled this version and installed version 1.1.166.

    I still could not import the MSOnline module in the EMS.

    However, at the "regular" PowerShell prompt, this combination allowed the creation of the necessary .xml file:

    PS C:\> Add-PSSnapin "*exchange*"
    PS C:\>
    PS C:\> Import-Module MSOnline
    PS C:\> Connect-MsolService
    PS C:\>
    PS C:\> Get-OrganizationConfig | Export-Clixml -Path C:\Scripts\MyTenantOrganizationConfig.XML

    I'm posting my solution in case it might be useful for someone els


    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

    Saturday, October 15, 2016 10:11 PM
  • Hi David,

    Thank you for your sharing, you can mark your solution as answer to highlight for visitors.

    Thanks again.


    Allen Wang
    TechNet Community Support


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 17, 2016 8:19 AM
    Moderator