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)
2,645 times
Add to favorites
Office 365
1/31/2016
E-mail Twitter del.icio.us 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.
      
      https://gallery.technet.microsoft.com/Export-Office-365-User-079add3a
      
      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: https://sysjam.wordpress.com/2017/09/28/exporting-office-365-licenses-to-csv/
      
      I hope this helps!
      
      Matthew
  • 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?