user management using the AzureAD powershell module


cls

$cred = Get-Credential

#Connect to your AzureAD tenant

Connect-AzureAD -Credential $cred

# Get a user by UPN

$user = Get-AzureADUser -ObjectId “user1@????.onmicrosoft.com”

$user | fl

# Update some properties
$user = Set-AzureADUser -ObjectId $user.UserPrincipalName -Department “Azure Architecture” -Country “Turkey”

# Get a user by UPN
$user = Get-AzureADUser -ObjectId “user1@????.onmicrosoft.com”

$user | fl


Comments (1)

  1. Ankit says:

    How to enable MFA through this approach?

Skip to main content