Solved

exchange

Posted on 2016-09-29
6
80 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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 16

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

615 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