Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Office365 User report based on Get-MsolUser and AccountSkuId

$
0
0

I asked this question in the Office365-forum but was asked to post it here instead so I hope someone can help me.

We have a mixed O365-enviroment with federated accounts that have the E3-licens and unfederated accounts that have the E1-licens.
I have with this code got the AccountSkuId I want to filter on:

Get-MsolAccountSku | Format-Table AccountSkuId, SkuPartNumber
with the result:

AccountSkuId            SkuPartNumber
------------            -------------
company:STANDARDPACK    STANDARDPACK
company:ENTERPRISEPACK  ENTERPRISEPACK

I am now trying to create a report that lists only the E1-accounts with this code:

$colUsers = Get-MsolUser -MaxResults 10 | Where-Object {$_.accountskuid -eq "company:STANDARDPACK" -and $_.IsLicensed -eq $True}

But this just gives me zero accounts :(
What am I doing wrong?
Is there another way to filter on the E1-licens?

In my PS report I export these properties:
UPN
Primary SMTP
Secondary SMTP's
Displayname
First Name
LastName
Assigned Licenses
WhenCreated UTC
Title

This report is used as a base for internal billing of our departements.

/Anders


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>