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
Anonymous
Not applicable

Connecting to SQL Server using Windows Authentication from a different domain computer

My SQL server configured with Windows authentication. All works fine if I connect to my server in PowerBI desktop using my computer. But how do I connect using a different computer which is on a different domain using my Windows credentials?

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

Hi @Anonymous,

Firstly, please ensure that you are able to ping the target server from the machine that is running Power BI Desktop, and please follow the steps in this similar blog to configure SQL Server to allow remote connections. Also ensure that you have added the user of different domain in SQL Server.

Secondly, have you established a trust relationship between the two different domains? If yes, you are able to connect to SQL Server using Windows Authentication from Power BI Desktop, and there are no extra steps you need to take comparing to that you connect to SQL Server in Power BI desktop using your computer.

However, if there is no trust relationship between the two domains. You can use runas /netonly command to achieve your requirement.

1. Open command prompt and run the following command, enter the password of domain user when prompted.

runas /netonly /user: Domain\username "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"

2. Create a saved windows credential for the SQL Server you want to connect to.

For more details, please check the following similar blogs.
Connect to SQL Servers in another domain using Windows Authentication
Pretend You’re On The Domain With Runas /NetOnly


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

Hi @Anonymous,

Firstly, please ensure that you are able to ping the target server from the machine that is running Power BI Desktop, and please follow the steps in this similar blog to configure SQL Server to allow remote connections. Also ensure that you have added the user of different domain in SQL Server.

Secondly, have you established a trust relationship between the two different domains? If yes, you are able to connect to SQL Server using Windows Authentication from Power BI Desktop, and there are no extra steps you need to take comparing to that you connect to SQL Server in Power BI desktop using your computer.

However, if there is no trust relationship between the two domains. You can use runas /netonly command to achieve your requirement.

1. Open command prompt and run the following command, enter the password of domain user when prompted.

runas /netonly /user: Domain\username "C:\Program Files\Microsoft Power BI Desktop\bin\PBIDesktop.exe"

2. Create a saved windows credential for the SQL Server you want to connect to.

For more details, please check the following similar blogs.
Connect to SQL Servers in another domain using Windows Authentication
Pretend You’re On The Domain With Runas /NetOnly


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi @v-yuezhe-msft 

I managed to the RUNAS, works fine. I configured a connection using Windows authenthication => use my current credentials (credentials specified in RUNAS). Refresh works well in Desktop.

But about point 2:


@v-yuezhe-msft wrote:

2. Create a saved windows credential for the SQL Server you want to connect to.

What do you mean by "create a saved windows credential"?? How would I do that?

When I publish this report to PBI service and try to refresh, I still get error:

  • Underlying error messageAnalysisServices: Either the user, 'NATIVE_DOMAIN\NATIVE_USER', does not have access to the 'XXX' database, or the database does not exist.

So seems I am missing something. Anyone else managed to get this working?

Thanks in advance,

Grzegorz


Anyone know how to do this using the Power BI Desktop app installed through the Microsoft Store rather than the application installed directly? I'm not having any luck with a command like this:

 

runas /netonly /user:domain\user.name "C:\Program Files\WindowsApps\Microsoft.MicrosoftPowerBIDesktop_2.57.5072.0_x64__8wekyb3d8bbwe\bin\PBIDesktop.exe"

 

The command executes but Power BI never launches. I can't even launch manually using the EXEf file in the folder above, so I think it has something to do with permissions for trusted apps.

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.