Solved

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

Posted on 2014-10-16
3
181 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 29

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 29

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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
how to add IIS SMTP to handle application/Scanner relays into office 365.

685 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