I'm trying to build a script that imports a list of Identities into the Get-PublicFolderStatistics cmdlet that were generated from the Get-PublicFolder cmdlet. However, each time I do this I'm getting the error below. How do I input the Identity variable into the script below so it will not get that error? I don't think it is permissions related as I'm an OA. Also, in the csv folder that I created all the identities are in the format \SomeFolder\SomeSubFolder, and I'm not sure why the output gives the identity as "@{Identity=\SomeFolder\SomeSubFolder}.Identity". Any help would be greatly appreciated. Thank you.
SCRIPT
Import-Csv "C:\Users\SomeUser\Desktop\Some_Identities.csv" | foreach-object {Get-PublicFolderStatistics -Identity "$_.Identity" | Select Name,LastAccessTime,LastModificationTime,TotalItemSize | Export-Csv "C:\Users\SomeUser\Desktop\PublicFolderInfo.csv"}
ERROR
No existing 'PublicFolderEntry' matches the following Identity:
'@{Identity=\SomeFolder\SomeSubFolder}.Identity'. Make sure that you specified the correct 'PublicFolderEntry' Identity and that you have the necessary permissions to view 'PublicFolderEntry'.
+ CategoryInfo : NotSpecified: (0:Int32) [Get-PublicFolderStatistics], MapiOperationException
+ FullyQualifiedErrorId : D7E582BB,Microsoft.Exchange.Management.MapiTasks.GetPublicFolderStatistics