Thank you for reaching us!
I understand that you are facing an issue with assigning licenses for new users, and you’ve found that the Preferred Data Location field is not being populated for these users.
The Preferred Data Location (PDL) in Azure Active Directory is indeed used to specify the geographical location where a user’s Microsoft 365 data is stored. However, this does not impact license assignment. The issue could be related to the users’ usage location, which you can see in the screenshot provided.
If the Office 365 license is not available to the users who have been created on-premises, it could be due to the usage location attribute not syncing or set with Microsoft Entra ID. This is a mandatory property that needs to be assigned while assigning the license.
This property can be set manually from the GUI in the users’ properties, as shown in the screenshot below.
You can also set this property using PowerShell with the following command.
Set-MsolUser -UserPrincipalName “user@
This command sets the usage location of a user. The country should be a two-letter ISO code.
I understand that you are using AD Connect in your environment which means you syncing the objects from on-Premises to Entra ID (Azure AD) so you may have already populated following attributes for an on-premises user.
- C = Country Code
- CO = Country Name
- Country Code = Numerical number of the code
Even though you have populated above attributes in on-prem AD for the users and AADConnect synchronize the accounts to Azure AD, Usage Location is not populated in Azure AD. The reason is that these attributes are not used by Azure AD to set Usage Location.
By default, in Azure AD Connect “UsageLocation” in the Azure Active Directory is mapped to “msExchUsageLocation” on-premises. So, if you populate msExchUsageLocation with two letter ISO code for the users in on-premises, users will be assigned Usage Location. Values assigned in on-prem will be overwritten in Azure AD during the AADConnect sync.
If you do not want to populate msExchUsageLocation as you already have attribute “C” is updated with two letter country code, then you may change flow rules of AAD Connect to map “C” to “UsageLocation”.
The above attribute is exchange attribute, if you do not have the exchange in you on-Premise, install the exchange schema in your on-premise this will help you to create particular attribute and run the sync to populate attribute value.
I hope this answer helps! If you have any further questions, please feel free to ask.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.