Forum Discussion
Permission Change on Power BI workspaces
- 1 year ago
I already provided the details. Remove the admins, add the contributors.
- 1 year ago
Hi NBK52
To update Power BI workspace permissions using PowerShell, first, import the Power BI module and authenticate using Login-PowerBI. Then, load the CSV file containing workspace IDs and names. For each workspace, retrieve the list of users with "Admin" access using Get-PowerBIWorkspace. Loop through these users, remove their "Admin" role using Remove-PowerBIWorkspaceUser, and assign them "Contributor" access using Add-PowerBIWorkspaceUser. Ensure you have Power BI admin permissions to execute these changes. The script can be modified to exclude certain users or log changes for tracking. Additionally, automation can be achieved using a service principal instead of interactive login. Always review permissions before running the script to prevent accidental access modifications.
Hi NBK52 ,
Thanks for reaching out to the Microsoft fabric community forum.
You can use this following PowerShell script to loop through the CSV file like you want to get the workspace id’s
$csvfile = Import-CSV -Path " CSV file path "
foreach( $row in $csvfile){ Write-Output "workspace_id: $($row.workspace_id)"}
Once you retrieve the workspace ID's
As mentioned by lbendlin , Poojara_D12 please follow the document to change the permission of admins to contributor.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS.
Thanks and Regards