Exchange Permissions
Client Sense requires exchange permissions to read message logs, retrieve employee information and to pull contact info from emails.
Message logs and employee information is retrieved through PowerShell and contact info is retrieved using EWS.
Office 365 / Exchange Online
Account
If the serviceaccountname account hasn't synced through to Office 365 you can manually create an account
- Log in to your Office 365 Administrator portal
- Navigate to Admin centres - Exchange
- Select Users > Active Users on the left
- Add a user
- Set the name and display name as appropriate
- Set the username to serviceaccountname@yourdomain.com
- Set the password to the domain account password
- Set the password to not expire
- Set the user to unlicensed
- Create
Multi Factor Authentication (MFA/2FA)
Client
Sense doesn't support MFA prompts on the service account. The account
can have MFA enabled but it needs to be configured and whitelisted for
the IP address of Client Sense itself so that it isn't prompted when
accessing Office 365.
- Enable MFA on the service account
- Whitelist the IP address for your organisation, assuming the Client Sense server is hosted internally
- Log into the service account from your organisation
- Configure mfa for the account using an email or mobile number
- Log out and back in to ensure account isn't prompted for MFA
Assigning a Role Group
We recommend creating a new role group to assign the specific permissions that Client Sense requires to function
- Log in to Exchange admin centre https://admin.exchange.microsoft.com/
- Select Roles on the left > Admin roles
- Click Add a role group
- Name: Client Sense Management
- Click Next
- Roles:
- View-Only Recipients
- Message Tracking
- ApplicationImpersonation
- Members: serviceaccountname
- Save the role group
Testing Roles
Open powershell
Run the command to import the EXO module
Import-Module ExchangeOnlineManagement
Run the following command to connect using the service account email
Connect-ExchangeOnline -UserPrincipalName serviceaccountname@domain.com
Enter the service account password when prompted
Run command
If no errors are returned and you see a list of all mailboxes in your organisation this permission has been assigned correctly
Run command
If no errors are returned and you see a list of dated records this permission has been assigned correctly
Testing Application Impersonation
Please wait at least 15 minutes between assigning this role and testing it. This permission will be tested during the installation and configuration of Client Sense.
Use this Microsoft tool to test impersonation access
- Navigate to https://testconnectivity.microsoft.com/
- Microsoft Exchange Web Services Connectivity Tests
- Service Account Access (Developers)
- Next
- Target mailbox - the email of someone in your organisation to test against
- Service account username - serviceaccountname@domain.com
- Enter password
- Check Use Exchange Impersonation
- Enter the email used in Target mailbox
- Agree to the terms and verify the captcha
- Perform Test
Exchange
Assigning a Role Group
We recommend creating a new role group to assign the specific permissions that Client Sense requires to function
- Log in to your Exchange Control Panel (ECP), usually http://mail.yourdomain.com/ecp
- Select Roles & Auditing on the left
- Create a new role group
- Name: Client Sense Management
- Roles:
- View-Only Recipients
- Message Tracking
- Application Impersonation
- Members: serviceaccountname
- Save the role group
Enable Authentication on the PowerShell Application
Authentication needs to be enabled on the Client Sense application so that it can connect using PowerShell. When using Office 365 / Exchange online this authentication method is already enabled.
- Log in to your Exchange Server
- Open Internet Information Services (IIS)
- Expand Servername > Sites > Default Web Site
- Select PowerShell
- Under the IIS heading double click Authentication
- Select Basic Authentication
- Select Enable on the right under Actions
Click image to view larger version
Testing Roles
Open powershell
Run command
- $SessionOptions = New-PSSessionOption –SkipCACheck –SkipCNCheck –SkipRevocationCheck
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://mail.yourdomain.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection -SessionOption $SessionOptions
Enter the serviceaccountname credentials into the dialog that appears, if the account upn has been configured correctly you should be able to use serviceaccountname@yourdomain.com
If you receive an error with no error message such as the below when trying to authenticate using the above, confirm that the account UPN in AD has been configured to the fqdn rather than the local domain.
"Connecting to remote server mail.domain.com failed with the following error message : "
Note - this is a low quality image provided by a client
Run command
- Import-PSSession $Session
Run command
If no errors are returned and you see a list of all mailboxes in your organisation this permission has been assigned correctly
Run command
If no errors are returned and you see a list of dated records this permission has been assigned correctly
Testing Application Impersonation
Please wait at least 15 minutes between assigning this role and testing it
Use this Microsoft tool to test impersonation access
- Navigate to https://testconnectivity.microsoft.com/
- Microsoft Exchange Web Services Connectivity Tests
- Service Account Access (Developers)
- Next
- Target mailbox - the email of someone in your organisation to test against
- Service account username - serviceaccountname@yourdomain.com
- Enter password
- Check Use Exchange Impersonation
- Enter the email used in Target mailbox
- Agree to the terms and verify the captcha
- Perform Test