Link to home
Start Free TrialLog in
Avatar of WORKS2011
WORKS2011Flag for United States of America

asked on

Exchange PowerShell Command doesn't show full results.

Get-Mailbox -ResultSize Unlimited | Where {$_.EmailAddresses -like "*@domain_name.local"} | Get-MailboxStatistics | FT DisplayName,TotalItemSize

Two issues:
1.) Only pulls up the first 4 names out of more than 20.
2.) How to export to text?
ASKER CERTIFIED SOLUTION
Avatar of timgreen7077
timgreen7077

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 WORKS2011

ASKER

Thank you, any idea why it only pulls up the first four names? Is there a way to add names to it? Easier to add names then go into Exchange and pull the info from user account.
Avatar of timgreen7077
timgreen7077

do you have multiple domains and do they all have mailboxes?
you can also try this in normal powershell you can run the following ( runn both cmdlets):



Import-Module ActiveDirectory
Get-ADUser -Filter * -Properties * | ft name, emailaddress
Get-Mailbox -ResultSize Unlimited | Where {$_.EmailAddresses -like "*@domain_name.local"} | Get-MailboxStatistics | FT DisplayName,TotalItemSize >> C:\temp\results.txt
Command is the right one.
I've tested it and is working and I can have all my mailboxes in csv file.
If you see only 4 it mean there is problem with your Exchange.

Get-Mailbox -ResultSize Unlimited | Where {$_.EmailAddresses -like "*@domain.local"} | Get-MailboxStatistics | FT DisplayName,TotalItemSize |set-content C:\temp\out.txt $output 

Open in new window


or

Get-Mailbox -ResultSize Unlimited | Where {$_.EmailAddresses -like "*@domain.local"} | Get-MailboxStatistics | FT DisplayName,TotalItemSize |Export-CSV c:\temp\listMailboxes.csv

Open in new window

Author whats the status of this before we close the ticket?
Answered author's question. closing ticket since author no longer responds.