Forum Discussion
Anonymous
3 years agoNot applicable
Fetching the GroupName for groups having access to Workspace
Hi!
When running this script I get the ID in the "user column" for groups and distributionlists.
I need the "Name of the group", how do I do that and where do I find it?
And I also need to fetch the users in that group, if possible?
#$Workspaces = Get-PowerBIWorkspace -Scope Organization -All
$Workspaces = Get-PowerBIWorkspace -Id "XXXX" -Scope Organization
$Workspaces |
ForEach-Object {
$Workspace = $_.name
foreach ($User in $_.Users) {
[PSCustomObject]@{
Workspace = $Workspace
User = $User.Identifier
}
}
}
| Export-CSV "C:\temp\PowerBIGroupMembers.csv" -NoTypeInformation -Encoding UTF8
1 Reply
- lexsmeets_Frequent VisitorYou need to do a call to Azure AD to get the addtional information on the accounts.Use Get-AzADUser, Get-AzADGroup or Get-AzADServicePrincpal from the PowerShell Az.Resources module.As you proberly do not know what kind of account you have, best is to do the calls one by one until you get a result. Get-AzADGroupMember gives the members in the group.