Last date modified: 2026-May-18
Microsoft preservation source automatic setup
Use an optional PowerShell script, O365PIPSetup.ps1, to automate Azure configuration steps needed to enable the Microsoft 365 Relativity preservation data source.
The script handles several of the required Azure configuration tasks, including:
- Creating a new Azure AD application for Relativity Preservation.
- Configuring application identifiers, redirect URIs, and other required properties.
- Assigning the required Microsoft Graph API permissions for data preservation.
- Automating granting admin consent to the required permissions.
- Assigning the Compliance Administrator and Exchange Administrator roles to the Application Registration.
- Creating the Service Principal for the registered application.
- Assigning the eDiscovery Case Admin permissions in Purview.
See these related topics:
PowerShell script
The script does not replace the official setup steps and is intended to streamline configuration. For more information, see Microsoft 365 Preservation Data Source Setup.
The script does not create or upload certificates. You must complete these steps manually in Azure AD. For more information, see Generate certificate.
You must create the Preservation Data Source in your Relativity workspace before using the script. For more information, see Creating the Microsoft 365 data source.
Exchange Online PowerShell is required only where Microsoft requires it to support preservation and mailbox hold operations.
- Relativity uses Microsoft‑supported modules and roles.
- Relativity does not rely on legacy or unsupported APIs.
Minimum supported access
The permissions, roles, and Exchange Online configuration steps described in this topic are the minimum supported requirements for Preservation in place.
Relativity does not support alternative permission models, substitute roles, or reduced access scopes for these operations. Changing or omitting required permissions may result in failed holds or unsupported preservation behavior.
Prerequisites
Before running the script, ensure you have:
- An Azure AD Global Administrator or equivalent permissions.
- Access to the Azure tenant where the Relativity Preservation Data Source will be configured.
Run PowerShell script
Complete the following steps to run the PowerShell script:
Exchange Online PowerShell is required only where Microsoft requires it to support preservation and mailbox hold operations. Relativity uses Microsoft‑supported modules and roles and does not rely on legacy or unsupported APIs.
- Download O365PIPSetup.ps1 and save to a secure location.
- Open PowerShell.
- Run the script, for example: .\O365PIPSetup.ps1
- The script will prompt you to provide an application name and create a Service Principal name.
-
The script will prompt you to login to Microsoft three times, once for each PowerShell module being used. Login to the Microsoft tenant where you intend to do the setup.
- Once the script is complete, it will provide you with the create Client ID, Tenant ID, and Domain. Confirm that the Azure application has been created and configured.

- Manually upload the certificate to the application. For more information, see Generate certificate.
- Create the Preservation data source using the Client ID, Tenant ID, and Domain provided from the script. For more information, see Creating the Microsoft 365 data source.
- Validate the credentials. For more information, see Validate preservation hold credentials.
Validate the PowerShell script
After running the script and uploading your certificate, validate the following:
- The Azure AD app appears under App Registrations.
- Required API permissions are present and granted.
- The certificate is successfully uploaded.
- App Registration is assigned the Compliance Administrator and Exchange Administrator roles.
- Relativity Preservation can connect to Microsoft 365 using the new data source.
- This script is intended as a convenience tool and is not mandatory.
- Updates may be required as Microsoft Graph or Azure API requirements evolve.
Once complete, you can set up the Microsoft preservation source in RelativityOne. For more information, see Creating the Microsoft 365 preservation source.