Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Goodbye Set-MsolUser, Hello Set-AzureADUser & Azure Graph API. Associated blog post is located here https://blog.darrenjrobinson.com/goodbye-set-msoluser-hello-set-azureaduser-azure-graph-api/
# Import the Module to your PowerShell Session
Import-Module AzureADPreview
#Connect to your AzureAD tenant
Connect-AzureAD
# Get a user by UPN
$user = Get-AzureADUser -ObjectId "skollegger@live.darrenjrobinson.info"
$user
# Update the user
$user = Set-AzureADUser -ObjectId $user.UserPrincipalName -Department "Diagnostics" -Country "AU"
$user = Get-AzureADUser -ObjectId "skollegger@live.darrenjrobinson.info"
$user
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.