ENTRA.UA.1017 - All users should have usageLocation configured
All users should have usageLocation configured
Description
All enabled member users must have the usageLocation property configured. The usageLocation is a mandatory prerequisite for license assignment in Microsoft 365.
Without a configured usageLocation, administrators cannot assign licenses to users, which prevents access to Microsoft 365 services like Exchange Online, Teams, SharePoint, and other licensed applications.
The usageLocation property must be set to a valid two-letter ISO 3166-1 alpha-2 country code (e.g., "US" for United States, "GB" for United Kingdom, "CA" for Canada).
info
This test only checks enabled accounts, as disabled users don't require licenses.
How to fix
Option 1: Set usageLocation via Azure Portal
- Navigate to the Microsoft Entra admin center
- Go to Users > All users
- Select the user without usageLocation
- Click Edit properties
- Under Settings, set the Usage location field
- Click Save
Option 2: Set usageLocation via PowerShell (Single User)
# Connect to Microsoft Graph
Connect-MgGraph -Scopes "User.ReadWrite.All"
# Set usage location for a specific user
Update-MgUser -UserId "user@domain.com" -UsageLocation "US"
Option 3: Set usageLocation via PowerShell (Bulk Update)
# Connect to Microsoft Graph
Connect-MgGraph -Scopes "User.ReadWrite.All"
# Get all users without usageLocation
$usersWithoutLocation = Get-MgUser -Filter "userType eq 'Member' and accountEnabled eq true" `
-Property Id,DisplayName,UsageLocation,UserPrincipalName -All |
Where-Object { [string]::IsNullOrEmpty($_.UsageLocation) }
# Set default usage location (adjust "US" to your organization's location)
foreach ($user in $usersWithoutLocation) {
Update-MgUser -UserId $user.Id -UsageLocation "US"
Write-Host "Updated usageLocation for $($user.DisplayName)"
}
Important considerations
- Country codes: Use ISO 3166-1 alpha-2 codes (two-letter country codes)
- Legal compliance: Ensure the usageLocation reflects where services will be consumed to comply with data residency requirements
- Automated provisioning: Consider setting usageLocation as part of your user onboarding workflow