Exchange Online – Display and Export information using PowerShell | Office 365 5/5 (2)

In the current article, we review the how to use the PowerShell command Get-Mailbox for – display and export information about Exchange Online mailboxes.

One of the most basic needs for Exchange Online administrator is – the ability to create reports that include information about the Exchange Online resources such as Mailbox’s, Distribution Groups, etc.

This is Where PowerShell “Shine”!

The GUI Interface (WEB Interface) includes limited ability to display information and have no option to export data or to create “wide area” searches for particular object or, object with a specific parameter (property). When using the PowerShell, the options are unlimited.

This article includes a mixture of PowerShell commands for displaying and exporting information from the Exchange Online environment.

PowerShell | Help & additional information

In case that you are a novice in the PowerShell environment, you can use the following link to get more information about the “first steps” such as: downloading the required PowerShell
software components, how to use the PowerShell console, running a PowerShell script, etc.

Read more
Link Table
PowerShell Naming Conventions & general information

If you want to get more information about the Naming Conventions that we use for this article and get some general tips about: how to work with the PowerShell, read the article: Help and additional information – o365info.com PowerShell articles

Create remote PowerShell session

Before we can use the required PowerShell commands, we need to download and install the Office 365 cmdlets + create remote PowerShell session to Office 365 or Exchange Online. If you need more information about how to create a remote PowerShell session read the following articles: Part 2: Connect to Office 365 by using Remote PowerShell and Part 3: Connect to Exchange Online by using Remote PowerShell

How to use a PowerShell script

Most of the PowerShell articles include a PowerShell script that simplifies the use of the PowerShell commands. If you want to get more information about: How to use a PowerShell script, read the article: Connect to Office 365 and Exchange Online using a script

PowerShell command and Script languish in more details

If you are new to the PowerShell world, you can read more information about PowerShell in Office 365 environment in the article: The Power of PowerShell

1. Display information by Mailbox Type

1.1 – Display List of all Mailbox’s type

PowerShell command Syntax

Adjustments & Customizations
Filter the display output details:

PowerShell command Syntax

1.2 -Display List of all Mailbox’s Summery

PowerShell command Syntax

1.3 -Display List of office 365 Users Mailbox’s

PowerShell command Syntax

1.4 – Display List of Room Mailbox’s

PowerShell command Syntax

1.5 – Display List of Equipment Mailbox’s

PowerShell command Syntax

1.6 – Display List of Shared Mailbox’s

PowerShell command Syntax

1.7 – Count the Mailbox’s number

PowerShell command Syntax

2. Find and Display information about Email Address

2.1 – Display ALL recipients Primary + Alias Email Address + SIP Address

PowerShell command Syntax

Adjustments & Customizations
Filter the display output details:

PowerShell command Syntax

2.2 -Display every Alias for each recipients + count Alias

PowerShell command Syntax

2.3 -Display Primary + Alias Email Address + SIP Address for specific Mailbox

PowerShell command Syntax

PowerShell command Example

2.4 -Display Office 365 users UPN names

PowerShell command Syntax

3. Find Mail Recipients with specific Domain name suffix

3.1 – Find Office 365 users that have UPN With specific Domain name suffix

PowerShell command Syntax

PowerShell command Example

3.2 – Find Mailbox’s Email Addresses that have specific Domain name suffix

PowerShell command Syntax

PowerShell command Example

3.3 – Find Distribution Groups Email Addresses that have specific Domain name suffix

PowerShell command Syntax

PowerShell command Example

3.4 – Find Contacts Email Addresses that have specific Domain name suffix

PowerShell command Syntax

PowerShell command Example

4. Find Mail Recipients with specific Attribute

4.1 – Find Mailbox’s Email Addresses that have specific Alias

PowerShell command Syntax

PowerShell command Example

4.2 – Find Distribution Groups Email Addresses that have specific Alias

PowerShell command Syntax

PowerShell command Example

4.3 – Find Contacts Email Addresses that have specific Alias

PowerShell command Syntax

PowerShell command Example

4.4 – Find Email Addresses that have specific Alias + specific Domain name suffix

PowerShell command Syntax

PowerShell command Example

4.5 – Find Email Addresses that have specific Alias + specific Domain name suffix

PowerShell command Syntax

PowerShell command Example

5. View Mailbox Statistics

information about mailbox and folder size

5.1 – Display information about mailbox size (Mailbox Statistics)

PowerShell command Syntax

PowerShell command Example

5.2 – Display information about ALL of existing mailbox size (Bulk Mode)

PowerShell command Syntax

PowerShell command Example

5.3 – Display information about specific folder size

PowerShell command Syntax

PowerShell command Example

information about mailbox Quotas size

5.4 – View all Quotas assigned to a single Mailbox

PowerShell command Syntax

PowerShell command Example

5.5 – View all Quotas assigned to ALL Mailbox’s

PowerShell command Syntax

5.6 – View all Quotas assigned to a single Archive Mailbox

PowerShell command Syntax

PowerShell command Example

5.5 – View Statistic of all Archive Mailboxes

PowerShell command Syntax

5.6 – Display list of Active mailboxes and users

PowerShell command Syntax

5.7 – Display list inactive Mailbox accounts in Office 365

PowerShell command Syntax

6. Display Mail recipients

6.1 – Display list of Distribution Groups

PowerShell command Syntax

6.1 – Display list of Mail contacts

PowerShell command Syntax

7. Export information about Mailbox’s to file (CSV Format)

7.1 – Export User Mailbox’s information

PowerShell command Syntax

PowerShell command Example

7.2 – Export Room Mailbox’s information

PowerShell command Syntax

Export Equipment Mailbox’s information

PowerShell command Syntax

7.3 – Export Shared Mailbox’s information

PowerShell command Syntax

7.4 – Export information about mailboxes content (folders, items in folder etc.)

PowerShell command Syntax

7.5 – Export information about mailboxes LastLogonTime + LastLogoffTime

PowerShell command Syntax

8. Download PowerShell menu script

For your convenience, I have “Wrapped” all the PowerShell commands that were reviewed in a PowerShell Script named:
EXO-Display-and-Export.ps1
You are welcome to download the script and use it.

download-button-02.png

PowerShell command syntax – Office 365 | Article series index

Now it’s Your Turn!
It is important for us to know your opinion on this article


Summary
Article Name
Exchange Online – Display and Export information using PowerShell | Office 365
Description
In the current article, we review the how to use the PowerShell command Get-Mailbox for – display and export information about Exchange Online mailboxes.One of the most basic needs for Exchange Online administrator is – the ability to create reports that include information about the Exchange Online resources such as Mailbox’s, Distribution Groups, etc.
Author
Publisher Name
o365info.com
Publisher Logo

Please rate this

Print Friendly

Related Post

Eyal Doron on EmailEyal Doron on FacebookEyal Doron on GoogleEyal Doron on LinkedinEyal Doron on PinterestEyal Doron on RssEyal Doron on TwitterEyal Doron on WordpressEyal Doron on Youtube
Eyal Doron
Share your knowledge.
It’s a way to achieve immortality.
Dalai Lama

5 Responses to “Exchange Online – Display and Export information using PowerShell | Office 365”

  1. Generally I like this article a lot! but…We use ExchangeOnline Office 365 and the mailbox statistics scripts don’t populate the TotalItemSize and TotalDeletedItemSize attributes. I know this is related to the serialisation of data sent back to powershell. That’s why the script uses clumsy string manipulation techniques to solve the problem but it still doesn’t work for us. Any ideas for troubleshooting please?

  2. @Anonymous:

    I have mailboxes in Exchange Online also. I just used the “totalitemsize” and “totaldeleteditemsize” as values and removed all of the calculations. The results for those columns include a GB/MB/KB value with a bytes value in parentheses. I then converted the .csv to .xlsx and used find and replace to remove the bytes values from those columns. You can use (* bytes) in the “find” field and leave the “replace” field blank. For reference, here’s the cmdlet I used:

    get-mailbox -resultsize unlimited | get-mailboxstatistics | select-object displayname,lastlogontime,lastlogofftime,storagelimitstatus,totalitemsize,totaldeleteditemsize,itemcount,deleteditemcount | sort-object displayname -ascending | export-csv c:filesmbxinfo.csv

    Hope that helps,
    TC

Leave a Reply

Your email address will not be published. Required fields are marked *