Creating a dynamic membership rule to add users active in the last 30 days

Caesar Z. Tin-U 20 Reputation points
2024-11-14T17:04:20.3966667+00:00

Within Entra ID, you can manually export a list that shows users with activity within the last 30 days via the "Last interactive sign-in time" filter.

To automate this process, I'm attempting to create a dynamic rule that will only include users that were active in the last 30 days.

Copilot provided the following response, but it doesn't work:

Any help is appreciated.


It looks like the lastSignInDateTime attribute isn’t supported for dynamic membership rules in Microsoft Entra ID. Let’s try a different approach to achieve your goal.

Instead of using lastSignInDateTime, you can use the signInActivity attribute, which is supported. Here’s how you can adjust your rule:

  1. Check if the signInActivity attribute is available for your users. This attribute records the last sign-in date and time.
  2. Use the signInActivity attribute in your rule:
(user.signInActivity.lastSignInDateTime -ge addDays(now(), -30)) 

If signInActivity is not available, you might need to use a different attribute or approach to filter users based on their activity. You can also refer to the Microsoft documentation on dynamic membership rules for more details on supported attributes and examples.

If you continue to face issues, please let me know the exact error message, and we can troubleshoot further!

Microsoft Intune Grouping
Microsoft Intune Grouping
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Grouping: The arrangement or formation of people or things in a group or groups.
61 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,649 questions
0 comments No comments
{count} votes

Accepted answer
  1. Andy David - MVP 151K Reputation points MVP
    2024-11-14T18:05:03.48+00:00

    Sign in is not a supported property:

    https://learn.microsoft.com/en-us/entra/identity/users/groups-dynamic-membership#supported-properties

    You would need to export the list or write a script to capture the users, then upload that list to the group on a scheduled basis

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.