Forum Discussion
Get mailbox users without ATP License
As I said, we're not mind readers here. My example assumes that you have ATP as part of E5, if you have the standalone license just query for the presence of the relevant SKU. If you don't know the SKUID, you can get it via Get-MsolAccountSku.
Hi Vasil,
It will only return me users that has ATP license. Hope you could help me the other way arround. Users without ATP.
Best Regards,
Mark
- VasilMichevAug 30, 2018MVP
Simply use the "not" operator to get the "opposite" result set?
- Mark Louie DiazAug 31, 2018Copper Contributor
Hi Vasil,
Tried this attached but it returns users with ATP_ENTERPRISE
- VasilMichevAug 31, 2018MVP
You need to be looking at the AccountSkuId property:
Get-MsolUser -All | ? {$_.Licenses.AccountSkuId -ne "tenant:ATP_ENTERPRISE"}
as this will return unlicensed users as well, you might prefer the below:
Get-MsolUser -All | ? {$_.Licenses.AccountSkuId -ne "tenant:ATP_ENTERPRISE" -and $_.IsLicensed}