Data type for "ObjectId" from Get-AzureADUserLicenseDetail

%3CLINGO-SUB%20id%3D%22lingo-sub-1076687%22%20slang%3D%22en-US%22%3EData%20type%20for%20%22ObjectId%22%20from%20Get-AzureADUserLicenseDetail%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1076687%22%20slang%3D%22en-US%22%3E%3CP%3ECan%20anyone%20let%20me%20know%20if%20there%20is%20a%20conversion%20available%20for%20the%20ObjectId%20property%20that%20comes%20out%20of%20Get-AzureADUserLicenseDetail%3F%3C%2FP%3E%3CP%3E%3CEM%3EExample%3A%26nbsp%3B%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3EHv-1hQIEDECePA-ellMl0cjsRfKvdY5Pth8n2BFN5fM%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20always%2043%20characters%20and%20I'm%20pretty%20certain%20the%20first%2021%20characters%20are%20always%20the%20same%20(as%20if%20it's%20something%20like%20%3CTENANT%3E%3A%3CSKUID%3E%20under%20the%20covers).%3C%2FSKUID%3E%3C%2FTENANT%3E%3C%2FP%3E%3CP%3ESee%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fazuread%2Fget-azureaduserlicensedetail%3Fview%3Dazureadps-2.0-preview%23examples%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGet-AzureADUserLicenseDetail%20%26gt%3B%20Examples%20%26gt%3B%20Example%201%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhy%20I%20care%20is%20that%26nbsp%3BI'm%20working%20on%20using%20PowerShell%20for%20AAD%20license%20reporting.%26nbsp%3B%20I've%20been%20comparing%20MSOnline%20to%20AzureAD%2FAzureADPreview%2C%20and%20have%20found%20these%20things%20that%20are%20better%20in%20MSOnline%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EMsolGroup's%20have%20the%20Licsenses%20property%3C%2FLI%3E%3CLI%3EMsolUsers's%20have%20several%20properties%20to%20show%20the%20assignment%20paths%3A%3CUL%3E%3CLI%3E%24_.LicenseAssignmentDetails%20(and%20its%20subproperties)%3C%2FLI%3E%3CLI%3E%24_.Licenses.GroupsAssignLicense%3C%2FLI%3E%3C%2FUL%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EI'm%20trying%20to%20find%20ways%20to%20retrieve%20the%20same%20info%20using%20only%20the%20AzureAD%20module%2C%20and%20during%20that%20I've%20noticed%20that%20the%20ObjectId%20that%20comes%20out%20of%20Get-AzureADUserLicenseDetail%20is%20not%20a%20proper%20Guid.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20overdue%20in%20learning%20C%23%20and%20MS%20Graph%20because%20it%20seems%20like%20the%20PowerShell%20module%20is%20getting%20less%20than%20its%20fair%20share%20of%20TLC.%26nbsp%3B%20BUT%2C%20until%20then%2C%20would%20love%20to%20be%20able%20to%20at%20least%20use%20just%20AzureAD%20module%20since%20we%20know%20MSOnline%20is%20not%20getting%20any%20updates%20(reference%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-docs-powershell-azuread%2Fissues%2F246%23issuecomment-546076703%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGitHub%20issue%20revealing%20this%20fact%3C%2FA%3E)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEverywhere%20else%20that%20I%20see%20AAD%20developers%20have%20included%20an%20'ObjectId'%20property%2C%20it%20has%20been%20in%20Guid%20format.%26nbsp%3B%20I%20was%20hoping%20to%20check%20these%20ObjectId's%20with%20Get-AzureADObjectByObjectId%2C%20but%20it%20won't%20take%20this%20non-Guid%20format%20(I've%20also%20noticed%20that%20all%20kinds%20of%20ObjectIds%20that%20I%20pull%20out%20of%20sub-properties%20from%20AzureADUser's%2FAzureADGroup's%20produce%20no%20output%20when%20checked%20with%20Get-AzureADObjectByObjectId%2C%20but%20that's%20unrelated%2C%20just%20an%20observation).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1076687%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20AD%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIdentity%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1077476%22%20slang%3D%22en-US%22%3ERe%3A%20Data%20type%20for%20%22ObjectId%22%20from%20Get-AzureADUserLicenseDetail%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1077476%22%20slang%3D%22en-US%22%3E%3CP%3EThat's%20simply%20some%20sort%20of%20internal%20id%2C%20you%20don't%20really%20need%20it%20for%20anything.%20The%20important%20part%20is%20the%20SKUId%2C%20which%20you%20can%20correlate%20to%20what%20the%20MSOL%20cmdlets%20are%20showing%2C%20and%20of%20course%20the%20individual%20services%2Fplans.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1077609%22%20slang%3D%22en-US%22%3ERe%3A%20Data%20type%20for%20%22ObjectId%22%20from%20Get-AzureADUserLicenseDetail%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1077609%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3BThanks%20for%20the%20response.%26nbsp%3B%20I%20do%20get%20%2F%20am%20after%20the%20SkuId%2FSkuPartNumber's%20and%20have%20a%20hashtable%20to%20show%20the%20product%20friendly%20names%2C%20etc.%26nbsp%3B%20But%20what%20I%20can't%20get%20so%20far%20with%20AzureAD%20module%20is%20the%26nbsp%3Bassignment%26nbsp%3B%3CEM%3Epath.%26nbsp%3B%3C%2FEM%3E%26nbsp%3BIf%20you%20look%20in%20the%20Azure%20AD%20Portal%20under%26nbsp%3BLicenses%20%26gt%3B%20All%20products%20%26gt%3B%3CBR%20%2F%3EOffice%20365%20E3%20(as%20an%20example)%20%26gt%3B%20Licensed%20users%2C%20the%20Assignment%20Paths%20column%20is%20the%20info%20I'm%20after.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20MSOnline%2C%20it's%20possible%2C%20and%20I'm%20consuming%20it%20successfully%20now.%26nbsp%3B%20Direct-assigned%20and%20group-assigned%20licenses%20are%20identified%20separately%20in%20the%20MsolUser%20objects'%20properties.%26nbsp%3B%20But%20so%20far%20I%20haven't%20found%20the%20same%20info%20available%20in%20AzureADuser%20nor%20AzureADUserLicenseDetail%20objects.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I've%20just%20been%20inspecting%20the%20AzureAD%20objects%20and%20all%20their%20available%20properties.%26nbsp%3B%20When%20I%20came%20across%20the%20unfamiliar%20ObjectId%20format%20but%20could%20see%20it%20is%20consistent%2C%20I%20was%20thinking%20maybe%20it%20could%20translate%20to%20say%20a%20combo%20of%20the%20SkuId%2C%20and%20the%20group's%2C%20and%20user's%20ObjectId's%2C%20converted%20to%20a%20specific%20format%20similar%20to%20how%20ImmutableId%20is%20a%20base64%20string%20derived%20from%20or%20calculated%20from%20ObjectGuid.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELooping%20back%20to%20the%20MSOnline%20module%2C%20I%20am%20currently%20able%20to%20get%20everything%20I%20need%20from%20it%2C%20to%20confirm.%26nbsp%3B%20I%20like%20to%20use%20AzureAD%20module%20for%20other%20tasks%2C%20over%20MSOnline%20however%2C%20so%20am%20just%20kind%20of%20checking%20around%20to%20see%20if%20I%20can%20pull%20the%20same%20info%20using%20only%20the%20newer%20module.%26nbsp%3B%20No%20real%20urgency%20of%20any%20kind%20as%20long%20as%20MSOnline%20stays%20living%20and%20available%20in%20its%20current%20form.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1077805%22%20slang%3D%22en-US%22%3ERe%3A%20Data%20type%20for%20%22ObjectId%22%20from%20Get-AzureADUserLicenseDetail%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1077805%22%20slang%3D%22en-US%22%3EIt%20might%20be%20that%20Microsoft%20is%20still%20waiting%20to%20or%20just%20not%20planning%20to%20include%2Fexpose%20this%20detail%20(assignment%20path)%20to%20AzureAD%20module%20or%20Microsoft%20Graph.%20I've%20noticed%20the%20licenseDetail%20object%20from%20MS%20Graph%20also%20has%20the%20limited%20set%20of%20properties%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Flicensedetails%3Fview%3Dgraph-rest-1.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fgraph%2Fapi%2Fresources%2Flicensedetails%3Fview%3Dgraph-rest-1.0%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20I%20might%20just%20be%20premature%20in%20trying%20to%20switch%20away%20from%20MSOnline.%20I%20will%20revisit%20in%20a%20few%20months.%20I'd%20have%20asked%20via%20a%20GitHub%20issue%2C%20but%20the%20AzureAD%20module's%20documentation%20on%20docs%20is%20not%20open%20for%20issue%20raising%2Fcontribution%20like%20most%20of%20the%20rest%20of%20the%20stuff%20on%20docs.%20Maybe%20this%20is%20to%20mute%20all%20the%20confused%20customers'%20concerns...%20Just%20kidding%20but%20anyway.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1077873%22%20slang%3D%22en-US%22%3ERe%3A%20Data%20type%20for%20%22ObjectId%22%20from%20Get-AzureADUserLicenseDetail%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1077873%22%20slang%3D%22en-US%22%3E%3CP%3EWell%20I%20cannot%20speak%20on%20behalf%20of%20Microsoft%20here%2C%20but%20they%20do%20have%20some%20plans%20on%20retiring%20the%20MSOnline%20module%2Fbringing%20all%20missing%20functionality%20to%20the%20AAD%20one.%20When%20this%20will%20happen%20I'm%20not%20sure%2C%20it's%20long%20overdue%20if%20you%20ask%20me.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
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.

Highlighted

@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.

Highlighted
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.
Highlighted

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.