Forum Discussion
PowerShell get-gateways always returns blank value
Hi Sam,
Since there isn't a REST API of gateways for Admin, I think you have gotten the expected result.
Best Regards,
12 Replies
- v-jiascu-msft
Microsoft Employee
Hi SamTrexler,
What information would you like? Is it the information in power-bi/gateways/getdatasources? If so, you can use invoke-powerbirestmethod with the REST API.
Best Regards,
Dale- SamTrexler
Helper IV
Hi v-jiascu-msft, thanks for the reply.
Yes, I want the data from the link you specified - as well as the information from its parent, the gateways.
I am using Invoke-PowerBIRestMethod successfully to retrieve workspaces, dashboards, dashboard tiles, reports, datasets, dataset gateways, dataset datasources and dataset refreshes. All of these invocations work correctly and return the data on my objects.
However, when I use "Invoke-PowerBIRestMethod -Url 'gateways' -Method Get" it returns an empty value - there are no gateways returned. So of course, that doesn't give me any gatewayids to use to get the datasources.
Funny thing is, when I use Invoke-PowerBIRestMethod where the Url contains "datasets/<datasetid>/gateways" I get the gateway each dataset connects to, and when I specify "datasets/<datasetid>/datasources" I get the datasource for each dataset.
But in this workspace those give me the same gateway on every dataset, and the same datasource on every dataset. What I want is a simple list of distinct gateways and distinct datasources, but those commands don't return anything.
By the way I am logging in as the Power BI Global Admin for the tenant, so all data should be available to me, correct?
Thanks,
Sam
- v-jiascu-msft
Microsoft Employee
Hi Sam,
Since you have known the APIs and the PowerShell tool very well, I would suggest you check your account permission. Even the Global Admin can't access everything. You can log in to the PBI Service to see what you can see. Please refer to the snapshot below. It's easy and clear.
Best Regards,
Dale
- AnonymousNot applicable
Hi All,
I faced with same issue. But I not clearly understand what is Power.BI.Global.Admin.
In my case I use service principal. But I could not find method to add SP to gateway admin list.
Could you please suggest how can I use service principal for that?
Thanks