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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
DaleH
Resolver I
Resolver I

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 reports via an app.  We are using RLS to restrict the data so each individual can only see their organization's data.

 

Because they are external, the UPN is not the same as our internal people.

 

Other than creating a report which shows UPN and having each outside person open that report, how do I find out what their UPN is?

 

These are some examples of what I have seen so far:

Interanl UPN: John.Doe@mycompany.com

External UPN 1: Live.com#John.Doe@contoso.com

External UPN 2: mail#John.Doe@contoso.com

External UPN 3: John.Doe_contoso.com#EXT#@mycompany.onmicrosoft.com

 

1 ACCEPTED SOLUTION
DaleH
Resolver I
Resolver I

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

View solution in original post

3 REPLIES 3
DaleH
Resolver I
Resolver I

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
DaleH
Resolver I
Resolver I

@GilbertQ Thx for the reponse.

 

Sorry for the delayed response, I have been trying to solve this.  I've seen that your response is partially accurate to my situation and partially not.  I have two users from the same client.  One has the mail# format and the other has the Live.com#.  I have no idea why, perhaps it is affected by the mail client they are using?

 

I have tried unsuccessfully to use the email address, but that compare is failing.

 

Thx,

Still looking...

GilbertQ
Super User
Super User

Hi @DaleH 

 

For external users I have found that if it is from hotmail it would be Live.com#John.Doe@contoso.com

 

If it is from gmail it would then be mail#John.Doe@contoso.com

 

And if it is a user who has their own custom domain it would be John.Doe_contoso.com#EXT#@mycompany.onmicrosoft.com

 

What I have also found is that it still often works to put in the users email address.

 

As always I would suggest testing it to make sure it works as expected.





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

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Solution Authors
Top Kudoed Authors