Hi @cruise · Thank you for reaching out.
You can create a PowerShell Script with below cmdlets and schedule it to run at desired intervals via Task Scheduler.
Note: If you use $Creds=Get-Credentials to store the credentials in the variable, make sure MFA is disabled on the account that you use.
Alternatively, you may also use below Graph Call via Graph Explorer
- GET https://graph.microsoft.com/v1.0/auditLogs/signIns
- GET https://graph.microsoft.com/v1.0/auditLogs/directoryAudits
Read More:
- https://learn.microsoft.com/en-us/graph/api/signin-list?view=graph-rest-1.0&tabs=http
- https://learn.microsoft.com/en-us/graph/api/directoryaudit-list?view=graph-rest-1.0&tabs=http
-----------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.