Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Collect mailbox statistics issue.

Posted on 2016-08-22
7
Medium Priority
?
61 Views
Last Modified: 2016-09-14
I need to collect the below info in my Exchange 2010 server: firstname, lastname, loginname/UPN, itemcount, totalitemsize, storagelimitstatus, databasename, mailbox server.  I have tried this command but not able to make it to work:

get-mailboxstatistics -server myexchangeserver | sort-object totalitemsize -descending | ft firstname,lastname,.......

Please advise.  

Thanks,
0
Comment
Question by:nav2567
  • 3
  • 2
  • 2
7 Comments
 
LVL 44

Assisted Solution

by:Vasil Michev (MVP)
Vasil Michev (MVP) earned 800 total points (awarded by participants)
ID: 41765559
There is no firstname/lastname/UPN parameter for the get-mailboxstatistics output, you have to get them from a calculated property or similar. Something like:

| select @{n="UPN";e={(Get-Mailbox $_.MailboxGuid.Guid).UserPrincipalName}},ItemCount,TotalItemSize | sort TotalItemSize

Open in new window

0
 

Author Comment

by:nav2567
ID: 41769173
I just tried the below but it still doesnt work.  

get-mailboxstatistics -server myexchangeserver | sort-object totalitemsize -descending | select @{n="UPN";e={(Get-Mailbox $_.MailboxGuid.Guid).UserPrincipalName}},ItemCount,TotalItemSize | sort TotalItemSize
0
 
LVL 44

Expert Comment

by:Vasil Michev (MVP)
ID: 41769194
Well, check what the relevant properties are on-prem, I run this example against O365. I think the MailboxGuid wasnt available as output on-prem, so you might have to replace it with Guid or Identity or similar. What's the output of get-mailboxstatistics for a single user?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 27

Accepted Solution

by:
MAS earned 1200 total points (awarded by participants)
ID: 41769267
Please try this and let me know.
Get-Mailbox -ResultSize Unlimited | sort-object | Select-Object DisplayName,UserPrincipalName,@{n="MailboxSizeMB";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.TotalItemSize.Value.ToMB()}},@{n="Mailcount";e = {$MBXstat = Get-MailboxStatistics $_.Displayname; $MBXstat.ItemCount}} | sort Mailcount

Open in new window


Thanks
MAS
0
 

Author Comment

by:nav2567
ID: 41772849
The command seems to works.  Thanks.  But I see errors - see attached.

Please advise again.
mbstaterr.png
0
 
LVL 27

Expert Comment

by:MAS
ID: 41772857
Hi,
That warning is due to user is not logged on to the  mailbox.
You can ignore that.

Thanks
MAS
0
 
LVL 27

Expert Comment

by:MAS
ID: 41798445
I believe this can be closed as per the comment (ID:41772849)  from the author.

Thanks
MAS
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Question has a verified solution.

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

The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

927 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