Office 365 licenses and services details per user report in CSV format

This script will create a comma separated file with a line per user and the following columns: Display Name, Domain, UPN, Is Licensed?, all the SKUs in tenant, all the services, Errors, ImmutableId and BlockCredential.

4 Star
2,880 times
Add to favorites
Office 365
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Simple and detailed license report
    1 Posts | Last post April 19, 2019
    • This is a great script. I thought to modify Output data to give both basic and detailed license info in 2 different files. Below script will provide 2 Output file - one with Simple details and another with comprehensive information of user's assigned license.
      I hope this helps!
  • Wow, thank you very much!
    1 Posts | Last post December 21, 2017
    • This script does exactly what I need. I spent all day trying to find something; I really appreciate you taking the time to create and share it. 
  • Object based version
    1 Posts | Last post September 28, 2017
    • Hi!
      I thought I'd take you up on your offer "If you find a way to improve this code, please share it."  
      I noticed that the script does a lot of string concatenation.  You can get away from this (and simplify the code) by creating a custom object with all the properties (licenses) that you want and then use Export-CSV to append it to your CSV.  
      I've posted a sample over on my blog:
      I hope this helps!
  • Error?
    2 Posts | Last post March 01, 2016
    • Hi, 
      Thank you for this script, I find it very helpful, but I think I found a mistake in the code provided for download.
      On line 131:
      if ($row.AccountSkuId.ToString() -eq $licensetype.AccountSkuId[$j])
      should probable contain:
      if ($row.AccountSkuId.ToString() -eq $licensetype.AccountSkuId)
      Otherwise conditional is never true (AccountSkuId[$j] has one letter of a license string) and table stays empty.
    • I have not had a problem running the script.
      Are you running Powershell as Administrator?