To set up Microsoft Graph (MSGraph) to export PST files from Microsoft Purview (formerly known as Microsoft 365 compliance center), you'll need to follow a series of steps that involve configuring permissions, creating an application in Azure Active Directory (Azure AD), and using the Microsoft Graph API or Microsoft Graph Explorer to perform the export. Here's a step-by-step guide to help you through the process:
Step 1: Prerequisites
Permissions and Roles: Ensure you have the necessary permissions and roles in Azure AD and Microsoft 365 compliance center. You need to be a member of the eDiscovery Manager role group in the compliance center and have appropriate permissions in Azure AD.
Azure AD Application: You need to register an application in Azure AD to use Microsoft Graph.
Azure Active Directory: Select Azure Active Directory from the navigation menu.
App Registrations: Click on "App registrations" and then click on "New registration".
Register the Application: Enter a name for your application, select the supported account types, and optionally provide a redirect URI. Click "Register".
API Permissions: Go to "API Permissions", click on "Add a permission", and search for "Microsoft Graph". You will need to add the necessary permissions for your task. For exporting PST files, you'll likely need permissions related to SecurityEvents.Read.All, ComplianceData.Read, or similar, depending on your specific requirements. Be cautious and follow the principle of least privilege.
Grant Admin Consent: If the permissions you added require admin consent, click on "Grant admin consent for [Your Tenant]".
Step 3: Create a Client Secret
Certificates & Secrets: In your application, navigate to "Certificates & secrets".
Add a Client Secret: Click on "New client secret", add a description, and click "Add". Copy the client secret value immediately, as it won't be displayed again.
Step 4: Configure Microsoft Graph
Choose Your Method: You can use either Microsoft Graph Explorer (a tool that allows you to explore Microsoft Graph APIs) or write your own application using Microsoft Graph SDKs.
Authenticating: To use Microsoft Graph, you need to authenticate your application. You can use the client ID and client secret to obtain an access token.
Step 5: Export PST from Purview using Microsoft Graph
Identify the API: The specific Microsoft Graph API for exporting PST from Purview involves using the ediscoExport resource type and related APIs. You may need to create an eDiscoveryCase, eDiscoveryCustodian, eDiscoverySearch, and then an eDiscoveryExport.
Create an eDiscovery Case: Use the Microsoft Graph API to create a case. This involves making a POST request to https://graph.microsoft.com/v1.0/security/cases/ediscoveryCases.
Add Custodians and Data Sources: Identify custodians and their data sources, and add them to the case.
Create a Search: Define a search within the case to identify the data you want to export.
Export the Data: Once the search is complete, you can export the results. This involves creating an export action, specifying the PST format, and potentially other parameters.
Monitor the Export: Use Microsoft Graph to monitor the status of the export.
Example API Calls
Here's a simplified example of creating an eDiscovery case:
http
POST https://graph.microsoft.com/v1.0/security/cases/ediscoveryCases
Content-Type: application/json
{
"displayName": "My eDiscovery Case"
}
And an example of exporting data (this is a simplified representation and actual API calls may vary based on the latest Microsoft Graph API):
http
POST https://graph.microsoft.com/v1.0/security/cases/ediscoveryCases/{caseId}/searches/{searchId}/export
Content-Type: application/json
{
"exportOptions": "PST"
}
Step 6: Review and Refine
Test and Validate: Test your application or Graph Explorer calls to ensure they work as expected.
Refine Permissions and Queries: Adjust permissions and refine your queries as necessary to achieve the desired outcome.
Note
The exact steps and API calls may evolve with updates to Microsoft Graph and Purview. Always refer to the latest Microsoft documentation for the most current information and detailed instructions.