Link to home
Start Free TrialLog in
Avatar of Deepin
DeepinFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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
Avatar of Guy Lidbetter
Guy Lidbetter
Flag of United Kingdom of Great Britain and Northern Ireland image

Try replacing it with this...

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

Open in new window

Avatar of Deepin

ASKER

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
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???
Avatar of Deepin

ASKER

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
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???
Avatar of Deepin

ASKER

hmmmm.....Exchange management Console
Avatar of Minecraft_ Enderman
Minecraft_ Enderman

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.
ASKER CERTIFIED SOLUTION
Avatar of Guy Lidbetter
Guy Lidbetter
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Deepin

ASKER

Brilliant!! what works from Admin Powershell but not from EMC

thanks for your help