Friday, 5 July 2013

Powershell command to get a list of Office 365 users with their assigned licenses

In order to get a list of all the users in your Office 365 tenant with the licenses that are assigned to them, you can run the following command. Change "c:\users.csv" to the location that you want to save the file.

Get-MsolUser -All | ft displayname , Licenses | Out-File c:\users.csv

This report will have both Display Name and License type in same column. If you need to split them into two columns, you can use the "Text to Columns" feature in Excel under the DATA tab to do this. I managed to split them by selecting Other under Delimiters and split where "{" is.



This is because licenses start with "{" and end with "}" (for example if the user's assigned license is E3, it would show as {mytenant:ENTERPRISEPACK}).

5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hi Amin! Great post!

    I was wondering if I can filter by PACK... Have you any idea?

    Regards!

    ReplyDelete
  3. This worked a treat. Loved the excel trick to split columns! Thanks dude

    ReplyDelete
  4. Fantastic bit of knowledge THANK YOU

    ReplyDelete
  5. Is it possible to get the device associated to an specific user/licence E3?

    ReplyDelete