Solved

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

Posted on 2016-10-14
1
47 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
Read this checklist to learn more about the 15 things you should never include in an email signature.
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 …
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…

813 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

16 Experts available now in Live!

Get 1:1 Help Now