Link to home
Start Free TrialLog in
Avatar of GCTTechs
GCTTechsFlag for United States of America

asked on

Get-MailboxStatistics (what am I doing wrong?)

Server: Exchange 2010 SP2

Need some quick help.... what am I doing wrong?

I am trying to run a command via remote powershell to export information from all my Exchange Servers (8 servers in 4 locations), most importantly I want the following data:

DisplayName, TotalItemSize, ItemCount, SamAccountName, UserPrincipalName, RecipientType, and MailboxSize in MB and bytes

I am trying:
PS C:\> Get-MailboxStatistics | Sort-Object TotalItemSize –Descending | select DisplayName,TotalItemSize,ItemCount,SamAccountName,UserPrincipalName,RecipientType | Export-CSV C:\MailboxSizeReport.csv

cmdlet Get-MailboxStatistics at command pipeline position 1
Supply values for the following parameters:
Cannot display the prompt for "Identity" because type "Microsoft.Exchange.Configuration.Tasks.GeneralMailboxOrMailUserIdParameter" cannot be loaded.
    + CategoryInfo          : ResourceUnavailable: (:) [], PromptingException
    + FullyQualifiedErrorId : System.Management.Automation.Host.PromptingException
    + PSComputerName        : server1.contoso.com

Thanks in advance guys.
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India 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 GCTTechs

ASKER

Subsun, you replied just ion time... thanks.

Im running the script now... it hasnt failed yet, so thats promising...

We have about 5000 mailboxes spread out over 8 servers so I assume it will take a bit to gather all those details.

Fingers crossed.
run below cmdlet to get the complete mailbox statitics,

Get-MailboxServer | Get-MailboxStatistics | select DisplayName,TotalItemSize,ItemCount, | Sort-Object TotalItemSize -Descending | Export-CSV C:\MailboxSizeReport.csv

you can not get the SamAccountName,UserPrincipalName,RecipientType details from statitics cmdlet.



-Praveen
Thanks Praveen, Im still waiting for Subsuns script to complete.

Im not sure your cmdlet would get all the info I need would it?

DisplayName, TotalItemSize, ItemCount, SamAccountName, UserPrincipalName, RecipientType, and MailboxSize in MB and bytes?