Tuesday, July 25, 2023

PowerShell to grant access to a Power BI Workspace

 


This short script will help you get access to a Power BI workspace. All you need is the user's email address, and the ID of the workspace which you can get from the URL. The last two lines get information about the Workspace, and confirm that you granted access to the user.

Import-Module -Name MicrosoftPowerBIMgmt
Connect-PowerBIServiceAccount
$workspaceID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$email = "person@contoso.com"
 
Add-PowerBIWorkspaceUser -Scope Organization -Id $workspaceID -UserEmailAddress $email -AccessRight Member
Get-PowerBIWorkspace -Id $workspaceID
Invoke-PowerBIRestMethod -Url "groups/$workspaceID/users" -Method Get 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.