You have already seen in my earlier blog post on how to use Azure AD group based licensing to do license assignments of different office 365 products.
After implementation completion, we landed up in a situation where Visio/Project team wanted to know the user ids that have been provided direct license and are not getting license from group.
As group based licensing is being used so Assignment Paths in Azure AD portal will show as inherited or Direct.
Unfortunately you can not extract the list from the GUI portal, there is no option present as of now to export in excel, csv or other formats.
Only option we have is to get it from powershell, there as well there is no direct property so a small script will be required, before doing that install MSOL module.
follow: https://techwizard.cloud/2015/04/30/connecting-office-365-via-powershell/
Get the group objectID that you have used in assignment.(from azure AD search for the group)
Lets now use the bellow script as an example to extract the required info.
Use Get-MsolAccountSku to get different SKUID Name (below is example for Visio)
##################################################
$collection = @()
$collect =Get-MsolUser -all | where{($_.islicensed -eq $true) -and ($_.licenses.Accountskuid -like “*Visioclient*”)} # change accordingly
$collect | Foreach-object{
$mcoll = “” | Select userPrincipalName, GroupID
$mcoll.userPrincipalName = $_.userprincipalname
$_.licenses | foreach-object {
if($_.AccountSkuId -like “*visio*”){
$mcoll.GroupID = $_.GroupsAssigningLicense.Guid }
}
$mcoll
$collection+=$mcoll
}
$collection | export-csv c:\visiolicense.csv -notypeinfo
#################################################
After running this script you will get a report as below in csv format and you can filter the Direct vs non Direct assignments as you already know the group objectid you used for license implementation.(group objectid extracted above)
You can also use this small script to get details if you have used different groups for assignments.
Tech Wizard
Thanks for the script. My CSV Output has multiple “System.Object[]” for the GroupID. Any ideas? I tried the join but maybe at the wrong place.
You need to use expression example:
@{n=“Groupguid”;e={$_.GroupsAssigningLicense.Guid }}
Which line should this be added to?
Just use this during export(last line) , I tested it.
$collection | select userprincipalname, @{n=”Groupid”;e={$_.Groupid }} | export-csv c:\visiolicense.csv -notypeinfo
instead of $collection | export-csv c:\visiolicense.csv -notypeinfo
Thank you!
I can’t seem to get this function currently. I am curious if this works if the Security group is imported into Azure from a Hybrid or if the group needs to be created in Azure directly.
written long ago but yes was tested with hybrid setup