Office 365 requires a Location, in the form of a Country, be assigned to each user prior to assigning any license. Users that are created and managed through our Control Panel will automatically adopt the proper country for their Location. However users created via AD Sync may not automatically receive a proper Location assignment, resulting in the inability to add licenses to that user. This article provides the steps to configure your local Active Directory sync rules to push a user's country Location to the Office 365 tenant.
- In the local Active Directory, open the Synchronization Rules Editor. This can be found in the Start menu of your domain controller under the Azure AD Connect group.
- In the Synchronization Rules Editor, select Outbound from the Direction drop-down field.
- Select Out to AAD - User Join from the rules list to highlight it.
- Click the Edit button.
- In the Edit Reserved Rule Confirmation window, click the No button.
- Click Transformations in the left-hand menu.
- Locate the rule with the Target Attribute of usageLocation.
- Click the FlowType drop-down field for this rule and select Direct.
- Click the Source drop-down field for this rule and select c.
- Click the Save button.
- Click the X button in the top-right corner of the Synchronization Rules Editor window to close it.
The "c" attribute for each user should be populated with the proper Country Code (such as "US" for United States). The attribute can be adjusted by opening a user's Properties in Active Directory and then selecting the Attribute Editor tab. This attribute will then be synced to the Location field for each new user created via AD Sync.