Creating license reports with Powershell and AAD

Welcome Forums General PowerShell Q&A Creating license reports with Powershell and AAD

  • This topic has 4 replies, 3 voices, and was last updated 1 month ago by
    Participant
    .
Viewing 3 reply threads
  • Author
    Posts
    • #250577
      Participant
      Topics: 12
      Replies: 38
      Points: 282
      Helping Hand
      Rank: Contributor

      Hi,

      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.

      I found this script: Export Office 365 User License Report With PowerShell that I’ve modified a bit to get proper encoding, delimiters and other more cosmetic changes.

      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.

    • #250613
      Participant
      Topics: 15
      Replies: 1776
      Points: 3,218
      Helping Hand
      Rank: Community Hero

      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:

      • This reply was modified 1 month, 1 week ago by Rob Simmers.
    • #250862
      Participant
      Topics: 0
      Replies: 81
      Points: 362
      Helping Hand
      Rank: Contributor

      I looked at the technet gallery script that you are using. You can replace the following code snippets:

       

    • #252107
      Participant
      Topics: 12
      Replies: 38
      Points: 282
      Helping Hand
      Rank: Contributor

      Sorry for the late reply.

      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.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.