Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KrishnaKolwuri
Advocate I
Advocate I

Get-PowerBIActivityEvent - throws Unauthorized error though I am power bi service admin.

Get-PowerBIActivityEvent -StartDateTime $StartDate -EndDateTime $EndDate | ConvertFrom-Json |Out-File -FilePath C:\AuditLogs\RSActivityLog.json
Get-PowerBIActivityEvent : Operation returned an invalid status code 'Unauthorized'
At line:1 char:1
+ Get-PowerBIActivityEvent -StartDateTime $StartDate -EndDateTime $EndD ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...BIActivityEvent:GetPowerBIActivityEvent) [Get-PowerBIActivityEvent], HttpOperationException
+ FullyQualifiedErrorId : Operation returned an invalid status code 'Unauthorized',Microsoft.PowerBI.Commands.Admin.GetPowerBIActivityEvent

2 ACCEPTED SOLUTIONS
GilbertQ
Super User
Super User

Hi there

Can you confirm that you have got Power BI Admin permissions?

To view this you could go into the Power BI Service , then Admin Portal and see if you can see the tenant settings.

If you do not see the tenant settings, you do not have the required access.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

v-lionel-msft
Community Support
Community Support

Hi @KrishnaKolwuri ,

What Operation did you do before the warning happened? And what's your Power BI License? Maybe related to these factors.

In fact, there are multiple administrator roles in Power BI, first, you can ask "Office 365 Global Administrator" to check if you have the corresponding identity and permissions in office 365 admin portal.

What is Power BI administration? 

 

If these's OK, please refer to these:

https://stackoverflow.com/questions/49037233/operation-returned-an-invalid-status-code-unauthorized 

https://docs.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.admin/Get-PowerBIActivityEve... 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
GuillaumeMH
New Member

hi,

 

The account need Power BI Administrator AND have the licence on Power BI Free.

v-lionel-msft
Community Support
Community Support

Hi @KrishnaKolwuri ,

What Operation did you do before the warning happened? And what's your Power BI License? Maybe related to these factors.

In fact, there are multiple administrator roles in Power BI, first, you can ask "Office 365 Global Administrator" to check if you have the corresponding identity and permissions in office 365 admin portal.

What is Power BI administration? 

 

If these's OK, please refer to these:

https://stackoverflow.com/questions/49037233/operation-returned-an-invalid-status-code-unauthorized 

https://docs.microsoft.com/en-us/powershell/module/microsoftpowerbimgmt.admin/Get-PowerBIActivityEve... 

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hello, 

 

I have the some problem. I can login with Tenant credential, but I don't get error:

Operation returned an invalid status code 'Unauthorized':

 

 

 

 

using (var client = new PowerBIClient(new Uri("https://api.powerbi.com/"), m_tokenCredentials))
{
var reports = await client.Reports.GetReportsInGroupAsync(WorkspaceId).ConfigureAwait(false);

 

 

 

 

Workspace Id exist and if I login with username and password credentials It works.

 

In power Bi:

 

powerb-tenant-2.jpg

I have try se applay permision to the entrier organziation. But in all case I get the some error

 

azure application permission:

powerb-tenant.jpg

powerb-tenant.jpg

 

powerb-tenant.jpg

 

What I do wrong?

GilbertQ
Super User
Super User

Hi there

Can you confirm that you have got Power BI Admin permissions?

To view this you could go into the Power BI Service , then Admin Portal and see if you can see the tenant settings.

If you do not see the tenant settings, you do not have the required access.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors