question

jleeprosci avatar image
1 Vote"
jleeprosci asked sikumars commented

Auditing users that have not logged in

Looking to automate a report of all users that have not logged in over a specific period of time. I thought there was an easy way to do this, but can't find it anymore. Anyone know an easy way to pull a report that says something like "List all users that have not logged in in 30 days.". Thanks!

azure-ad-sign-in-logs
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @jleeprosci,

I just wanted to check in and see if you had any other questions or if you were able to resolve this issue? If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.


Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

0 Votes 0 ·

1 Answer

MarileeTurscak-MSFT avatar image
0 Votes"
MarileeTurscak-MSFT answered MarileeTurscak-MSFT edited

Hi @jleeprosci,

One method of detecting accounts that have not logged on is by evaluating the lastSignInDateTime property exposed by the signInActivity resource type of the Microsoft Graph API. There are two ways to do this:

If you search for a specific user by name, you can evaluate the lastSignInDateTime:

 https://graph.microsoft.com/beta/users?$filter=startswith(displayName,'markvi')&$select=displayName,signInActivity

You can request a list of users with a lastSignInDateTime before a specified date (such as 30 days):

 https://graph.microsoft.com/beta/users?filter=signInActivity/lastSignInDateTime le 2019-06-01T00:00:00Z

That method should hopefully provide exactly what you are looking for. Reference: How to manage inactive user accounts

Let me know if this helps!

Thanks,

Marilee









5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.