<?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: Run Get-PowerBIActivityEvent with Service Principal in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Run-Get-PowerBIActivityEvent-with-Service-Principal/m-p/2798844#M38907</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/381889"&gt;@aaldo_666&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vchenwuzmsft_0-1664261668413.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/793602i83FEAC1822F3E211/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vchenwuzmsft_0-1664261668413.png" alt="vchenwuzmsft_0-1664261668413.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Maybe you can refer this guide:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-activity-events" target="_blank"&gt;Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Sep 2022 07:21:27 GMT</pubDate>
    <dc:creator>v-chenwuz-msft</dc:creator>
    <dc:date>2022-09-27T07:21:27Z</dc:date>
    <item>
      <title>Run Get-PowerBIActivityEvent with Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Run-Get-PowerBIActivityEvent-with-Service-Principal/m-p/2797139#M38893</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I registered app in AAD and &lt;SPAN&gt;enabled Service Principal option in Power BI Admin portal.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So far I can run this cmd let:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$AppId = "AppId"&lt;BR /&gt;$TenantId = "TenantId"&lt;BR /&gt;$ClientSecret = "ClientSecret"&lt;/P&gt;&lt;P&gt;#Create secure string &amp;amp; credential for application id and client secret&lt;BR /&gt;$PbiSecurePassword = ConvertTo-SecureString $ClientSecret -Force -AsPlainText&lt;BR /&gt;$PbiCredential = New-Object Management.Automation.PSCredential($AppId, $PbiSecurePassword)&lt;/P&gt;&lt;P&gt;#Connect to the Power BI service&lt;BR /&gt;Connect-PowerBIServiceAccount -ServicePrincipal -TenantId $TenantId -Credential $PbiCredential&lt;/P&gt;&lt;P&gt;Get-PowerBIWorkspace -first 5&lt;BR /&gt;Get-PowerBIReport -WorkspaceId 666&lt;BR /&gt;Get-PowerBIDataset -WorkspaceId 666&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AAD app permissions:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aaldo_666_0-1664207011782.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/793101iA50D561E53D747D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aaldo_666_0-1664207011782.png" alt="aaldo_666_0-1664207011782.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But Im not able to run any of&amp;nbsp;MicrosoftPowerBIMgmt.Admin cmd lets. Im expecially interested in&amp;nbsp;Get-PowerBIActivityEvent.&lt;/P&gt;&lt;P&gt;I can run&amp;nbsp;Get-PowerBIActivityEvent with my credentials, but for automation I wanted to use service principal.&lt;/P&gt;&lt;P&gt;Any idea what permissions is service principal missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal it to run automatically from win scheduler:&lt;/P&gt;&lt;P&gt;Get-PowerBIActivityEvent -StartDateTime $start_day -EndDateTime $end_day&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 15:59:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Run-Get-PowerBIActivityEvent-with-Service-Principal/m-p/2797139#M38893</guid>
      <dc:creator>aaldo_666</dc:creator>
      <dc:date>2022-09-26T15:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Run Get-PowerBIActivityEvent with Service Principal</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Run-Get-PowerBIActivityEvent-with-Service-Principal/m-p/2798844#M38907</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/381889"&gt;@aaldo_666&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vchenwuzmsft_0-1664261668413.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/793602i83FEAC1822F3E211/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vchenwuzmsft_0-1664261668413.png" alt="vchenwuzmsft_0-1664261668413.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Maybe you can refer this guide:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-activity-events" target="_blank"&gt;Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2022 07:21:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Run-Get-PowerBIActivityEvent-with-Service-Principal/m-p/2798844#M38907</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-09-27T07:21:27Z</dc:date>
    </item>
  </channel>
</rss>

