I was running the script to convert users to MailEnabled objects and ran into this issue.   It actually deleted some mailboxes and didn’t re-create the new Mail Enabled ones.

So the problem was simple.  The output from the previous script has LegacyExchangeDN Objects which contained some white space and commas (which is legal in the naming convention) but the script produced a CSV file which had no quotes.

Now I was mucking about with this for about an hour until I noticed the reason.   The script ACTUALLY has a line to REMOVE the QUOTE from a CSV file.

*BANG BANG BANG BANG BANG* (Yes as my former co-worker Kevin at Mckesson would have said I began utilizing the “shiny spot” on the desk)

But the fix is VERY easy.   If you’re doing your Staged Migration and need to pull the data just make the following changes to correct the output of the CSV file.  It’s about line 79 in the current release.



Append an “-encoding Unicode” to the first line after “-notype” and place a “#” before “(Get-Content” on the 2nd line as in the example below



Now you COULD actually remove that second line but I prefer the “I want a rollback” approach as opposed to “Wipe it out dude!”

But now when you run that script if you have commas or Spaces in the LegacyExchangeDN it won’t cause “unexpected surprises” later on….. which it will.


The Energized Tech