Solved

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

Posted on 2016-10-14
1
50 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This article explains how to install and use the NTBackup utility that comes with Windows Server.
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
how to add IIS SMTP to handle application/Scanner relays into office 365.

696 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