Entra ID Dynamic Security Group based on account and license types

Cloud_Geek_82 831 Reputation points
2024-02-14T06:40:23.47+00:00

Hi All, I'm trying to create a dynamic security group with the following rules. Account type - Regular. Account license assigned - Microsoft 365 Business Premium. I have in the rule: userType - Equal - Regular and asisgnedPlans - Any - (assignedPlan.servicePlanId -eq "cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46" -and assignedPlan.capabilityStatus -eq "Enabled" As a result I'm getting a syntax error. Could you please help to correct the rule.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,279 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Achraf Ben Alaya 1,056 Reputation points MVP
    2024-02-14T07:48:36.8966667+00:00

    To correct the syntax error in your dynamic security group rule for Microsoft 365 Business Premium licenses, you need to ensure the correct syntax for filtering based on assigned plans. Here's the corrected rule:

    (user.userType -eq "Member" -and (user.assignedPlans -any (assignedPlan.servicePlanId -eq "cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46" -and assignedPlan.capabilityStatus -eq "Enabled")))
    

    user.userType -eq "Member" ensures that the user is a regular member (not a guest or admin).

    • user.assignedPlans -any (...) checks if any of the user's assigned plans match the specified conditions.
    • assignedPlan.servicePlanId -eq "cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46" filters for the specific service plan ID of Microsoft 365 Business Premium.
    • assignedPlan.capabilityStatus -eq "Enabled" ensures that the assigned plan is enabled.

    Make sure to replace "cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46" with the correct service plan ID for Microsoft 365 Business Premium if it's different.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.