Need to get a list of Exchange users & connceted mailboxes

How would I dump a list from Exchange of users & any connected mailboxes they might have?

CSV format is fine.

Who is Participating?
someITGuyConnect With a Mentor Author Commented:
My apologies, I was not clear on what I was looking for.

I was trying to get the size of individual folders in a users mailbox.

I ended up finding this script from Shay Levy:

function Get-MailboxFolder($folder)
"{0}: {1}" -f $, $folder.items.count

foreach ($f in $folder.folders)
Get-MailboxFolder $f

$ol = new-object -com Outlook.Application
$ns = $ol.GetNamespace("MAPI")
$mailbox = $ns.stores | where {$_.ExchangeStoreType -eq 0}
$mailbox.GetRootFolder().folders | foreach { Get-MailboxFolder $_}

•      One gotcha on this, If you receive error message:
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005
Make sure that Outlook and Powershell are either both running as a standard user (not elevated) or that they are both running elevated as Administrator. They need to be running at the same integrity level to avoid that error.
someITGuyAuthor Commented:
I can't spell connected...
Which version of Exchange?
For 2010/2013, try:
Get-MailboxServer -Identity [server] | Get-MailboxStatistics | Select-Object Servername, Databasename, DisplayName, @{expression={$_.TotalItemSize.Value.ToMB()}},StorageLimitStatus,LastLogonTime, LastLoggedOnUserAccount,ItemCount, DeletedItemCount | Export-Csv C:\ExchangeUserStats.csv

Open in new window

Change [server] with the hostname of the mailbox server you wish to query.
Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

Mohammed KhawajaManager - Infrastructure:  Information TechnologyCommented:
Or you could download PowerGUI and install Exchange plug-ins.  Then you could get mostl common reports without knowing PowerShell.
You can delete the Calendar Contents via the Powershell. Please use below cmdlet and url.

Search-Mailbox –identity username –SearchQuery kind:meetings –DeleteContent

Mahesh SharmaCommented:
If I understand correctly you are asking list of exchange mailboxes to csv format

1. Get-Mailbox -resultsize unlimited | Select Alias, Server, Database | Export-Csv dump.csv

2. By any connected mailbox I think u r asking any mailbox the have permission on, use below:

You can configure auditing in see event log for mailbox access logs.

set-EventLogLevel  "mailbox  server name"\MSExchangeIS\9000 Private\Send As  -level low
Sorry, I put an answer should not be here. Please delete it.
someITGuyAuthor Commented:
By connected mailboxes I mean shared mailboxes.
Mahesh SharmaCommented:
Use Below cmdlet:

Get-Mailbox -resultsize unlimited | Select Alias, Server, Database | Export-Csv dump.csv

Get-Mailbox -ResultSize unlimited | Get-MailboxPermission | ?{($_.AccessRights -eq "FullAccess") -and ($_.User -like 'DOMAIN\user') -and ($_.IsInherited -eq $false)} | ft Id*

Let me know if it work for u
someITGuyAuthor Commented:
found solution from outside source.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.