Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PawelM
Frequent Visitor

PowerShell Invoke-PowerBIRestMethod - ArtifactTypes and AccessRight

Hello All,

 

I have searched online but have not found anything substantial. 

 

Use case: I want to use PowerShell and the Invoke-PowerBIRestMethod to get artifactAccess for an ObjectID (GraphID) Where ArtifactType is a DataSet, but I also only want to see the ArtifactAccess if the ObjectID (GraphID) has accessright of "Owner".

Is this possible?

 

Below is what I am currently running in Powershell:

Invoke-PowerBIRestMethod -URL 'admin/users/ObjectID/artifactAccess?artifactTypes=Dataset' -Method GET

3 REPLIES 3
ibarrau
Super User
Super User

Hi. I would like to start saying that the request doesn't follow a request a the docs. You can check the requests for invoke powerbi rest method in here: https://learn.microsoft.com/en-us/rest/api/power-bi/

I think you might be looking for this one: "Granting access to a user for a dataset": https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/post-dataset-user

The URL might be "myorg/datasets/{dataset_id}/users"

I hope that helps,

P/D Be aware to read the required scope and the limitations


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Hello @ibarrau 

The request works fine in PowerShell and I can get back Artifacts with the GraphID. My question is more around the Acutal Get Method as described.

Oh, I see. What do you mean with Artifact access.
I'm reading the request and it will only let you get a response for the access of specific users.

https://learn.microsoft.com/en-us/rest/api/power-bi/admin/users-get-user-artifact-access-as-admin

If you want to know more about the datasets of the specific users, you might want to check the datasets requests in order to run a request for the reponse of each datasets of the user.

I hope that make sense


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors