Link to home
Start Free TrialLog in
Avatar of nav2567
nav2567Flag for United States of America

asked on

Powershell script to return the Office 365 license location.

Is it possible to have a PS command to read a CSV file (contains list of UPNs) and returns the product licenses LOCATION of each account?
Avatar of Emmanuel Adebayo
Emmanuel Adebayo
Flag of United Kingdom of Great Britain and Northern Ireland image

To run this report you need to open the Windows Azure Active Directory Module for Windows Powershell, and connect to Office 365. Once connected run the following cmdlet:

Get-MSOLUser -All | select userprincipalname,islicensed,{$_.Licenses.AccountSkuId}| Export-CSV c:\userlist.csv -NoTypeInformation

For more info

Office 365: Script to get detailed report of assigned licenses
Avatar of nav2567

ASKER

I think I tried something similar but mine only returns the license type but no license location (France/US/....).

Let me try yours.  Thx
Not sure what you mean by license location. Perhaps the UsageLocation attribute?
ASKER CERTIFIED SOLUTION
Avatar of Jude Perera
Jude Perera
Flag of Sri Lanka image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial