Connect to O365 Mailbox


An O365 admin will need to do the following steps, and will need to log in to GovAP with a user account that is in the ‘site administrators’ group. The steps must be done in sequential order.


1. Log into GovAP with an administrator account

2. Go to Admin by clicking link on the top bar, and then IMAP Accounts Tab

3. Add O365 account if it doesn’t exist and then click “Test and Check Mail”

4. Click “Grant Tenant Admin Consent” button
5. Login to Microsoft Admin account and agree to the permissions that we are requesting

6. After you are redirected back to GovAP, move on to the next steps. This admin page can be used to test the connection, once the next steps have been finished.


2. Obtain the Object Id for the GovAP O365 Email Integration

Visit this link, try to find RTVision’s application for GovAP and click on it. Should look like the following

Copy the Object ID which appears in the Object ID box by clicking on the clipboard icon. Will look like the following

Note the Object ID will be different than the example.

Save this Object id for use in the next step


3. Give permissions to access a specific mailbox

In powershell on any windows computer with internet access, install and import the exchange online management module if not already installed and imported

Set-ExecutionPolicy RemoteSigned Install-Module -Name ExchangeOnlineManagement Import-module ExchangeOnlineManagement

then run the below commands. On line 2, use the Object ID from the previous step for the -ServiceId value.
Also pay attention to the comment in line 3, need to grab the ServiceId value for the command on line 4.
For line 4, The -Identity value is the mailbox that GovAP should access. Microsoft requires FullAccess to be able to use IMAP on a mailbox.

Connect-ExchangeOnline -UserPrincipalName support@rtvision.com # change to your O365 Admin Account email used to login New-ServicePrincipal -AppId 2f32f914-64e7-4f54-99d6-b3a46f6c70be -ServiceId <OBJECT_ID_FROM_PREVIOUS_STEP> -DisplayName GovAP Get-ServicePrincipal | fl # Grab the ServiceId for next command, may or may not be the same as ServiceId in previous command Add-MailboxPermission -Identity "invoice-mailbox@rtvision.com" -User <SERVICE_PRINCIPAL_ID> -AccessRights FullAccess

The ‘Identity’ from line 4 should match the Email account set up under the ‘IMAP Accounts’ tab in GovAP