Skip to content

Ulysses Neves

Microsoft Entra ID, authentication, and hybrid identity troubleshooting.

Menu
  • Home
  • Microsoft Azure
  • Microsoft AD FS
  • Microsoft 365
  • Contact
  • Troubleshooting Index
Menu

Microsoft Entra multifactor authentication – Assigning licenses to users in Azure for MFA use

Posted on November 11, 2019

Update notice — September 2026: This article contains commands from the Azure AD or MSOnline PowerShell modules maintained since its original publication. Microsoft has deprecated these modules and recommends Microsoft Graph PowerShell for current automations. Do not use the legacy commands in new implementations.

Source: Guidance for migrating to Microsoft Graph: “Azure AD, Azure AD Preview and MSOnline PowerShell modules are deprecated.”

Hello, everyone. In today’s article, we’ll show how to assign licenses to Azure users for MFA use, using the Azure portal and PowerShell. This article covers the “configure multi-factor authentication settings” topic of the AZ-500 – Microsoft Azure Security Technologies exam. If you’re preparing to take this exam, don’t miss the next articles on this blog.

Activating licenses for users using the portal

Open the licenses menu by clicking this link.

Sign in with your Azure credential.

Select the product you want to assign the license to.

In our illustration, we’ll assign the E5 license that we have available for MFA use.

You can see two users who already have a license assigned.

Let’s click Assign to add a license for one more user.

Click the Users and groups menu to select the user or group of users who will receive the license.

To make it easier to find the user, we type the name in the search.

Click the user and then Select.

Let’s now select the product. Click Assignment options.

In the license options, within the license you want to assign, you can select certain services that the user may or may not use.

Let’s leave all options selected and click OK.

With the assignments configured, click Assign.

Attention: To assign a license to a user in Microsoft Entra ID, the user must have the usage location attribute properly filled in, or you will receive the error below.

Let’s assign a location to the user John.

Open the All users menu by clicking this link.

We select the user John and fill in the Usage location attribute so that we can assign him a license.

We select Brazil as John’s Usage location.

After the change to the profile, we click save.

With the Usage location attribute filled in, we run the previous steps again, and now we can see the license assigned to the user John.

Activating licenses for users using PowerShell

Let’s now activate a license for the user john@ulyssesnevs.com using PowerShell.

Open PowerShell with administrator privilege.

Let’s enable remote script execution using the command below:

Set-ExecutionPolicy RemoteSigned

Let’s install the AzureAD module for PowerShell using the command line below:

Install-Module AzureAD

To connect to Microsoft Entra ID, use the command below:

Connect-AzureAD

Sign in with the credentials of an account with Azure administrative privileges.

Let’s list the licenses available in the subscription to identify the available licenses.

Enter the command below to list the available licenses, filtering by license type and ID.

Get-AzureADSubscribedSku | select skuPartNumber, SkuId

Let’s store the EMS Premium license ID in a variable using the command below.

$skuid = 'ID da licença EMS'

Let’s create two variables to store the collection of user information.

$license = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicense
$licenses = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses

Let’s assign the EMS license captured in the $skuid variable to the properties of the $license variable using the command below:

$license.SkuId = $skuid

Add the captured license to the license collection defined in the $licenses variable by running the following command.

$licenses.AddLicenses = $license

To capture the user for whom we want to activate the license, use the command below. To capture the object ID, run the command Get-AzureADUser.

$user = Get-AzureADUser -ObjectId 'ID do objeto usuário'

As mentioned in the previous example, if the user does not have the Usagelocation attribute populated, it will not be possible to assign the license.

Run the command below to assign a US location to the user. For more information about the locations available in Azure, use this link.

Set-AzureADUser -ObjectId $user.ObjectId -UsageLocation 'US'

Let’s now assign the license to the user john@ulyssesneves.com using the command:

Set-AzureADUserLicense -ObjectId $user.ObjectId -AssignedLicenses $licenses

Update the license property of the user John with the following command.

$user = Get-AzureADUser -ObjectId 'ID do objeto usuário'

Run the command below to identify whether the license was assigned correctly:

$user.AssignedLicenses

Accessing the licensing portal, we can see the user John in the list of users licensed with EMS.

Summary

In today’s article, we showed how to activate a license for users in Azure using the portal and also PowerShell, enabling the use of MFA.

In the next article, we’ll continue with the topic “Configure Microsoft Azure Active Directory for workloads“, explaining how to enable MFA for users using a conditional access policy in Azure.

I hope this content has contributed to enriching your knowledge of Azure.

Did you like the post? Like and share it. 🙂

If you have any suggestions or comments, let us know.

[ ]’s

Related guides: Browse the Microsoft Identity Troubleshooting Index or the Microsoft Entra multifactor authentication topic archive.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Conditional Access report-only: why a successful sign-in can show a policy failure October 9, 2026
  • Microsoft Entra SMS and Voice Retirement: An Admin Preparation Checklist September 24, 2026
  • Microsoft Defender for Identity domain investigation: six questions to ask first September 10, 2026
  • Microsoft Entra Kerberos key rotation: what changes—and what administrators should check September 6, 2026
  • Microsoft Authenticator Will Block Jailbroken Devices in 2026 — What You Need to Know March 17, 2026

Archives

  • October 2026
  • September 2026
  • March 2026
  • September 2024
  • April 2024
  • February 2024
  • December 2023
  • September 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019

Tags

#aaddownleveldevice #adfs #adfscertificate #adfscertificates #adfsmfaadapter #azureauth #azureCA #azuredevice #capolicy #cloudsummit2021 #conditionalaccess #conditionalaccesspolicy #deviceregistration #farmbehavior #gopasswordless #mfaserver #msidentity #namedlocation #securingazure #securingazuread #sslprivatekey #troubleshootingadfs #troubleshootingwaptrust #tshootadfs #waptrust #webapplicationproxy #WHFBcerttrust #whfbdeployment #WHfBhybridsetup #WHfBprovisioning #widdatabase adconnect AD FS authenticationstrength az500 azurepim Azure security cloudsecurity microsoft365 Microsoft Azure Microsoft Entra hybrid join Microsoft Entra ID Microsoft Entra MFA PowerShell WHfB
©2026 Ulysses Neves | Design: Newspaperly WordPress Theme
Ulysses Neves
Gerenciar Consentimento de Cookies
Para fornecer as melhores experiências, usamos tecnologias como cookies para armazenar e/ou acessar informações do dispositivo. O consentimento para essas tecnologias nos permitirá processar dados como comportamento de navegação ou IDs exclusivos neste site. Não consentir ou retirar o consentimento pode afetar negativamente certos recursos e funções.
Funcional Always active
O armazenamento ou acesso técnico é estritamente necessário para a finalidade legítima de permitir a utilização de um serviço específico explicitamente solicitado pelo assinante ou utilizador, ou com a finalidade exclusiva de efetuar a transmissão de uma comunicação através de uma rede de comunicações eletrónicas.
Preferências
O armazenamento ou acesso técnico é necessário para o propósito legítimo de armazenar preferências que não são solicitadas pelo assinante ou usuário.
Estatísticas
O armazenamento ou acesso técnico que é usado exclusivamente para fins estatísticos. O armazenamento técnico ou acesso que é usado exclusivamente para fins estatísticos anônimos. Sem uma intimação, conformidade voluntária por parte de seu provedor de serviços de Internet ou registros adicionais de terceiros, as informações armazenadas ou recuperadas apenas para esse fim geralmente não podem ser usadas para identificá-lo.
Marketing
O armazenamento ou acesso técnico é necessário para criar perfis de usuário para enviar publicidade ou para rastrear o usuário em um site ou em vários sites para fins de marketing semelhantes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Ver preferências
  • {title}
  • {title}
  • {title}