A cloud-based identity and access management service for securing user authentication and resource access
Just add some additional ():
(user.assignedPlans -any (assignedPlan.servicePlanId -eq "094e7854-93fc-4d55-b2c0-3ab536xxxxx" -and assignedPlan.capabilityStatus -eq "Enabled")) -and (user.userPrincipalName -notin ["@contoso.com","@contoso.com"])