Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Use Set-AzADUser in PowerShell: Examples and Complete Guide for Windows Environment

In this article, we will explore the usage of the Set-AzADUser cmdlet in PowerShell, specifically in the Windows environment. Set-AzADUser is a powerful command that allows administrators to modify Azure Active Directory (AD) user properties and settings. By understanding its capabilities and learning how to use it effectively, administrators can streamline user management tasks and ensure accurate user information within their Azure environment.

Examples:

  1. Updating User Display Name: To update the display name of a user, use the following command:

    Set-AzADUser -DisplayName "John Doe" -UserPrincipalName john.doe@example.com

    This command will update the display name for the user with the specified UserPrincipalName.

  2. Modifying User License Assignment: To modify the license assignment for a user, use the following command:

    Set-AzADUser -ObjectId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -AssignedLicenses @{"AccountSkuId"="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"}

    Replace the ObjectId with the user's unique identifier and AccountSkuId with the desired license SKU.

  3. Enabling Multi-Factor Authentication (MFA): To enable MFA for a user, use the following command:

    Set-AzADUser -ObjectId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -StrongAuthenticationRequirements @{"RelyingParty"="https://sts.windows.net/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/","State"="Enabled","MethodType"="OneWaySMS"}

    Replace the ObjectId with the user's unique identifier. This command enables MFA using One-Way SMS as the authentication method.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.