Error creating a public folder migration batch when the “Folder to Mailbox Map” CSV file has more than 1000 rows

Problem Description

Trying to migrate public folders from Exchange 2007 to 2013 using the batch migration process detailed here

On step 5, when running the New-Migration cmdlet to create the migration batch as follows

New-MigrationBatch -Name PFMigration -SourcePublicFolderDatabase (Get-PublicFolderDatabase -Server SERVER01) -CSVData (Get-Content Public_Folder_to_mailbox_map.csv -Encoding Byte) -NotificationEmails -BadItemLimit $BadItemLimitCount   

I was getting the following error

The CSV File contains more than 1,000 rows.  Please divide the files into two or more files and submit them separately



Use the -TotalCount switch the to specify the number of row’s in the CSV file

New-MigrationBatch -Name PFMigration -SourcePublicFolderDatabase (Get-PublicFolderDatabase -Server SERVER01) -CSVData (Get-Content Public_Folder_to_mailbox_map.csv -TotalCount 1595 -Encoding Byte) -NotificationEmails -BadItemLimit $BadItemLimitCount   

In my case, the Public Folder to Mailbox Map csv file has 1595 rows, so I used -TotalCount 1595


3 thoughts on “Error creating a public folder migration batch when the “Folder to Mailbox Map” CSV file has more than 1000 rows

  1. Hi Shane,
    that’s not correct when you create new-migrationbatch. It did not took first 1595 rows, it took first 1595 symbols. When you put for example 60 000, it took first 60000 symbols. When you count all symbols and put them in, for example 700 000, you receive the same message, that the CSV contains more than 1000 row.
    When you read the article bout get-contet, you really see that is written rows. The problem came when you put this in new-migrationbatch. If you read very carefully the article, it is written that default value is -1, which means ALL rows.

    • Thanks for your feedback Kr. Donchev. But I’m not exactly clear what you mean. I’m my case as I explained, when I received this error I used the -TotalCount parameter to specify the number of rows in my CSV file. This worked in my case. Have you an alternative solution? Can you provide an example?

  2. Hi Shane,
    -TotalCount parameter by default uses value -1, which means “unlimited”. In NewMigrationBatch, there is hardcoded parameter – maximum 1000 rows per csv file and you can’t use csv file with 1001 rows or bigger.
    When you try to put -TotalCount in the command New-MigrationBatch, it took the number of symbols (absolutely without any logic!), not number of rows (i read all parameters in technet).
    PFMbx01,\RootFolder1\Folder1\Folder2 <– here are 36 symbols.
    When you put -TotalCount 36, it meas that it will took only this row, which contains 36 symbols.
    How you can test it:
    create map.csv file, with 1595 rows
    Put each row different PFMbx name, starting from 1 to 1595 (no matter that you dont have 1595).
    Then create new-migrationbatch with this map.csv
    Start migration and then see in ECP how many mailboxes are mapped (if you are able to create the batch).

Leave a Reply

Your email address will not be published. Required fields are marked *