I am trying to create a query that gives me a list of all users who have NOT logged into Azure or any services connected with azure in the last 30 days. This query would start at 30 days and go back. Also, the account would have to be active, not 1 that is deleted already.
Any thoughts on how to complete this would be appreciated!
I guess, you may get this requirement done with Graph API to get the list of all users who have not had any login activity in last 30 days:
If Graph API is not feasible then the Diagnostic Settings from Azure under Monitoring can be leveraged to build the logic for getting the list of users per requirement and then the query copied:
https://2bcloud.io/inactive-users-in-azure-active-directory/