Data type for "ObjectId" from Get-AzureADUserLicenseDetail

Steel Contributor

Can anyone let me know if there is a conversion available for the ObjectId property that comes out of Get-AzureADUserLicenseDetail?

Example: 

 

Hv-1hQIEDECePA-ellMl0cjsRfKvdY5Pth8n2BFN5fM

 

It's always 43 characters and I'm pretty certain the first 21 characters are always the same (as if it's something like <tenant>:<SkuId> under the covers).

See: Get-AzureADUserLicenseDetail > Examples > Example 1

 

Why I care is that I'm working on using PowerShell for AAD license reporting.  I've been comparing MSOnline to AzureAD/AzureADPreview, and have found these things that are better in MSOnline:

 

  • MsolGroup's have the Licsenses property
  • MsolUsers's have several properties to show the assignment paths:
    • $_.LicenseAssignmentDetails (and its subproperties)
    • $_.Licenses.GroupsAssignLicense

I'm trying to find ways to retrieve the same info using only the AzureAD module, and during that I've noticed that the ObjectId that comes out of Get-AzureADUserLicenseDetail is not a proper Guid.

 

I am overdue in learning C# and MS Graph because it seems like the PowerShell module is getting less than its fair share of TLC.  BUT, until then, would love to be able to at least use just AzureAD module since we know MSOnline is not getting any updates (reference: GitHub issue revealing this fact)

 

Everywhere else that I see AAD developers have included an 'ObjectId' property, it has been in Guid format.  I was hoping to check these ObjectId's with Get-AzureADObjectByObjectId, but it won't take this non-Guid format (I've also noticed that all kinds of ObjectIds that I pull out of sub-properties from AzureADUser's/AzureADGroup's produce no output when checked with Get-AzureADObjectByObjectId, but that's unrelated, just an observation).

4 Replies

That's simply some sort of internal id, you don't really need it for anything. The important part is the SKUId, which you can correlate to what the MSOL cmdlets are showing, and of course the individual services/plans.

@Vasil Michev Thanks for the response.  I do get / am after the SkuId/SkuPartNumber's and have a hashtable to show the product friendly names, etc.  But what I can't get so far with AzureAD module is the assignment path.  If you look in the Azure AD Portal under Licenses > All products >
Office 365 E3 (as an example) > Licensed users, the Assignment Paths column is the info I'm after.

 

With MSOnline, it's possible, and I'm consuming it successfully now.  Direct-assigned and group-assigned licenses are identified separately in the MsolUser objects' properties.  But so far I haven't found the same info available in AzureADuser nor AzureADUserLicenseDetail objects.

 

So I've just been inspecting the AzureAD objects and all their available properties.  When I came across the unfamiliar ObjectId format but could see it is consistent, I was thinking maybe it could translate to say a combo of the SkuId, and the group's, and user's ObjectId's, converted to a specific format similar to how ImmutableId is a base64 string derived from or calculated from ObjectGuid.

 

Looping back to the MSOnline module, I am currently able to get everything I need from it, to confirm.  I like to use AzureAD module for other tasks, over MSOnline however, so am just kind of checking around to see if I can pull the same info using only the newer module.  No real urgency of any kind as long as MSOnline stays living and available in its current form.

It might be that Microsoft is still waiting to or just not planning to include/expose this detail (assignment path) to AzureAD module or Microsoft Graph. I've noticed the licenseDetail object from MS Graph also has the limited set of properties:
https://docs.microsoft.com/en-us/graph/api/resources/licensedetails?view=graph-rest-1.0

So I might just be premature in trying to switch away from MSOnline. I will revisit in a few months. I'd have asked via a GitHub issue, but the AzureAD module's documentation on docs is not open for issue raising/contribution like most of the rest of the stuff on docs. Maybe this is to mute all the confused customers' concerns... Just kidding but anyway.

Well I cannot speak on behalf of Microsoft here, but they do have some plans on retiring the MSOnline module/bringing all missing functionality to the AAD one. When this will happen I'm not sure, it's long overdue if you ask me.