Forum Discussion
Ted McLaughlin
Sep 10, 2018Copper Contributor
Finding a list of users who don't have an exchange license
I am the O365 admin for my company, and my boss recently asked me to give him a list of all regular users in our AD trees who weren't licensed online for Exchange. This has turned out to be more com...
Andy David
Sep 19, 2018MVP
One example:
Using on-prem Exch PS:
$list = Get-Mailbox -resultsize unlimited | ?{$_.OrganizationalUnit -notmatch 'Contractors'}
$list.userprincipalname > list.txt
Then using Ex Online PS:
$list = gc .\list.txt
foreach ($id in $list) {get-msoluser -UserPrincipalName $id | ?{$_.IsLicensed -eq $false }}
That will give you a list of users not licensed.
Manipulate or change search as you see fit.