Forum Discussion
sasdfasdfsad
1 year agoAdvocate IV
PowerShell Requires PBI Admin to work? Get-PowerBIWorkspace
I want to use Get-PowerBIWorkspace to iterate through the users in my workspaces. When I try to use the command, including specifying one of the workspaces I am workspace admin in, I still get a...
- 1 year ago
Hi sasdfasdfsad ,
Unfortunately not, there's only 2 scope Individual and Organizational. Individual scope gives access to entities that current user has. For organizational scope, it has to be admin account to check entities across organization.
https://github.com/microsoft/powerbi-powershell
If this post helps, please accept this as a solution. Appreciate your kudos.
Thanks,
Pallavi
Thanks,
Pallavi
lbendlin
1 year agoSuper User
how did you authenticate? Via Login-PoweBI ?
sasdfasdfsad
1 year agoAdvocate IV
Very good question, I should have included that
Login-PowerBIServiceAccount
then when that came back successfully
Get-PowerBIWorkspace
which returned the error message
However,
I just tried
Login-PowerBI
and while it authenticates fine, I still get the same error when I issue the
Get-PowerBIWorkspace
command.
PS C:\Users\OITCOFloryJ> Get-PowerBIWorkspace
Get-PowerBIWorkspace : Operation returned an invalid status code 'Unauthorized'
At line:1 char:1
+ Get-PowerBIWorkspace
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...owerBIWorkspace:GetPowerBIWorkspace) [Get-PowerBIWorkspace], HttpOperationException
+ FullyQualifiedErrorId : Operation returned an invalid status code 'Unauthorized',Microsoft.PowerBI.Commands.Workspaces.GetPowerBIWorkspace