Solved

exchange

Posted on 2016-09-29
6
51 Views
Last Modified: 2016-09-30
is there any command lets in exchange 2007  I can check to find below


How many mailboxes are greater than 2Gb in size? and export in csv file

Get-MailboxStatistics -Server RED-MSG01 | Where {$_.TotalItemSize -gt 2GB} | `
   Sort-Object -Property TotalItemSize -Descending | Format-Table DisplayName,TotalItemSize | Export-CSV "C:\AllMailboxes.csv"

will above work
0
Comment
Question by:pramod1
6 Comments
 
LVL 8

Expert Comment

by:Leo
Comment Utility
Get-MailboxStatistics | Sort-Object TotalItemSize -Descending| ft DisplayName,@{label=”TotalItemSize(MB)”;expression={$_.TotalItemSize.Value.ToMB()}},ItemCount,StorageLimitStatus | Where {$_.TotalItemSize -gt 2GB}
0
 

Author Comment

by:pramod1
Comment Utility
I wrote above command , how can I output in csv file, I just need numbers
0
 
LVL 13

Expert Comment

by:Michael Machie
Comment Utility
Add:
| out-file c:\ps-results\result.csv

Edit your save location and filename to fit your need.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:pramod1
Comment Utility
users are in 3gig group which is AD group , how can run a command to get the count
0
 
LVL 14

Expert Comment

by:Todd Nelson
Comment Utility
Despite giving "out-file" a CSV extension it does not output a CSV formatted file. If you want a CSV formatted file you need to use "export-csv".

Therefore, the command you will need is more like this...

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending| Select-Object DisplayName,@{label=”TotalItemSize(MB)”;expression={$_.TotalItemSize.Value.ToMB()}},ItemCount,StorageLimitStatus | Where {$_.TotalItemSize -gt 2GB} | export-csv c:\mailstats.csv -notype
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
Comment Utility
@pramod1, Only change you need to make in your code is to change Format-Table to Select-object

Get-MailboxStatistics -Server RED-MSG01 | Where {$_.TotalItemSize -gt 2GB} | Sort-Object -Property TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize | Export-CSV "C:\AllMailboxes.csv" -nti

Open in new window


If you just need to view the count of users whose mailbox is greater than 2 G
(Get-MailboxStatistics -Server RED-MSG01 | Where {$_.TotalItemSize -gt 2GB} | Measure).Count

Open in new window


PS : Above commands will give mailboxes on servers RED-MSG01, if you have multiple servers on your environment..
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Where {$_.TotalItemSize -gt 2GB} | Sort-Object -Property TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize | Export-CSV "C:\AllMailboxes.csv" -nti

Open in new window

0

Featured Post

Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

Join & Write a Comment

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
A procedure for exporting installed hotfix details of remote computers using powershell
In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
This video discusses moving either the default database or any database to a new volume.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now