Forum Discussion
PowerShell get-gateways always returns blank value
- 7 years ago
Hi Sam,
Since there isn't a REST API of gateways for Admin, I think you have gotten the expected result.
Best Regards,
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
- SamTrexler7 years ago
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-msft7 years ago
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- SamTrexler7 years ago
Helper IV
Hi v-jiascu-msft,
I did as you suggested and ran very simple commands in a new Windows Powershell session. Here are the results. Apparently I can't get the gateways directly? Is there a permisiion I need, or something? Thanks,