Forum Discussion

DaleH's avatar
DaleH
Icon for Resolver I rankResolver I
3 years ago
Solved

Obtain B2B clients UPN

We have created reports and are sharing them externally with people outside out organization.  They are invited to join as an external user, given a Power BI Pro License and given access to the repor...
  • DaleH's avatar
    2 years ago

    Once an external user has connected to the B2B invitation, you are able to run the following script and locate their upn.

    Thx

     

    PowerShell:

     Connect-PowerBIServiceAccount

    Get-PowerBIWorkspace -Scope Organization -Include All -All |
    ForEach-Object {
        $Workspace = $_.name
        $WorkspaceId = $_.Id
        foreach ($User in $_.Users) {
            [PSCustomObject]@{
                Workspace = $Workspace
                WorkspaceId = $WorkspaceId
                User = $User.accessright
                Identifier = $user.Identifier}}}
    | Export-CSV "C:\Temp\UPN.csv" -NoTypeInformation