Exchange export to CSV does not populate all feilds

Following command will not populate 'TotalitemSizesMB'

Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, IssueWarningQuota, ProhibitSendQuota, @{label="TotalItemSize(MB)";expression={(Get-MailboxStatistics $_).TotalItemSize.Value.ToMB()}}, @{label="ItemCount";expression={(Get-MailboxStatistics $_).ItemCount}}, Database | Export-Csv "C:\UserMailboxSizes.csv" -NoTypeInformation
LVL 6
DeepinInfrastructure Engineer Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy LidbetterCommented:
Try replacing it with this...

@{Label="TotalItemSize";Expression={$MBXSize = Get-Mailboxstatistics $_.Name; $MBXSize.totalItemSize.value.toMB()}}

Open in new window

0
DeepinInfrastructure Engineer Author Commented:
Just tried replacing with the line you mentioned - see full command below . Same result


Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, IssueWarningQuota, ProhibitSendQuota, @{Label="TotalItemSize";Expression={$MBXSize = Get-Mailboxstatistics $_.Name; $MBXSize.totalItemSize.value.toMB()}}, @{label="ItemCount";expression={(Get-MailboxStatistics $_).ItemCount}}, Database | Export-Csv "C:\UserMailboxSizes.csv" -NoTypeInformation
0
Guy LidbetterCommented:
That's odd - I just ran your original script and its populating fine for me...

Is the field empty or not what your were expecting???
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

DeepinInfrastructure Engineer Author Commented:
the fields empty both Total Item sizes and Item Count, I've tried that particular script on two server - both with the same out come

both on Exchange 2010
0
Guy LidbetterCommented:
On both versions of the script, I got both fields populated... this is with 2010 as well.

Sorry Deepin... as far as I can see everything works as expected...

Where are you running the script? in powershell with the E2010 add-in or in the EMS?? or Powershell ISE???
0
DeepinInfrastructure Engineer Author Commented:
hmmmm.....Exchange management Console
0
Minecraft_ EndermanCommented:
One thing to remember, if the TotalitemSizes of mailbox is less than 1 MB, then this script will not report.
You can run this command to check this
Get-mailbox -resultsize 20 | Get-MailboxStatistics | fl TotalItemSize
And I can be sure that there is no problem with this command.
0
Guy LidbetterCommented:
@Kiss sky - It will report anything below 1MB it will just round up or down (i.e. report a 1 or a 0)

@Deepin - try opening an Admin Powershell and running this

Add-PsSnapin *2010
Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName, IssueWarningQuota, ProhibitSendQuota, @{label="TotalItemSize(MB)";expression={(Get-MailboxStatistics $_).TotalItemSize.Value.ToMB()}}, @{label="ItemCount";expression={(Get-MailboxStatistics $_).ItemCount}}, Database | Export-Csv "C:\UserMailboxSizes.csv" -NoTypeInformation

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DeepinInfrastructure Engineer Author Commented:
Brilliant!! what works from Admin Powershell but not from EMC

thanks for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.