Solved

error when running powershell command

Posted on 2014-04-08
6
180 Views
Last Modified: 2014-04-17
i want to get a list of user accounts in exchange with total size and item count. when i put the exchange server's name in the brackets, and i think i have a successful code, i dont get any results. if i put in a bad exchange server, i get the error in red text.

get-mailboxstatistics -server 'exchange' |sort-object totalitemsize -descending | ft displayname,totalitemsize,itemcount
error
0
Comment
Question by:ttrbrtsn
  • 3
6 Comments
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
Comment Utility
The command is correct that way. What if you omit the server parameter?
0
 
LVL 17

Expert Comment

by:Premkumar Yogeswaran
Comment Utility
Make sure the exchange management shell opened without any error.

Try to close and open the shell.

And also give some different mailbox server name.
0
 
LVL 63

Expert Comment

by:Simon Butler (Sembee)
Comment Utility
Your command isn't really right.
You have mixed up mailboxstatistics with mailboxserver, you also haven't said which mailbox you want the statistics for. Furthermore, if you have one server then you don't need the server address at all.

get-mailbox | Get-MailboxStatistics | sort TotalItemSize -desc |ft DisplayName,TotalItemSize, ItemCount

If you have multiple servers then run

Get-MailboxServer  servername | Get-Mailbox | Get-MailboxStatistics | sort TotalItemSize -desc |ft DisplayName,TotalItemSize, ItemCount

Simon.
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
Simon,

The syntax without ID and server works for MSX 2007, but not for MSX 2013. The latter needs an identity/mailbox, server or database. So the syntax as originally shown is still valid for MSX 2013, and should result in dumping all mailboxes of that server.


ttrbrtsn,

Maybe we should be clear about the Exchange release used? And did you check whether the Mailbox Server role is active on that machine?
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
I don't think I deserve the points. Can you explain whether and how my comment really helped?
0

Featured Post

Are your corporate email signatures appalling?

Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

Join & Write a Comment

Suggested Solutions

Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
In this video we show how to create a User Mailbox 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 Recipients >> Mailb…
In this video we show how to create an Accepted Domain 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 Mail Flow >> Ac…

763 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

5 Experts available now in Live!

Get 1:1 Help Now