Transitioning from Direct license to Groups-Based License Management - Microsoft Entra

Hello All

Today we are going to cover the topics about to convert the Direct license assignments  to Groups-Based License Management in Microsoft Entra



Scenario

Business recently discovered that there are 2k  users  who have the Microsoft Power Automation  license  assigned directly  but NOT via Group Based License[GBL]  groups.

There is specific  groups in Microsoft Entra  to assign the Microsoft power automation license from GBL

However there are around 2K users are assigned directly 


Now the business wants them to assign the licensees through group based License 

So the proposed solution given below without impacting much to the services 


  1. Add the users in to the respective groups, based on the criteria 
  2. Once the user are added  to the groups , and the license will be showing as “Direct Inherited”

3. Direct License  assignment must be removed from PowerShell by connecting Azure AD or from Microsoft entraID portal



After successfully removed the direct license , its started showing as “Inherited” from Group Based Licenses




From Powershell

As single user, we can do it via Microsoft entra ID portal, however for 2k users to remove the direct licences and it is challenge to get this job done for multiple  users, hence am giving the powershell for single user and multiple users below


For single user

 

$userUPN=PradeepG@2t6xvv.onmicrosoft.com

$planName="FLOW_FREE"

$license = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses

$license.RemoveLicenses = (Get-AzureADSubscribedSku | Where-Object -Property SkuPartNumber -Value $planName -EQ).SkuID

Set-AzureADUserLicense -ObjectId $userUPN -AssignedLicenses $license

 

For multiple users

$UserList = import-csv "C:\Temp\userlist.csv"

Foreach ($User in $UserList) {

$planName="FLOW_FREE"

$license = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses

$license.RemoveLicenses = (Get-AzureADSubscribedSku | Where-Object -Property SkuPartNumber -Value $planName -EQ).SkuID

Set-AzureADUserLicense -ObjectId $user.Name -AssignedLicenses $license

}

I hope this blog is useful for converting the licences assignments in Microsoft entra, and Happy learning 😃 

Comments