Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Bamak
Helper V
Helper V

Manage Access to my Organization Workspaces (Via PowerShell)

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

1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

Hi there

This is the API that I use below.

I then use PowerShell once I get it working to get the expanded details

https://docs.microsoft.com/en-us/rest/api/power-bi/admin/groups_getgroupsasadmin#get-workspaces-with...)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

1 REPLY 1
GilbertQ
Super User
Super User

Hi there

This is the API that I use below.

I then use PowerShell once I get it working to get the expanded details

https://docs.microsoft.com/en-us/rest/api/power-bi/admin/groups_getgroupsasadmin#get-workspaces-with...)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors