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
Anonymous
Not applicable

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
Anonymous
Not applicable

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.

Anonymous
Not applicable

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.

Hi @Anonymous

 

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.

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.