Skip to main content
Skip table of contents

Create EWS Mailbox list via PowerShell

Description

When creating a list of EWS users via Discovery Attender Settings->EWS Options->PowerShell->Export, the list may not be created, or another error may be encountered. The PowerShell button on the EWS Mailbox selection screen (see screenshot below) is populated by a .dat file created (usually) in the Settings. However, sometimes the creation of this list cannot be accomplished within the settings. PowerShell can be used to create this list.

The PowerShell command to create the file is as follows in version DA 4.0 or higher:

CODE
get-mailbox -ResultSize unlimited | fl RunspaceId,UserPrincipalName,PrimarySmtpAddress,DisplayName,WindowsEmailAddress > EWSAccounts.dat

Note: If you would like to filter by department, the following command should work

CODE
Get-Recipient -ResultSize Unlimited -RecipientType UserMailbox -Filter {department -eq "DepartmentName"} | Get-Mailbox | fl RunspaceId,UserPrincipalName,PrimarySmtpAddress,DisplayName,WindowsEmailAddress > EWSAccounts.dat

Note:

If you are having trouble exporting the list of mailboxes, please check these areas before attempting this PowerShell Command.

  1. Azure permissions

    1. Confirm these permissions are configured as specified in the Discovery Attender Getting Started Guide

    2. Confirm modern authentication is correctly configured for Discovery Attender

  2. Default value for EWS List is incorrect (only applies to Discovery Attender version 4.3)

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.