Forum Discussion
mfranhind115
Jul 12, 2022Brass Contributor
powershell and Microsoft.Online: how to filter users with multiple conditions
Hi all,
I'm connected to my Tenant and several domains under it
I would need to extract only user having
license O365_BUSINESS_ESSENTIALS or O365_BUSINESS_PREMIUM
and
not having ATP_ENTERPRISE
I started with a command like this:
Get-MsolUser | Where-Object {($_.licenses).AccountSkuId -match "O365_BUSINESS_PREMIUM"}
but I'm struggling to combine multiple conditions...
thanks for your help
2 Replies
Sort By