如何使用PowerBI API或Azure门户提取所有PowerBI用户和工作区访问权限? [英] How to extract all PowerBI users and workspace access using the PowerBI API or Azure Portal?

查看:63
本文介绍了如何使用PowerBI API或Azure门户提取所有PowerBI用户和工作区访问权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Power BI的新功能.试图获取有权访问每个仪表板的用户的报告.任何指针都会有所帮助.

New to Power BI. Trying to get a report of the Users who have access for each Dashboards. Any pointers would be helpful.

提前谢谢!

推荐答案

您可以使用 Get-PowerBIWorkspace power-bi/overview?view = powerbi-ps"rel =" nofollow noreferrer> Microsoft Power BI Cmdlet 获取工作区列表,然后列出基础Office 365组的成员(除非您正在使用新的使用连接到Exchange Online PowerShell .然后枚举组,枚举当前组成员,然后将它们导出为CSV(或以所需方式处理结果).如果您有权限,请提供 -Scope Organization 参数,或忽略该参数以获取工作区列表.

You can use Get-PowerBIWorkspace from Microsoft Power BI Cmdlets to get list of workspaces and then list the members of the underlying Office 365 group (unless you are using the new preview workspaces, which has no underlying Office 365 group) using Get-UnifiedGroup cmdlet. To be able to use it, you need to Connect to Exchange Online PowerShell. Then enumerate the groups, enumerate current group members, and export them to a CSV (or process the result the way you want). If you have rights, provide -Scope Organization parameter, or omit it to get a list of your workspaces.

Import-Module MicrosoftPowerBIMgmt

$password = "xxxxxxxx" | ConvertTo-SecureString -asPlainText -Force
$username = "xxxxxxxx@example.com" 
$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-PowerBIWorkspace #-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 "D:\\PowerBIGroupMembers.csv" -NoTypeInformation -Encoding UTF8

Remove-PSSession $Session

Disconnect-PowerBIServiceAccount

这篇关于如何使用PowerBI API或Azure门户提取所有PowerBI用户和工作区访问权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆