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.
Hi all,
Trying to use a Powershell script to output a csv file of all users in each workspace.
I found a PS script and it creates a csv file, but the file contains 3 weird characters in cell A1.
I checked a workspace and I see 65 users.
Any ideas here:
Thanks,
-w
Connect-PowerBIServiceAccount
$Workspaces = Get-PowerBIWorkspace -All
$Workspaces |
ForEach-Object {
$Workspace = $_.name
foreach ($User in $_.Users) {
[PSCustomObject]@{
Workspace = $Workspace
User = $User.UserPrincipalName
}
}
} | Export-CSV "C:\\PowerBIGroupMembers.csv" -NoTypeInformation -Encoding UTF8
Solved! Go to Solution.
Use
Invoke-PowerBIRestMethod -Url "groups/$wsid/users" -Method Get
instead
This is very helpfull, can you also suggest on directly uploading the CSV file to sharepoint /onedrive folder.
Same piping as above.
Use
Invoke-PowerBIRestMethod -Url "groups/$wsid/users" -Method Get
instead
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
20 | |
19 | |
18 | |
9 |