<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652337#M60426</link>
    <description>&lt;P&gt;You might need to add milliseconds to datetimes string to make it valid&lt;/P&gt;</description>
    <pubDate>Mon, 14 Apr 2025 18:48:31 GMT</pubDate>
    <dc:creator>Deku</dc:creator>
    <dc:date>2025-04-14T18:48:31Z</dc:date>
    <item>
      <title>Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652275#M60425</link>
      <description>&lt;P&gt;I have the following code:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$start = (Get-Date).AddHours(-10).ToString("yyyy-MM-ddTHH:mm:ss")
    $end = (Get-Date).ToString("yyyy-MM-ddTHH:mm:ss")

    # Don't pipe through Out-String or ConvertFrom-Json
    $activities = Get-PowerBIActivityEvent `
        -StartDateTime $start `
        -EndDateTime $end `
        -ActivityType 'ViewReport' `
        -ErrorAction Stop | ConvertFrom-Json

    $activities[0]&lt;/LI-CODE&gt;&lt;P&gt;That outputs the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Id                       : {}
RecordType               : {}
CreationTime             : {}
Operation                : {}
OrganizationId           : {}
UserType                 : {}
UserKey                  : {}
Workload                 : {}
UserId                   : {}
ClientIP                 : {}
UserAgent                : {}
Activity                 : {}
ItemName                 : {}
WorkSpaceName            : {}
DatasetName              : {}
ReportName               : {}
CapacityId               : {}
CapacityName             : {}
WorkspaceId              : {}
ObjectId                 : {}
DatasetId                : {}
ReportId                 : {}
ArtifactId               : {}
ArtifactName             : {}
IsSuccess                : {}
ReportType               : {}
RequestId                : {}
ActivityId               : {}
DistributionMethod       : {}
ConsumptionMethod        : {}
ArtifactKind             : {}
RefreshEnforcementPolicy : {}
BillingType              : {}&lt;/LI-CODE&gt;&lt;P&gt;I am trying to figure out why I am getting objects for which each attribute is just an empty list. I have followed the official documentation for this Cmdlet but I can't figure out why this is happening.&amp;nbsp;&lt;BR /&gt;I've also tried not using&amp;nbsp;&lt;STRONG&gt;ConvertFrom-Json&lt;/STRONG&gt; and just log the Json string. However, I get the same result.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Documentation I'm following:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-bi/guidance/admin-activity-log#example-2-view-all-activities-for-a-user-for-one-day" target="_blank" rel="noopener"&gt;Access the Power BI activity log - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 18:11:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652275#M60425</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-14T18:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652337#M60426</link>
      <description>&lt;P&gt;You might need to add milliseconds to datetimes string to make it valid&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 18:48:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652337#M60426</guid>
      <dc:creator>Deku</dc:creator>
      <dc:date>2025-04-14T18:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652352#M60428</link>
      <description>&lt;P&gt;Good idea, I changed the dates as such:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$start = (Get-Date).AddHours(-10).ToString("yyyy-MM-ddTHH:mm:ss.fff")
$end = (Get-Date).ToString("yyyy-MM-ddTHH:mm:ss.fff")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I still get the same output though&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 18:55:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652352#M60428</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-14T18:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652374#M60430</link>
      <description>&lt;P&gt;Does it work without the activitytype filter?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 19:11:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652374#M60430</guid>
      <dc:creator>Deku</dc:creator>
      <dc:date>2025-04-14T19:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652408#M60431</link>
      <description>&lt;P&gt;Even without the activity filter, I get the same result.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 19:43:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652408#M60431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-14T19:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652412#M60432</link>
      <description>&lt;P&gt;Think either the dates are misformed or no data in the period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try outputting the datetimes strings to sense check. Also try looking back a full 30 days, without a activitytype file&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 19:50:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652412#M60432</guid>
      <dc:creator>Deku</dc:creator>
      <dc:date>2025-04-14T19:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652415#M60433</link>
      <description>&lt;P&gt;This is a wrapper on the&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-activity-events" target="_self"&gt;Get Activity Events&lt;/A&gt; API. Make sure you are fabric admin or using a service principal with delegated permissions.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Apr 2025 19:53:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4652415#M60433</guid>
      <dc:creator>Deku</dc:creator>
      <dc:date>2025-04-14T19:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4653839#M60455</link>
      <description>&lt;P&gt;Updated the code as such:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$start = (Get-Date).AddDays(-30).ToString("yyyy-MM-ddTHH:mm:ss.fff")
$end = (Get-Date).ToString("yyyy-MM-ddTHH:mm:ss.fff")
Write-Host $start to $end
$activities = Get-PowerBIActivityEvent `
        -StartDateTime $start `
        -EndDateTime $end | ConvertFrom-Json `
        -ErrorAction Stop
$activities&lt;/LI-CODE&gt;&lt;P&gt;I get the following output and error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2025-03-16T08:15:00.598 to 2025-04-15T08:15:00.599
Get-PowerBIActivityEvent : Operation returned an invalid status code 'BadRequest'
At C:\Users\jafarip\OneDrive - TC TC\Desktop\DV-RD\Scripts\Get-MigrationActivityEvents.ps1:7 char:19
+     $activities = Get-PowerBIActivityEvent `
+                   ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...BIActivityEvent:GetPowerBIActivityEvent) [Get-PowerBIActivityEvent], HttpOperationExcep  
   tion
    + FullyQualifiedErrorId : Operation returned an invalid status code 'BadRequest',Microsoft.PowerBI.Commands.Admin.GetPowerBIActivityEvent&lt;/LI-CODE&gt;&lt;P&gt;It's becasue the Cmdlet doesn't work with long time ranges (30 days). I tested that it works with max half a day worth of range.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 12:17:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4653839#M60455</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-15T12:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4653841#M60456</link>
      <description>&lt;P&gt;If I didn't have fabric admin role, I think I would have gotten 403 unauthorized but now I'm just getting bad request. Can you confirm if this is true?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 12:18:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4653841#M60456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-15T12:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4654323#M60466</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to Microsoft Fabric Community Forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error you're getting from Get-PowerBIActivityEvents&amp;nbsp;means your current Power BI account doesn't have the required admin privileges to access activity log data.&lt;/P&gt;
&lt;P class="" data-start="279" data-end="295"&gt;You must&amp;nbsp;have :&lt;/P&gt;
&lt;UL data-start="296" data-end="377"&gt;
&lt;LI class="" data-start="296" data-end="339"&gt;
&lt;P class="" data-start="298" data-end="339"&gt;Power BI Service Administrator OR&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="" data-start="340" data-end="377"&gt;
&lt;P class="" data-start="342" data-end="377"&gt;Office 365 Global Administrator&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you're not one of these, you'll need to request access from your IT/Admin team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Chaithanya.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Apr 2025 16:21:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4654323#M60466</guid>
      <dc:creator>v-kathullac</dc:creator>
      <dc:date>2025-04-15T16:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get-PowerBIActivityEvents returns a list of objects with empty list attributes</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4658894#M60555</link>
      <description>&lt;P&gt;Hi&lt;SPAN&gt;&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?&lt;BR /&gt;If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;
&lt;P&gt;Chaithanya.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 13:50:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Get-PowerBIActivityEvents-returns-a-list-of-objects-with-empty/m-p/4658894#M60555</guid>
      <dc:creator>v-kathullac</dc:creator>
      <dc:date>2025-04-18T13:50:56Z</dc:date>
    </item>
  </channel>
</rss>

