Export information about email address to file



The user property described as: Email address, can contain more than one email address (Primary email address and proxy email address) and many types of email address types such as: SMTP, .500, etc.,
In other words, we can say that the Email address property, can be considered as an “array” that contains multiple values (Email addresses).
When we use a PowerShell command for displaying information about specific user property such as: Email Address, the information that is displayed on the screen cannot contain by default all the information that is contained within the Email address property.
In the following screenshot we can see the output of the PowerShell command:
Get-Mailbox | Select UserPrincipalName,DisplayName,Name,EmailAddresses
We get only a partial information about the email addresses.
Display-Export information about Email Address standard view

3.1 – Display Email address information on screen – Using the Wrap parameter

To be able to display all of the information in the PowerShell command syntax:
PowerShell command Syntax
Display Email address information on screen - Using the Wrap parameter


3.2 – Display Email address information on screen – Using the Expand parameter

PowerShell command Syntax
PowerShell command Example

Export information about email address to file

In the following section, we review the option that we can use for exporting information about an Office 365 users and their mail addresses.
Exporting information to a CSV enable us to edit or “manipulate” the information by using applications
such as: Excel. The option of exporting information to HTML file is more suitable for reports.

3.3 – Export information about email address to CSV file

PowerShell command Syntax
PowerShell command Example



3.4 – Export information about email address to HTML file

When using the default option of exporting data to HTML file, the output is a little row.
To make the output of the HTML more “readable,” we can use a “prefix” that the standard export PowerShell command that will handle the design of the HTML output. Because the command contains many lines and characters, the best practice is to use this syntax by using a PowerShell script.
At the bottom of the post, you can find a PowerShell script that includes the option of exporting the information to HTML.
In the following screenshot, we can see the content of the HTML file when using the “design” instructions”:
Export information to HTML
PowerShell command Syntax


Commenti

Post popolari in questo blog

Come e quando smantellare i server Exchange in una distribuzione ibrida

Manage Room Mailbox by using PowerShell

How to reset an Office 365 install to the initial activation/install state