SOLVED
Home

License Utilization Script

Occasional Contributor

I'm having a time getting the licenses assigned to a user to export via export-csv the way I'd expect...  The following code outputs "Microsoft.Online.Administration.UserLicense;Microsoft.Online.Administration.UserLicense" for licenses, still not what I'm hoping for when flattening out the multivalued attribute the way I've done in other scripts...

 

$LicensedUserList = get-msoluser -All | where {$_.IsLicensed -eq "True"}
$LicensedUserList | select DisplayName,SignInName,Title,UsageLocation,@{Name='Licenses';Expression={[string]::join(";",($_.Licenses))}}| Export-CSV $ExportFile -NoTypeInformation

 

 

PS: I'm also not sure what the "Right Group" for this question is on the new forums.  I can't find a "PowerShell" or general "Administration" area, just an area dedicated to the Admin portal.

2 Replies
Highlighted
Solution
Try it with $_.Licenses.AccountSkuId
Highlighted

As usual, you have the answers right at your fingertips, @Vasil Michev...  And I need to do better at examing the child object lists... :)

Related Conversations
No Outlook in Office 365 License?
Thomasr3990 in Office 365 on
3 Replies
MDM License requirements.
cbraafhart in Deployment on
2 Replies
Intune Scripting
jesusleon in Microsoft Intune on
2 Replies
Exchange Plans
Tim Hunter in Office 365 on
2 Replies