Solved

Collect mailbox statistics issue.

Posted on 2016-08-22
7
35 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 38

Assisted Solution

by:Vasil Michev (MVP)
Vasil Michev (MVP) earned 200 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 38

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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 24

Accepted Solution

by:
-MAS earned 300 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 24

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 24

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
In this video we show how to create a mailbox database 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 Servers >> Data…
This Experts Exchange lesson shows how to use VBA to loop through rows in Excel.  In order to sort, filter, and use database features, there needs to be a value in each column for every row. When data arrives with values missing, code to copy values…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now