Solved

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

Posted on 2014-10-16
3
179 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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In this video we show how to create an email address policy 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…
To show how to create a transport rule 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 >> Rules tab.:  To cr…

839 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