Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Goodbye Set-MsolUser, Hello Set-AzureADUser & Azure Graph API. Associated blog post is located here
# Import the Module to your PowerShell Session
Import-Module AzureADPreview
#Connect to your AzureAD tenant
# Get a user by UPN
$user = Get-AzureADUser -ObjectId ""
# Update the user
$user = Set-AzureADUser -ObjectId $user.UserPrincipalName -Department "Diagnostics" -Country "AU"
$user = Get-AzureADUser -ObjectId ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.