No one has responded to this discussion for at least a year, so this information may be out of date. If you're looking for information about this topic, please search for a more recent discussion or post a new question.

Check assigned license

  • 3 Followers
  • 3 Replies |
  • This post has 1 verified answer |
Answered (Verified) This question is answered

Hello

 

Is there a quick way to check the assigned license per user with powershell.

I have a list of people and I need to know which users are using what license.

 

Thanks you in advance

 

 

Dresse

  • Post Points: 20
Verified Answer
  • I wouldn't call it a quick way but you can use the following script to get a list of users and sku's:

    #######begin script#######

    cls

    Import-Module msonline

    Connect-MsolService

    Function Get-UserLicenseList {

    $MasterList = @()

    Get-MsolUser -All  | % {

    $Object = New-Object PSObject -Property @{            

           DisplayName = $null        

           UserPrincipalName = $null

    AssignedLicense = $null}

    $Object.DisplayName = (Get-MsolUser -UserPrincipalName $_.UserPrincipalName).DisplayName

    $Object.UserPrincipalName = (Get-MsolUser -UserPrincipalName $_.UserPrincipalName).UserPrincipalName

    $Object.AssignedLicense = ((Get-MsolUser -UserPrincipalName $_.UserPrincipalName).licenses | select accountskuid).accountskuid

    $MasterList += $Object}

    $MasterList

    }

    #######end script#######

    Jorge R. Diaz

    Microsoft MVP | Office 365

    MCITP: Office 365 Administrator

    Check out my Blog

    Follow Me

    • Top 100 Contributor
    • Post Points: 0
All Replies
  • Hi Dresse,

    To check the license status for the users, we can use the PowerShell command Get-MsolUser.
     
    To do so, you can refer the following steps:
     
    1. Start Microsoft Online Services Module for PowerShell. You can click start, then type online in Search programs and files window. Then click Microsoft Online Services Module for PowerShell.
      
     
    2. Run the following commands:
     
    $cred=Get-Credential
     
    connect-MSOLService -credential $cred

    3. After connecting to your Office 365 service, run the following command:
    Get-MsolAccountSku
     
    Then you may check this user via Microsoft Online Portal about the license to verify the result.
     
    If any error message appears, please capture a screenshot and post it in the forum for further research.

    Thanks,
    Monica Tong

    • Top 10 Contributor
    • Post Points: 0
    Suggested by
  • I wouldn't call it a quick way but you can use the following script to get a list of users and sku's:

    #######begin script#######

    cls

    Import-Module msonline

    Connect-MsolService

    Function Get-UserLicenseList {

    $MasterList = @()

    Get-MsolUser -All  | % {

    $Object = New-Object PSObject -Property @{            

           DisplayName = $null        

           UserPrincipalName = $null

    AssignedLicense = $null}

    $Object.DisplayName = (Get-MsolUser -UserPrincipalName $_.UserPrincipalName).DisplayName

    $Object.UserPrincipalName = (Get-MsolUser -UserPrincipalName $_.UserPrincipalName).UserPrincipalName

    $Object.AssignedLicense = ((Get-MsolUser -UserPrincipalName $_.UserPrincipalName).licenses | select accountskuid).accountskuid

    $MasterList += $Object}

    $MasterList

    }

    #######end script#######

    Jorge R. Diaz

    Microsoft MVP | Office 365

    MCITP: Office 365 Administrator

    Check out my Blog

    Follow Me

    • Top 100 Contributor
    • Post Points: 0
  • Thank you, that gave me the necessary output !

    • Not Ranked
    • Post Points: 0
Page 1 of 1 (4 items)