Skip to main content

Use Druva APIs to Move Users Converted to Shared Mailboxes to a Different Profile

Use Druva APIs to Move Users Converted to Shared Mailboxes to a Different Profile

Updated this week

Overview:

The steps in this document describe the logical workflow and APIs required to perform this operation.

Customers can implement this workflow using any preferred automation or scripting tool, such as:

  • Python

  • PowerShell

  • Postman workflows

  • Integration platforms

  • Internal automation frameworks

The workflow should:

  1. Execute the Preserved Users Datasources report.

  2. Filter the results based on the required license states.

  3. Extract the userID values from the report output.

  4. Retrieve the target ProfileID using the Profile API.

  5. Loop through the filtered users and invoke the User Management API to update the profile.

Prerequisite

Before implementing this workflow, create a dedicated inSync profile for Shared Mailboxes.

  • In the Druva inSync Management Console, create a new profile intended to host Shared Mailboxes only.

  • Configure the profile with the following settings:

    • Exchange Online: Enabled

    • OneDrive: Disabled

  • This ensures that only the mailbox data is protected after a user is converted to a Shared Mailbox.

Note: The API endpoints and parameters referenced in this article are based on the current Druva Public API documentation at the time of publication.

Druva continuously enhances its APIs, and API endpoints, parameters, or response fields may change in future releases. Customers should always refer to the latest documentation available on the Druva Developer Portal before implementing or maintaining their workflows.

If any discrepancies are observed between this article and the latest API documentation, the Developer Portal documentation should be considered the authoritative source.

Workflow:

Step 1: Generate API Access Token

1. Create Druva Admin API Credentials:

  1. Log in to the Druva Cloud Platform Console.

  2. Navigate to Menu → Integration Center → API Credentials.

  3. Click New Credentials.

  4. Note the following values:

    • ClientID

    • Secret

2. Generate Access Token

Use the ClientID and Secret to generate an OAuth access token.

  • API: POST /oauth/token

Capture the following value from the response:

  • access_token

3. Use Access Token in API Requests

Include the access token in the Authorization header for all subsequent API calls.

Example header format:

Authorization: Bearer <access_token>


Step 2: Retrieve Preserved Users Datasources Report

Filter the results to include users where:

  • smbLicenseState = YES

  • m365LicenseState = Preserved

Store the userID values for the next step.


Step 3: Retrieve Available Profiles

  • API:
    GET /insync/profilemanagement/v1/profiles

  • Purpose: Retrieve the list of available profiles.

  • Fields to capture:

    • profileName

    • profileID

Identify the ProfileID to assign to the filtered users.


Step 4: Configure Workflow Input for Target Profile

Configure the workflow to accept a ProfileID input parameter.

  • Source: Profile list retrieved in Step 3

  • Purpose: Allow administrators to specify the target profile to assign to users returned in the report.


Step 5: Update Profile for Filtered Users

  • API:
    PATCH /insync/usermanagement/v1/users/{userID}

  • Purpose: Update the user profile.

  • Fields to provide:

    • userID (from Step 2 report output)

    • profileID (workflow input from Step 4)

Execute this API for each userID retrieved from the report.


Outcome

The workflow updates the profile assignment for all users who:

  • Have SMB license enabled, and

  • Have Microsoft 365 datasource in Preserved state.

Note:

If you encounter issues or output inconsistency while invoking the Druva APIs described in this article, contact Druva Support for assistance with API availability or behavior.

Druva Support can assist with API usage and troubleshooting. However, development, customization, or debugging of scripts and automation workflows created using these APIs is outside the scope of Druva Support.

Did this answer your question?