Download Power BI Audit Logs with the New Get-PowerBIActivityEvent cmdlet

You may also like...

12 Responses

  1. Thanks for the great blog post

    When I try and run the command above, where I am a Global Admin it simply returns the following in the JSON file

    “[]”

    Any idea why?

    • Aaron Nelson says:

      Gilbert,
      Thanks, I’m glad you like the post. In my testing, when I received [] as the result, that was indicated there was no activity to report that day. If you’re receiving that result for a day where you know there’s activity, that may mean that there’s an issue with the service which supplies the data to the API/Get-PowerBIActivityEvent cmdlet.

      • There is certainly activity for that day I tried it on 2 different tenants where doing it via the older method is returning results.

        I will give it a go again and see what happens.

        • Jason Hurley says:

          Gilbert, I’m having the same issue. When I pull for the past 30 days, I have hundreds of records for the first few weeks of September, but then it mysteriously stops on 9/26 and I have no data since then.

          Aaron, any idea why that would be? What were you referring to when you mentioned the service that supplies the data to the API?

  2. Jason Hurley says:

    This is great, thanks! One little typo though – in your two code examples (but not in your code screenshot), you forgot the ‘s’ on the end of Get-PowerBIActivityEvents

    • Aaron Nelson says:

      Thanks, glad you liked it.

      I’m also glad you’re paying lose attention. It’s not a typo though, they renamed the cmdlet and pushed out a new version of the module. (PowerShell cmdlets aren’t supposed to be named in the plural.) Run Update-Module MicrosoftPowerBIMgmt -WhatIf and you will probably see that v 1.0.802 is waiting for you

      • Jason Hurley says:

        Thanks! I’m pretty new to the PowerShell world, so the nuances are interesting. I ran the update you recommended and tried both the singular and plural versions of the cmdlet and both work! Maybe there’s a transition period for those who started using the plural version? I can’t imagine they’d keep both hanging around.

        • Aaron Nelson says:

          Yes, they added an alias to the module named Get-PowerBIActivityEvents which simply points to theGet-PowerBIActivityEvent cmdlet. You can see this for yourself by running: Get-Command -Module MicrosoftPowerBIMgmt*

          Make sure you include that star on the end, otherwise you’ll get nothing back.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: