I’m working on creating reports for assigned Microsoft licenses in our AAD. Basically what we need is to grab DisplayName, UserPrincipalName, Company and whatever licenses are assigned to the user.
A problem is that we use the Company property in our AD/AAD for billing purposes, but that property seems to not be exposed via the Get-MsolUser cmdlet. The Get-AzureADUser cmdlet seems to expose this property, but Get-AzureADUser does not support the same switches for license management as Get-MsolUser.
Is there a reasonable way to get licensing information with the use of the AzureAD (preview) module, or do I have to go via the MsOlService module, and if so can I combine the two modules in a clever way to get the properties I need.
Pseudo-code, but it’s data from two places with multiple unique identifiers (samAccountName, email, DN), so you would just get user information from both sources:
I want to thank you both for your input, it helped me get to the right place.
In the end I was asked to get even more info which was not exposed by either MSOnlineService or AzureAD, so I changed the script to grab that info directly from the local AD instead.