Forum Discussion
TaylorNelson
Nov 06, 2019Copper Contributor
Access Office 365 Audit Logs
I have written a Powershell script to retrieve Audit Logs for Power BI, and store in SQL for analysis. The script works fine with interaction (i.e. login with username/password) but requires MFA. I cannot disable MFA for specific users, as we don't have AAD P2 or Office 365 E5, so I thought I could use an app password. It seems that this won't work either.
How do I access the Audit Log data, programmatically?
- I was on the same boat, then thought.... I should google (i mean BING!) 'How to test Graph API with Postman'.
This article walked me through how to set up the authentication process, you can even generate the code out of Postman.
https://blogs.msdn.microsoft.com/aaddevsup/2018/05/21/using-postman-to-call-the-microsoft-graph-api-using-client-credentials/
Use the Management activity API, with a service principal or a client secret: https://docs.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-reference
- TaylorNelsonCopper ContributorI did start down that path, but I couldn’t work out how the authentication works with the API. Perhaps you could help me?
I have created an App Registration in Azure, but I cannot work out how to get an OAuth token to access this particular endpoint. I get various errors.- jerome317Brass ContributorI was on the same boat, then thought.... I should google (i mean BING!) 'How to test Graph API with Postman'.
This article walked me through how to set up the authentication process, you can even generate the code out of Postman.
https://blogs.msdn.microsoft.com/aaddevsup/2018/05/21/using-postman-to-call-the-microsoft-graph-api-using-client-credentials/