Link to home
Start Free TrialLog in
Avatar of ewiener
ewiener

asked on

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

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?
Avatar of Adam Brown
Adam Brown
Flag of United States of America image

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

I forgot a trailing bracket on the script. That's fixed now, in case you tried this and it didn't work.
ASKER CERTIFIED SOLUTION
Avatar of ewiener
ewiener

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 ewiener
ewiener

ASKER

There was no answer for my question.