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.

  1. 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.

  2. In the Synchronization Rules Editor, select Outbound from the Direction drop-down field.

  3. Select Out to AAD - User Join from the rules list to highlight it.

  4. Click the Edit button.

  5. In the Edit Reserved Rule Confirmation window, click the No button.

  6. Click Transformations in the left-hand menu.

  7. Locate the rule with the Target Attribute of usageLocation.

  8. Click the FlowType drop-down field for this rule and select Direct.

  9. Click the Source drop-down field for this rule and select c.

  10. Click the Save button.

  11. 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.