Can't add Exchange license in Microsoft Entra Connect for Microsoft 365
Original KB number: 4052036
Symptoms
You receive an error message when you try to add an Exchange license in Microsoft Entra ID for Microsoft 365.
Resolution
There are two Windows Azure Active Directory modules to administer Microsoft Entra ID through PowerShell. Both are supported currently.
MSOL - For more information about MSOL module, see the following articles:
AzureAD - For more information about AzureAD module, see the following articles:
Note
Azure AD and MSOnline PowerShell modules are deprecated as of March 30, 2024. To learn more, read the deprecation update. After this date, support for these modules are limited to migration assistance to Microsoft Graph PowerShell SDK and security fixes. The deprecated modules will continue to function through March, 30 2025.
We recommend migrating to Microsoft Graph PowerShell to interact with Microsoft Entra ID (formerly Azure AD). For common migration questions, refer to the Migration FAQ. Note: Versions 1.0.x of MSOnline may experience disruption after June 30, 2024.
This issue can occur under different circumstances.
If you receive an error message when assigning a new license, confirm that the object exists in the Microsoft Entra ID by using the Azure AD PowerShell module. A
UsageLocation
parameter is required and has to be populated. For example:Get-MsolUser -SearchString <userPrinicipalName or DisplayName> | fl UsageLocation
Get-AzureADUser -SearchString <userPrinicipalName or DisplayName> | fl UsageLocation
To resolve this issue, try assigning the license through PowerShell. See Assign Microsoft 365 licenses to user accounts with PowerShell. If it doesn't resolve the issue, collect the PowerShell log file that's located here and open a case with Microsoft:
%userprofile%\appdata\local\microsoft\Office365\PowerShell
If DirSync errors are present on an object, you may receive an error message when you try to change the license for the object, including adding or removing features. Check for these errors by using the following support articles:
- View directory synchronization errors in Microsoft 365
- How to identify
DirSync
or Microsoft Entra Connect provisioning errors in Microsoft 365
For more information about how to troubleshoot, see the following articles:
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for