Answer · Low impact

Licence assignment fails: usage location is not set

Symptom

Assigning a Microsoft 365 licence fails with an error that the user's usage location is required, often for accounts created by a script or by sync.

Cause

Licences can only be assigned when the user has a usage location, because service availability differs by country.

Resolution

  1. Set the usage location on the user.

  2. Assign the licence again.

  3. For synced users, set it through group-based licensing defaults or a sync rule so new accounts get it.

Script

PowerShell
Connect-MgGraph -Scopes User.ReadWrite.All
Update-MgUser -UserId user@contoso.com -UsageLocation "IN"

Related script sample

Assign licences in bulk from a CSV →

Disclaimer. These samples are provided as is, without warranty of any kind. Read and test every script in a non-production tenant before you run it, and run reports before any command that changes or deletes data.