Go to https://entra.microsoft.com/ and then to App Registrations.
Setting up ComArchive with Microsoft 365
ComArchive 5 introduces a new way to archive from Microsoft 365 in addition to the already existing Connector User. You can thus choose between these two options:
Connector User: The existing method used in ComArchive 3. A user account is created in Microsoft 365 which is excluded from MFA and has access to all mailboxes. ComArchive will use this account to connect and archive e-mails.
Enterprise App and Microsoft Graph: ComArchive is registered as an Enterprise App in Microsoft 365 and then uses Microsoft Graph for archiving. This does not require the Connector User.
When upgrading from ComArchive 3, ComArchive 5 will continue to archive using the Connector User, but you can manually change to Enterprise App, should you wish to do so.
Furthermore, a journal account needs to be set up. This is a special mailbox that uses mail flow rules to receive a copy of all incoming and outgoing mail. ComAchive then continuously empties this mailbox.
Active Directory setup
ComArchive fetches the list of users to archive from Active Directory. It is there very important that the e-mail address in AD matches the e-mail address of the user in Microsoft 365.
Setting ComArchive up as Enterprise App with Microsoft Graph
This is the manual procedure for configuring ComArchive to work with Microsoft 365 as an Enterprise App using Microsoft Graph. It is expected to automate most of this is a future version of ComArchive.
Create an app in Entra ID
-
-
Press New Registration and give the app a name (for example ComArchive).
-
Go to API Permissions in the menu on the left.
Press Add a permission and select Microsoft Graph. Then select Application permissions and check the following:
Calendars > Calendars.ReadWrite
Contacts > Contacts.ReadWrite
Mail > Mail.ReadWrite
Users > User.Read.All
Press Add permissions.
-
Press Add a permission again. Go to APIs my organization uses.
Enter ”Office 365” in the search box and select Office 365 Exchange Online from the list.
Select Application permissions.
Select Exchange > Exchange.ManageAsApp and add it.
-
Press Grant admin consent for <tenant> to grant consent for these permissions.
Configure roles in Entra ID
-
Now go to Roles & admin in Entra Admin Center.
Find Exchange Administrator in the list and pres it.
-
Press Add assignments.
Press No member selected at the bottom.
-
Search for the name of the Enterprise App previously created.
Select it and press Select.
-
Press Next and make sure this assignment is permanent. You need to provide a justification. You can use this text or write your own: "Required for ComArchive to work when using Entra ID Enterprise App".
Press Assign.
The Enterprise App is now configured correctly.
Configure certificate
-
On the ComArchive server run the following PowerShell commands as administrator:
$cert = New-SelfSignedCertificate -Subject ComArchive -CertStoreLocation cert:\LocalMachine\My -FriendlyName ComArchiveOffice365 -NotAfter 2030-01-01 Export-Certificate -Cert $cert -FilePath "C:\Path\To\Cert\ComArchiveApp.cer" $cert | fl thumbprintAdjust the date and path as needed.
Note the thumbprint returned by the last command. You'll need it later.
-
Now the ComArchive Service User (typically ComArchiveSysAcc) needs access rights to the private key of the newly created certificate.
Run certlm.msc and find the certificate under Personal. Right click and go to Manage private keys.
Press Add and find the Service User and grant it read permissions (it does not need Full Control).
-
Now go back to the app registration in Entra ID and go to Certificates and secrets and then to Certificates.
Press Upload certificate and pick the .cer file created by the PowerShell script.
Configure ComArchive
-
Open the ComArchive Adminstration Tool and go to Active Directory > Exchange Servers. Pick the correct AD domain from the menu and press Connect.
-
Right click an existing connection and select Properties or press Add Microsoft 365 Connection to add a new connection.
In the dialog box write the domain used in your e-mail addresses in the field at the top. Then select Entra ID Enterprise App under Authentication method.
Now you need the tenant Tenant ID and Client ID. Both of these can be found on the Overview page of the app in Entra ID.
Certificate Thumbprint was returned by the PowerShell script.
You also need to provide your onmicrosoft.com domain in Tenant name. This is needed for PowerShell to connect.
Remember to check Enable for Mailbox management and press Test Connection to check that the entered values are correct.
ComArchive has now been configured to Microsoft 365 using Graph.
Multiple domains
If you organization has multiple domains configured for the same tenant in Microsoft 365 each domain needs to be added separately in ComArchive. You can use the same Connector User for all of them. ComArchive uses the domain of the e-mail address to determine how to connect to Microsoft 365 and thus all domains need to be configured in ComArchive.
Connecting using Connecter User
-
Create a new user in Microsoft 365. It can have any username you want, but we'll call it ComArchiveConnector here.
This user does not need to be assigned a license, unless you wish to be able to assign access rights to it using the graphical Exchange Admin Center and not just PowerShell.
The Connector User must be excluded from any MFA policies.
-
Grant the Connector User access to all mailboxes. This can be done using the following PowerShell command (using the ExchangeOnlineManagement module):
Get-Mailbox | Add-MailboxPermission -User <connectoruser> -AccessRights FullAccessThe Connector User will not automatically get access to new mailboxes
When creating a new mailbox in Microsoft 365 (for example for a new employee), then Connector User will not automatically gain access to this mailbox. You need to manually assign Full Access permissions using either PowerShell or the Exchange Admin Center or set up an automated solution to run the above PowerShell script regularly. If you don't ensure that the Connector User has access, ComArchive will be unable to archive this new mailbox.
-
Open the ComArchive Adminstration Tool and go to Active Directory > Exchange Servers. Pick the correct AD domain from the menu and press Connect.
Right click an existing connection and select Properties or press Add Microsoft 365 Connection to add a new connection.
-
In the field Domain name used in e-mail addresses enter the domain used in your e-mail addresses.
Select Connector user under Authentication method and enter the e-mail address and password for the Connector User.
Press Test connection. ComArchive should now show a message that connection succeeded.
Check Enable for mailbox management to enable ComArchive to archive from this Exchange Server.