Skip to content

Instantly share code, notes, and snippets.

$all = Get-MsolUser -All
foreach ($user in $all.Where({$_.IsLicensed})) {
$serviceStatuses = @($user.Licenses.ServiceStatus)
$teamsPlans = $serviceStatuses.Where({$_.ServicePlan.ServiceName -clike "*TEAMS*"})
if ($true -in $teamsPlans.ForEach({$_.ProvisioningStatus -like "Success*"})) {
$user
}
}