This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi All,
Is it possible to export user name and user access role for a workspace with help of Power shell script.
Solved! Go to Solution.
Assuming you are familier with the PowerBI PowerShell cmdlets...
# Import the required module
Import-Module MicrosoftPowerBIMgmt
# Provide your PowerBI credentials
$username = "your_username"
$password = "your_password" | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($username, $password)
# Connect to PowerBI service account
Connect-PowerBIServiceAccount -Credential $credential | Out-Null
# Get the workspace
$workspace = Get-PowerBIWorkspace -Name "Your Workspace Name" -Scope Organization
# Create an empty array to hold the results
$results = @()
# Loop through each user in the workspace
foreach ($user in $workspace.Users) {
# Create a custom object for each user
$userObj = New-Object PSObject -Property @{
Identifier = $user.Identifier
AccessRight = $user.AccessRight
PrincipalType = $user.PrincipalType
}
# Add the custom object to the results array
$results += $userObj
}
# Export the results to a CSV file
$results | Export-Csv -Path "C:\path\to\yourfile.csv" -NoTypeInformation
# Disconnect from PowerBI service account
Disconnect-PowerBIServiceAccount
Proud to be a Super User!
Assuming you are familier with the PowerBI PowerShell cmdlets...
# Import the required module
Import-Module MicrosoftPowerBIMgmt
# Provide your PowerBI credentials
$username = "your_username"
$password = "your_password" | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($username, $password)
# Connect to PowerBI service account
Connect-PowerBIServiceAccount -Credential $credential | Out-Null
# Get the workspace
$workspace = Get-PowerBIWorkspace -Name "Your Workspace Name" -Scope Organization
# Create an empty array to hold the results
$results = @()
# Loop through each user in the workspace
foreach ($user in $workspace.Users) {
# Create a custom object for each user
$userObj = New-Object PSObject -Property @{
Identifier = $user.Identifier
AccessRight = $user.AccessRight
PrincipalType = $user.PrincipalType
}
# Add the custom object to the results array
$results += $userObj
}
# Export the results to a CSV file
$results | Export-Csv -Path "C:\path\to\yourfile.csv" -NoTypeInformation
# Disconnect from PowerBI service account
Disconnect-PowerBIServiceAccount
Proud to be a Super User!
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 7 |
| User | Count |
|---|---|
| 24 | |
| 23 | |
| 21 | |
| 21 | |
| 19 |