Forum Discussion

TaylorNelson's avatar
TaylorNelson
Copper Contributor
Nov 06, 2019
Solved

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?

  • jerome317's avatar
    jerome317
    Nov 07, 2019
    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/

5 Replies

    • TaylorNelson's avatar
      TaylorNelson
      Copper Contributor
      I 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.
      • jerome317's avatar
        jerome317
        Brass Contributor
        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/

Resources