Forum Discussion
Group Based Licensing in 365
So I have recently been setting up GBL on my tenant, I am trying to run a script so I can check all licenses applied to a SKU, I need to see the UPN, Sku (Product Name), If the license is directly assigned or if it's assigned by a group, if by a group, what group (name)?
I found this script online yesterday, it worked ok last yesterday, but today, the direct or group assigned is blank, no changes have been made.
- farismalaebSteel Contributor
I advise you to recopy the code from the source. You missed adding the function, but I search it and get it.
PowerShell and Graph examples for group-based licensing in Azure AD
The code works fine for me.
Try to call the function alone and pass the user ID and the SKU and see the return will work or not.
UserHasLicenseAssignedDirectly -user "Email address removed" -skuId 'Orgname:SPE_E5'
Also it can be due to an incorrect modification in the select statement, which cause the result to be blank
- rah1mCopper ContributorI had the same issue coping the code adds addtional symbols ' - remove them then scipt works fine