What are the attributes to add the active users in the tenant to add them in Dynamic user security group as I tried with below query but its not working as I am trying to exclude the "Sign-in blocked" and unlicensed users and guest users to be added in Dy

Vinod Survase 4,801 Reputation points
2023-12-20T16:06:39.71+00:00

What are the attributes to add the active users in the tenant to add them in Dynamic user security group as I tried with below query but its not working as I am trying to exclude the "Sign-in blocked" and unlicensed users and guest users to be added in Dynamic user Security group? So what should be the membership rule here?

Basically I wanted to exclude internal and unlicensed users which are "Sign-in blocked" status and guest users as well.

User's image

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal Lee Morgan 380 Reputation points
    2023-12-20T18:20:46.4733333+00:00

    @Vinod Survase

    It seems that you are trying to add active users in your tenant to a dynamic user security group in Azure B2C <sup>1</sup>. You have tried a query to add the users, but it is not working as you are trying to exclude “Sign-in blocked” and unlicensed users and guest users from being added to the dynamic user security group <sup>1</sup>. You are wondering what the membership rule should be to exclude these users.

    To exclude “Sign-in blocked” and unlicensed users and guest users from being added to the dynamic user security group, you can use the following membership rule:

    (user.accountEnabled -eq true) and (user.userType -ne "Guest") and (user.assignedLicenses -any (assignedLicense.servicePlans -any (servicePlan.serviceName -eq "SHAREPOINT") -and assignedLicense.disabledPlans -notContains "SHAREPOINT")) and (user.signInNames -notContains "blockedsigninname")
    

    This membership rule will add only active users who are not “Sign-in blocked” and unlicensed users and guest users to the dynamic user security group <sup>2</sup>.

    I hope this helps you!

    0 comments No comments

Your answer

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