Link to home
Start Free TrialLog in
Avatar of Andy Andy
Andy AndyFlag for India

asked on

Mailbox count with mailbox size

Hello Team,

I want a report server wise, with below data. i am l;ookign for script that run for specific serve ronly and i can change the server as per my requirement

AliasName,Displayname,Firstname,Lastname,Itemcounts,MailboxSize,Organizational unit

please sugggest a command to accomplish this

Thanks,
Addy
Avatar of M A
M A
Flag of United States of America image

Hi Addy,
Please try this.
Get-Mailbox -ResultSize Unlimited | sort-object | Select-Object Alias,DisplayName,Organizationalunit,@{n="MailboxSizeMB";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.TotalItemSize.Value.ToMB()}},@{n="Mailcount";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.ItemCount}} | Export-Csv C:\export\mailboxdetails.csv

Open in new window


Thanks
MAS
Avatar of Andy Andy

ASKER

but where is the server name i need to mention ?? i need to run by servername
Please try this.
Get-Mailbox -Server <Server01> -ResultSize Unlimited | sort-object | Select-Object Alias,DisplayName,Organizationalunit,@{n="MailboxSizeMB";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.TotalItemSize.Value.ToMB()}},@{n="Mailcount";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.ItemCount}} | Export-Csv C:\cert\test.csv

Open in new window

its giving all other results except mailbox size .. which i need a most

Please suggest. Mailbox size in MB is not coming, it is showing blank field..
Rest report is fine
Hello couls you please confirm my last query
Please try this
Get-Mailbox -ResultSize Unlimited -server SERVER01 | sort-object | Select-Object Alias,DisplayName,Organizationalunit,@{n="MailboxSizeMB";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.TotalItemSize.Value.ToMB()}},@{n="Mailcount";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.ItemCount}} | Export-Csv

Open in new window

after export-csv path is not mentioned
its same result.. mailbox size is blank
Please let me know your Exchange version.
Exchange 2013 cu13
Hello Expert

Please confirm on this
Apologize for the delayed response.
Please try this an let me know.
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object @{n="Alias";e = {$MBXstat = Get-Mailbox $_.Displayname;$MBXstat.Alias}},DisplayName,Itemcount,TotalItemSize,@{n="OrganizationUnit";e = {$MBXstat = Get-Mailbox $_.Displayname;$MBXstat.Organizationalunit}}

Open in new window

I need server specific and also it is not exporting to Csv
ASKER CERTIFIED SOLUTION
Avatar of M A
M A
Flag of United States of America 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
Awsum Script