O'Reilly logo

Microsoft Exchange Server 2013 PowerShell Cookbook - Second Edition by Mike Pfeiffer, Jonas Andersson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exporting address list membership to a CSV file

When it comes to working with address lists, a common task is exporting the list of members to an external file. In this recipe, we'll take a look at the process of exporting the contents of an address list to a CSV file.

How to do it...

Let's start off with a simple example. The following commands will export the All Users address list to a CSV file:

$allusers = Get-AddressList "All Users"
Get-Recipient -RecipientPreviewFilter $allusers.RecipientFilter | 
  Select-Object DisplayName,Database | 
    Export-Csv -Path c:\allusers.csv -NoTypeInformation

When the command completes, a list of user display names and their associated mailbox databases will be exported to c:\allusers.csv.

How it works...

The first ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required