Skip to content

Instantly share code, notes, and snippets.

@ivanbuzyka
Created December 12, 2022 15:06
Show Gist options
  • Save ivanbuzyka/a3de800dd357eca8078eab64f6794190 to your computer and use it in GitHub Desktop.
Save ivanbuzyka/a3de800dd357eca8078eab64f6794190 to your computer and use it in GitHub Desktop.
Login to the Azure AD Tenant with no Azure Subscription. Create a lot of Azure AD Groups and add a user as member to them. This can be used to test Azure AD authentication for scenarios when a lot of Groups are send by Claims
$userId = "<ObjectID of AAD User>"
$countOfGroupsToCreate = 300
$groupNamePrefix = "testgroup"
for ($i = 0; $i -lt $countOfGroupsToCreate; $i++)
{
$newGroup = (az ad group create --display-name "$groupNamePrefix-group$i" --mail-nickname "$groupNamePrefix-group$i" -o json) | ConvertFrom-Json
az ad group member add --group $newGroup.Id --member-id $userId
}
az login --tenant testtenant.onmicrosoft.com --allow-no-subscriptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment