Solved

exchange 2010/2013 count and list users in a databas text file

Posted on 2014-10-16
3
169 Views
Last Modified: 2014-10-28
Does anyone have a powershell script that lists and counts the user for each exchange database
0
Comment
Question by:techdrive
  • 2
3 Comments
 
LVL 28

Expert Comment

by:becraig
ID: 40384722
Mailboxes
(get-mailboxdatabase) | foreach-object {write-host $_.name (get-mailbox -database $_.name).count}

Open in new window


From technet:
https://social.technet.microsoft.com/Forums/exchange/en-US/99dab102-1b49-4ce2-8b85-dc247ae1fc84/powershell-commnd-to-count-the-number-of-mailboxes-per-database-in-exchange-2010?forum=exchange2010
0
 

Author Comment

by:techdrive
ID: 40384746
I see or I could do something like this but I need to write to a file rather than to the screen and how do I get other get-mailbox properties.

$maildb = get-content c:\temp\listofdb.csv

for {$maildb in maildbx} (
 
{write-host $_.name (get-mailbox -database $_.name).count}

 }
0
 
LVL 28

Accepted Solution

by:
becraig earned 500 total points
ID: 40384758
Just add an export-csv  
$maildb = get-content c:\temp\listofdb.csv

for {$maildb in maildbx} ( 
{write-host $_.name (get-mailbox -database $_.name).count}
 }  | export-csv  file.csv -nti

Open in new window

0

Featured Post

Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

Join & Write a Comment

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
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…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

746 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

10 Experts available now in Live!

Get 1:1 Help Now