Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi,
I'm trying to get the permissions on my workspaces (Via Powershell (and) API....)
These are the modern workspaces
For example, I would like to see which security group (or UPN) has the role viewer or member on such or such modern work space ?
I test this power shell script below, but it doesn't return anything correct
Ideally ,If a person has a script regarding this need on applications, I am also a taker
Thanks a lot for any help
Best regards and merci
Christophe
Import-Module MicrosoftPowerBIMgmt
$password = "XXXXXXXXX" | ConvertTo-SecureString -asPlainText -Force
$username = "XXXXXXXXXX"
$credential = New-Object System.Management.Automation.PSCredential($username, $password)
Connect-PowerBIServiceAccount -Credential $credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange `
-ConnectionUri https://outlook.office365.com/powershell-liveid/ `
-Credential $credential `
-Authentication Basic `
-AllowRedirection
Import-PSSession $Session
$Groups = Get-UnifiedGroup #-Scope Organization
$Groups | ForEach-Object {
$group = $_
Get-UnifiedGroupLinks -Identity $group.Name -LinkType Members -ResultSize Unlimited | ForEach-Object {
$member = $_
New-Object -TypeName PSObject -Property @{
Member = $member.Name
Group = $group.Name
}
}
} | Export-CSV "C:\\Users\\LLLLLLL\\OneDrive\\Documents\\RRRR\\Power BI\\Administration\PowerShell\\WSPowerBIGroupMembers_unified.csv" -NoTypeInformation -Encoding UTF8
Remove-PSSession $Session
Disconnect-PowerBIServiceAccount
Solved! Go to Solution.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.