Solved

exchange

Posted on 2016-09-29
6
66 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
ID: 41822768
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
ID: 41822770
I wrote above command , how can I output in csv file, I just need numbers
0
 
LVL 13

Expert Comment

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

Edit your save location and filename to fit your need.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

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

Expert Comment

by:Todd Nelson
ID: 41822847
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
ID: 41823218
@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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Find out what you should include to make the best professional email signature for your organization.
In this video we show how to create an email address policy 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 Mail Flow…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

838 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