Solved

PowerShell Script to find number of Mailboxes per Mailbox Database plus SMTP Addresses

Posted on 2016-10-14
1
45 Views
Last Modified: 2016-10-14
Hi,

Can you please assist me, I need a PowerShell Script that finds the number of Mailboxes per Mailbox Database plus the SMTP addresses for the Mailboxes. I'll need this for just one Mailbox Database. Thanks
0
Comment
Question by:makel2
1 Comment
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 41843571
To get mailbox count of a database..
(Get-Mailbox -ResultSize Unlimited -Database TempDatabase | Measure).Count

Open in new window

To get all mailbox email address details use following command..
Get-Mailbox -ResultSize Unlimited -Database TempDatabase | Select DisplayName,PrimarySmtpAddress, @{N="EmailAddresses";E={$_.EmailAddresses |? {$_.PrefixString -ceq "smtp"} | %{$_.SmtpAddress}}}

Open in new window

To Export details to CSV file
Get-Mailbox -ResultSize Unlimited -Database TempDatabase | Select DisplayName,PrimarySmtpAddress, @{N="EmailAddresses";E={$_.EmailAddresses |? {$_.PrefixString -ceq "smtp"} | %{$_.SmtpAddress}}} | Export-CSV C:\temp\report.csv -nti

Open in new window

2

Featured Post

Can’t get the mobile email signature right?

Not having any luck when trying to create an email signature for mobile devices? Does the formatting keep messing up? Make sure you have great email signatures on all devices by using Exclaimer Cloud - Signatures for Office 365.

Question has a verified solution.

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

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.
A procedure for exporting installed hotfix details of remote computers using powershell
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…
This video discusses moving either the default database or any database to a new volume.

919 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

14 Experts available now in Live!

Get 1:1 Help Now