Wednesday, January 1, 2014

Exchange 2013 Public Folder Migration- PublicFolderToMailboxMapGenerator.ps1 script Error


   When migrating our public folders to Exchnage 2013, from 2007....I came across a little oddity. An oddity? From Microsoft? How can that be!! Public folder migration is well documented online...so I won't rehash that. I used the Technet guide found here:


So you basically download and run the various scripts as outlined from the Exchange Shell. After you've run the PublicFolderToMailboxMapGenerator.ps1 script:

.\PublicFolderToMailboxMapGenerator.ps1 <Maximum mailbox size in bytes> <Folder to size map path> <Folder to mailbox map csv path>

And created the actual PF Mailboxes on your Exchange 2013 server (a single PF mailbox sufficed for our environment) with this command...

New-Mailbox -PublicFolder PFMailboxName -HoldForMigration:$true -Database MailboxDatabaseName

You'll want to open and edit the PF mailbox name in the csv file you just created with the PublicFolderToMailboxMapGenerator.ps1 script. Make the PF mailbox name or names match the the name(s) of the actual PF Mbxs you created. Sounds easy enough.... well, when I did this, and saved the the file, and then ran the migration request command next as such... (which references the PFFoldertoMailbox map csv file)

New-PublicFolderMigrationRequest -SourceDatabase (Get-PublicFolderDatabase -Server <Source server name>) -CSVData (Get-Content <Folder to mailbox map csv path> -Encoding Byte) -BadItemLimit $BadItemLimitCount

I ended up receiving an error and the migration would not kick off. Turns out that Excel botched the file syntax ever so slightly for whatever reason...or maybe the script itself did. Took me some time to notice.... so take note of this if you get this behavior. Your FFoldertoMailboxMap csv file should look like this:


"FolderPath","TargetMailbox"

"\","PFMailbox1"



My PFmailbox name being PFMailbox1. I made the change using Notepad++ or similar this time..saved it...and re-ran the migration command. All was fine after...


Happy migrating!

No comments:

Post a Comment