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?
Exchange

Avatar of undefined
Last Comment
ewiener

8/22/2022 - Mon
Adam Brown

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 Brown

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
ewiener

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ewiener

ASKER
There was no answer for my question.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes