Skip to content

Instantly share code, notes, and snippets.

@astaykov
Created August 31, 2022 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astaykov/68b79b081f102e41045fadbaeae26fdf to your computer and use it in GitHub Desktop.
Save astaykov/68b79b081f102e41045fadbaeae26fdf to your computer and use it in GitHub Desktop.
Update all users in Azure AD
# This script is used to clean users' tenants association for a demo environment
$extProps = New-Object System.Collections.Generic.Dictionary"[String,String]"
$extProps.Add("extension_f7032a421ae74f8b8919f15dad3b290b_TenantsAll","")
Get-AzureADUser -all $true | ForEach-Object { Set-AzureADUser -ObjectId $_.ObjectId -ExtensionProperty $extProps }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment