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