$licenses = New-Object -TypeName .AssignedLicenses $Skus = $userList | Select -ExpandProperty AssignedLicenses | Select SkuID $userList = Get-AzureADUser -ObjectID $userUPN To remove all of the licenses for a specific user account, specify the user sign-in name, remove the "" characters, and run these commands. Set-AzureADUserLicense -ObjectId $userUPN -AssignedLicenses $license $License.RemoveLicenses = (Get-AzureADSubscribedSku | Where-Object -Property SkuPartNumber -Value $planName -EQ).SkuID $license = New-Object -TypeName .AssignedLicenses Next, get the sign-in name of the account for which you want remove a license, also known as the user principal name (UPN).įinally, specify the user sign-in and license plan names, remove the "" characters, and run these commands. Get-AzureADSubscribedSku | Select SkuPartNumber Next, list the license plans for your tenant with this command. Use the Azure Active Directory PowerShell for Graph moduleįirst, connect to your Microsoft 365 tenant. For a list of additional resources, see Manage users and groups. Learn how to remove licenses from user accounts with the Microsoft 365 admin center.
0 Comments
Leave a Reply. |