cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Can I return all datasets for a given on-premise gateway source server name?

Hi,

 

Due to now having hundreds of workspaces within my tenant, is it possible to use Powershell (or the likes) to return all datasets for a given on-premise gateway source server name? For example, list all datasets using the gateway server name "AdventureWorks" as it's source?

 

Thanks. 

3 REPLIES 3
Highlighted
Frequent Visitor

Re: Can I return all datasets for a given on-premise gateway source server name?

Yes!

 

Using the Power BI REST API, you could easily write a script using the following structure and APIs:

 

Get Groups

For Group in Groups:

   Get Datasets In Group

   for Dataset in Datasets

      Get Datasources In Group
      if Datasource contains AdventureWorks do somthing

This of course assumes that you have a user with access to all groups in the organisation. 

Let me know if this resolved your issue, or if you need further assistance.

Highlighted

Re: Can I return all datasets for a given on-premise gateway source server name?

Hi and thanks for your reply.

 

Do you have any online resources that show me the Powershell code for real world example so I can relate to the actual objects used within the code?

 

I can return all my gateway sources:

 

$GatewayClusterDatasources = ForEach ($GWCL in $GatewayClusters)
    {
        $GWCLID = $GWCL.Id
        Get-DataGatewayClusterDatasource -GatewayClusterId $GWCLID -ErrorAction SilentlyContinue |`
        Select-Object *,@{Name="DateRetrieved";Expression={$RetrieveDate}}

    }

 

But I can't related the above Id back to any workspace dataset source Id's?

 

Thanks,

 

Martin.

Highlighted
Super User II
Super User II

Re: Can I return all datasets for a given on-premise gateway source server name?

Hi @aspnet-scotland

 

I already tried this functionality and finally i found that there is no such API to query the list of all datasets for a given PowerBI Gateway.

 

So the direct answer is there is no such functioanlity so far. However you can create your feedback in Ideas.







Did my reply helpful to you ? Please give Kudos

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

Proud to be a Super User!




Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.