Link to home
Start Free TrialLog in
Avatar of annayeg
annayeg

asked on

exchange 2007 mailbox size

Hi,
I am trying to get a report that will list all the mailboxes that are less than 10 GB.  I've used the following command but is gives me a lot of information that I do not need and it lists them by Byte size not GB.

get-mailbox |get-mailboxstatistics | export-csv test.csv| sort-object totalitemsize -descending |ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},ItemCount

Avatar of Suliman Abu Kharroub
Suliman Abu Kharroub
Flag of Jordan image

You ccan use this :

Get-MailboxStatistics | export-csv test.csv | where {$_.ObjectClass -eq "Mailbox"} | Sort-Object TotalItemSize -Descending | ft DisplayName,TotalItemSiza,ItemCount,StorageLimitStatus

and arrange them using excel  to remove mailboxes larger then 10 GB
I agree with Suliman.

For more details on powershell commands
Go get it at http://go.microsoft.com/?linkid=5719336
ASKER CERTIFIED SOLUTION
Avatar of Akhater
Akhater
Flag of Lebanon 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 annayeg
annayeg

ASKER

Hi guys,

I tried pasting the above code in a notepad and rename it mailboxsize.ps2, but when I run it from EMS it opens up the code.
Is there anything that I need to paste in the script?

Thanks
it should be .ps1 and not .ps2