Start a conversation

Setting Permissions for GFI Archiver in Microsoft Office 365 Using EWS

Overview

For GFI Archiver to sync items from Microsoft Office 365 using EWS (Exchange Web Services) specific permissions are required. This article shares the process for setting necessary permissions.

 

Solution

Follow these steps to set the permissions:

  1. Open a Power Shell with the Azure module
  2. Execute the following commands with the user information (highlighted in the code block below in bold) to set permissions:
    Set-ExecutionPolicy RemoteSigned

    $O365Cred = Get-Credential
    $O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection

    Import-PSSession $O365Session
    Connect-MsolService –Credential $O365Cred
    Enable-OrganizationCustomization

    New-ManagementScope -name "MAUMPolling" -recipientrestrictionfilter {recipienttype -eq "UserMailbox"}
    New-ManagementRoleAssignment -name "MAUMPollingRA" -role:applicationimpersonation -user "administrator@mydomain.com" -customrecipientwritescope "MAUMpolling"
  3. Set On-premise Active Directory requirements:
    • An on-premise Active Directory is required.
    • Users which are to be synchronized from Microsoft Office365 must be added into the local on-premise Active Directory.
    • Users in Active Directory must have the MAIL fields set which must map to the email address of the corresponding user in Microsoft Office 365.

 

NOTE 

If using Multi-Factor authentication additional prompts are needed to authenticate if users are receiving PSSessionOpenFailed when performing the commands

$office365UserPrincipalName = "admin@emea.contoso.com" 
$PSExoPowershellModuleRoot = (Get-ChildItem -Path $env:userprofile -Filter CreateExoPSSession.ps1 -Recurse -ErrorAction SilentlyContinue -Force | Select -Last 1).DirectoryName
$ExoPowershellModule = "Microsoft.Exchange.Management.ExoPowershellModule.dll";
$ModulePath = [System.IO.Path]::Combine($PSExoPowershellModuleRoot, $ExoPowershellModule);

Import-Module $ModulePath;

$Office365PSSession = New-ExoPSSession -UserPrincipalName $office365UserPrincipalName -ConnectionUri "https://outlook.office365.com/powershell-liveid/"

Import-PSSession $Office365PSSession

 

Testing

After performing the steps to set the permissions, users will perform the steps outlined in Using GFI Archiver Import/Export Tool for Importing Emails from Microsoft Exchange Mailboxes to perform an Import of the mail stored in the Exchange mail store. 

 

Related Articles

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted
  3. Updated

Comments