I need an Exchange 2010 command that will list each user and a total count of folders

ewiener
ewiener used Ask the Experts™
on
I can get them individually with this command:
get-mailboxfolderstatistics -id %username%).count

How do I have this give me a listing of all users with their total number of folders without writing a script. Isn't there a way to output this in a single command?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Adam BrownSenior Systems Admin
Top Expert 2010

Commented:
You'll have to expand it a bit, but this should work:

$users=get-mailbox
foreach ($user in $users){
$count = (get-mailboxfolderstatistics $user).count
$output = "User: " + $user.displayname + " - Folder Count" +  $count
$output
}

Open in new window

Adam BrownSenior Systems Admin
Top Expert 2010

Commented:
I forgot a trailing bracket on the script. That's fixed now, in case you tried this and it didn't work.
Commented:
I just manually ran the single line command I had. Thank you to those who suggested scripts anyway.

Author

Commented:
There was no answer for my question.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial