Aug 20 2020 05:05 AM - edited Aug 20 2020 05:35 AM
Hi All,
We are trying to script a way to show users in Exchange Online who do not have an ATP license attached to them.
I found this script:
Get-MsolUser -All | Where-Object {$_.licenses -ne 'ATP_ENTERPRISE'} | Select-Object userprincipalname,licenses
However, I am trying to find a script that displays only users that do not have an ATP license so that we can quickly find them. The above script displays all users and their licenses (including those that do not have an ATP license)
Thx
Aug 20 2020 04:46 PM
Hey @ColtA ,
Try this as per your screenshot:
Get-MsolUser -All | Where-Object {$_.licenses.AccountSkuId -ne 'reseller-account:ATP_ENTERPRISE'} | Select-Object userprincipalname,licenses
Thanks