Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$licenses = Get-AzureADUser -ObjectId "user@mytenant.com.au" | select AssignedLicenses
$licenses.AssignedLicenses.skuID | foreach {
$body = @{
addLicenses = @()
removeLicenses= @($_)
}
Set-AzureADUserLicense -ObjectId "user@mytenant.com.au" -AssignedLicenses $body }
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.