Exchange 2007, Exchange 2010 Public Folder Migration Error

Written by Allen White on. Posted in Exchange 2007, Exchange 2010, Exchange 2013, Exchange 2016

Every Exchange migration I do that involves public folders always has its own little fiddly unique error, one I am working on at the moment is no different.

I was at the stage of running the Export-PublicFolderStatistics command to CSV and I received the following error:

You cannot call a method on a null-valued expression.
At C:\Scripts\Export-PublicFolderStatistics.ps1:193 char:88

The statistics export will then fail. I downloaded various new scripts and continued to get the same error. After MUCH research and working with my colleague Pete ( I found the issue to be the following.

Exchange 2007 does not like the following variable in the Export-PublicFolderStatistics.PS1 script, “$_.MapiIdentity”.

To resolve the issue edit the file “Export-PublicFolderStatistics.ps1” and find this text in file “$_.MapiIdentity” and replace it with “$_.Identity“.

Save the file and run your script again and you will then be able to run the command successfully. This issue will apply to Exchange 2007 to Exchange 2013 and Exchange 2010 to Exchange 2016


Allen White
Allen is a Consultant for ITPS in the North East of England and holds the following accreditations. MCSA, MCSE, MCTS, MCITP, CCA, CCSP, VCP 4,5 and HP ASE, AIS - Network Infrastructure.

ITPS provides strategic IT consultancy, implementation, data centre provision and unified communications, as well as support services and workspace and disaster recovery. If you require a consultation then please contact me via the contacts section or direct on 07931222991, add me on linkedin.


Leave a comment


(c) Please be aware, all information is provided freely, any information used is done so at your risk and Techieshelp will not be held responsible for any issue that may occur.
!-- BuySellAds On-Site Shopping Cart -->