How to Configure the PreferredDataLocation filed in AD/Entra ID

Have you noticed the “Preferred data location” field in Entra ID on a synced user and wondered how to use it? You might have clicked the edit button next to Settings, only to find yourself on a page where you can’t see or modify this field. The reason is that this setting needs to be configured on-premises within Active Directory (AD) and properly set up in Entra ID Connect to sync with your Entra environment.

In this short post, I’ll guide you through the exact steps to configure it.

The Solution

Step 1: Disable Entra ID Synchronization

Before making any changes to your on-premises AD schema, make sure to stop the Entra ID synchronization.

  1. Open PowerShell on the Synchronisation Service manager server.
  2. Disable the scheduler by running the PowerShell shown below –
Set-ADSyncScheduler -SyncCycleEnabled $false
  1. Open the Synchronisation Service Manager application and ensure there are no “in progress” jobs showing under the Operations tab, if there are, wait for them to complete before continuing.

Step 2: Configure the source attribute on the AD Connector schema

Now we need to ensure that the msDS-preferredDataLocation source attribute is enabled for syncing to Entra ID.

  1. In the Synchronization Service Manager, navigate to the Connectors tab.
  2. Select your Active Directory Domain Services connector and then select properties in the right-hand Actions menu.
  1. In the Properties window that appears, navigate to the Select Attributes tab and then check the Show All checkbox.
  2. Check the msDS-preferredDataLocation attribute and then click OK to confirm the addition of the attribute.
  1. Now select the Windows Azure Active Directory connector, and select Properties again to open the Properties window.
  2. Navigate to Select Attributes again and then ensure the Show All checkbox is checked. Then select the preferredDataLocation attribute and click OK to ensure the attribute is synced.

Step 3: Create an inbound synchronisation rule

Next, we need to configure an inbound synchronization rule that enables the selected on-premises attribute to sync with Entra ID.

  1. Open the Synchronization Rules Editor application and select “Add new rule” to create a new inbound rule.
  2. In the Description tab, enter the following information –
    • Name – In from AD – User preferredDataLocation
    • Connected System – Select your AD connector
    • Connected System Object Type – user
    • Metaverse Object Type – person
    • Precedence – 1-99 (select an unused number between 1-99)
    • Leave all other fields at their default values and click Next.
  3. Continue through to the Transformations tab then select Add transformation.
  4. Select preferredDataLocation as the target Attribute and msDS-preferredDataLocation as the Source then click Add.

Step 4: Create an outbound synchronisation rule

Next, we need to create an outbound synchronization rule that allows modifications to sync back to AD.

  1. Change the Direction dropdown in the Synchronization Rules Editor to Outbound then select Add new rule.
  2. In the Description tab, enter the following information –
    • Name – Out to AAD – User preferredDataLocation
    • Connected System – Select your Entra ID connector
    • Connected System Object Type – user
    • Metaverse Object Type – person
    • Precedence – 1-99 (select an unused number between 1-99, this must be different to the inbound rule precedence)
    • Leave all other fields at their default values and click Next.
  3. In the Scoping filter tab, select Add group and add the following 2 clauses –
    • sourceObjectType EQUAL User
    • cloudMastered NOTEQUAL True
  1. Continue through to the Transformations tab then select Add transformation.
  2. Select preferredDataLocation as the target Attribute and preferredDataLocation as the Source then click Add.

Step 5: Run full synchronisation

The Synchronization Service Manager will automatically schedule the necessary full synchronizations once the Sync Scheduler is re-enabled using the PowerShell script below. However, if you prefer to manually schedule them, you can follow the instructions provided in Step 7 at the link below.

Set-ADSyncScheduler -SyncCycleEnabled $true

Microsoft Entra Connect: Configure preferred data location for Microsoft 365 resources – Microsoft Entra ID | Microsoft Learn

Once a sync has completed, the modified property will begin appearing on any synced users –

One response to “How to Configure the PreferredDataLocation filed in AD/Entra ID”

  1.  Avatar
    Anonymous

    I ran through the guide, but the property does not show up on the Entra side. Is there a requirement for the Multi-Geo licensing to be applied for this to show up?

    Like

Leave a reply to Anonymous Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Design a site like this with WordPress.com
Get started