Script to convert migrated Exchange 2007 users to Office 365 (mail enabled users) RRS feed

  • General discussion

  • Dear all,

    We have a nasty situation out here. One of our customers is migration a bunch of users to Office 365.
    Everything seems to go fine until we get to the point where we need to run the script to convert migrated mailboxes to mail enabled users. The script which we have found fails on several lines and we cannot get support from Office 365 since they don't support scripting.

    I have added the 2 files to migrate a user to Office 365 in my private Dropbox where you can find the information.
    Something goes wrong in the file ExportO365UserInfo.ps1 and I have changed the option Get-CloudMailbox to Get-Mailbox which is also neccessary if you migrate mailboxes from Exchange 2003 to Office 365.

    Please find the link to my files: https://www.dropbox.com/sh/w814bn0s41ykz2e/AADkwhdfMTT_nuPZNbuqLcz5a?dl=0

    If somebody has working scripts to migrate a migrated user from Exchange 2007 to Office 365 without any problems please let me know where to find them. This issue is causing me a severe headache and we do want to solve this.
    Any help from the community is appreciated :)

    • Changed type Bill_Stewart Monday, August 1, 2016 2:37 PM
    • Moved by Bill_Stewart Monday, August 1, 2016 2:37 PM This is not "reproduce my environment and debug/fix my script for me" forum
    Tuesday, June 28, 2016 11:52 AM

All replies

  • Hi Sjollie,

    Tip: If you have an error, post it (screenshot or text copy, whatever works for you). Without a screenshot it's damned hard to guess what's going wrong and my Chrystal Ball is still in the repair shop.

    That said, the import of the pssession as practiced in this script will likely cause trouble:

    At the top of the script there is a function named "O365Logon"
    This function is called further down in the script (line 114)

    Add a dot and a whitespace to this call in line 114:

    # Old line
    # New line
    . O365Logon

    This executes the function in the current scope. Otherwise it can just happen, that all the imported functions vanish when the function ends. PowerShell scopes tend to confuse even the various Microsoft PowerShell teams.

    Other than that, all paths are relative to the current path, so be sure to run the script from a console whose path is where all the csv files are and should be.


    There's no place like

    • Edited by FWN Tuesday, June 28, 2016 12:13 PM
    Tuesday, June 28, 2016 12:12 PM
  • Dear Fred,

    I just added the screenshot in the Dropbox URL. You can find the information which I got.
    We managed to generate the cloud.csv file after we changed all the Get-Cloudmailbox command to Get-Mailbox

    Do you have any idea what might go wrong?


    Friday, July 1, 2016 2:52 PM
  • Please read the following first, from right at the top of this forum:

    This forum is for scripting questions rather than script requests

    You're essentially asking for someone to download your code, reproduce your environment, troubleshoot, and fix the bugs for you. All for free from a forum.

    If you need professional troubleshooting, you need to pay someone to help you.

    This forum is for specific scripting questions, not "troubleshoot/fix my code for me" requests.

    -- Bill Stewart [Bill_Stewart]

    Friday, July 1, 2016 3:32 PM
  • Hi Guido,

    the first script is running just fine for now. However, the second script has some ... interesting trouble.

    • The cmdlets appear to be broken - this should be working!
      You may try installing the Exchange 2007 Tools on a Windows 7 or newer Client and run the script from that client, as possibly either .NET, Exchange Cmdlets or PowerShell might be broken
    • The resulting Csv from the first script appears to have entries that have no CloudEmailAddress. This property might not be populated as it should be. Better check this out manually and see where the property is being lost.


    There's no place like

    Friday, July 1, 2016 3:35 PM