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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Kavi_9907
Regular Visitor

Can not connect to the server to import data

I logged into my lap from my ad account (####\KavyaD) and login in to power bi using the same account. but due to a security concern, we have separate account to login into servers (####\KavyaDAU) . old server is ##.###.###.209 and recently bought a new server ##.###.###.6. i can go to remote desktop connection and log into the server and see the databases using ssms. and to access the server from local machine, i run the ssms by run as different user and use my KavyaDAU account to login. and i login to power bi using my ad account (KavyaD) and when i select get data and give the server ip address as ##.###.###.209, it connects. but when i add ##.###.###.6, it does not connect. gives an error saying " We encounted an error while trying to connect. Details: "Microsoft SQL: The target principal name is incorrect. Cannot generate SSPI context.". but it works for 209. then i tried login to ssms from my local machine by giving run as different user and gave credentials of my KavyaDAU account. that works for 209 but not works for 6. So there's a issue in server side not from power bi side. What should i do?

1 ACCEPTED SOLUTION

Hi @Kavi_9907 

The error you’re getting points to a problem on your local machine rather than with SQL Server itself. Power BI Desktop relies on the .NET Framework assemblies to establish SQL connections, and the message about System.EnterpriseServices failing to load means that the required .NET components are either missing, corrupted, or not properly registered in your system’s Global Assembly Cache (GAC). That’s why SSMS works fine but Power BI fails — SSMS uses a different dependency chain. The way to resolve this is to first make sure your Windows is fully updated, then repair or reinstall the latest .NET Framework 4.8 runtime, as that will restore the missing assembly. After that, repair or reinstall Power BI Desktop to ensure it correctly hooks into the .NET runtime. In many cases, simply repairing .NET and then reinstalling Power BI fixes the issue completely. If your organization enforces strict security policies, you may also need your IT team to check that the Power BI process is allowed to load assemblies from the GAC.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

View solution in original post

13 REPLIES 13
v-nmadadi-msft
Community Support
Community Support

Hi @Kavi_9907 

As we haven’t heard back from you, we wanted to kindly follow up to check if the suggestions  provided by the community members for the issue worked. Please feel free to contact us if you have any further questions.

 

Thanks and regards

v-nmadadi-msft
Community Support
Community Support

Hi @Kavi_9907 

May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.


Thank you

v-nmadadi-msft
Community Support
Community Support

Hi @Kavi_9907 ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.


Thank you.

now database works when i open it through ssms seperately but when i import data into power bi, it gets an error. 
"Loading assembly file 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' failed for data source type 'SQL'"

Hi @Kavi_9907 ,
In addition to the valuable points mentioned by @Poojara_D12 , another point for the cause of the error can be connection issues, which can occur due to authentication problems. For example, SQL Server may be configured for Windows Authentication only while thePower BI is attempting to use SQL Authentication with a username and password. Even if SQL Authentication is allowed, the login credentials might be incorrect or the specified login may not exist in SQL Server. In some cases, the login does exist but lacks the necessary permissions to access the target database. 

Thank you

Hi @Kavi_9907 

The error you’re getting points to a problem on your local machine rather than with SQL Server itself. Power BI Desktop relies on the .NET Framework assemblies to establish SQL connections, and the message about System.EnterpriseServices failing to load means that the required .NET components are either missing, corrupted, or not properly registered in your system’s Global Assembly Cache (GAC). That’s why SSMS works fine but Power BI fails — SSMS uses a different dependency chain. The way to resolve this is to first make sure your Windows is fully updated, then repair or reinstall the latest .NET Framework 4.8 runtime, as that will restore the missing assembly. After that, repair or reinstall Power BI Desktop to ensure it correctly hooks into the .NET runtime. In many cases, simply repairing .NET and then reinstalling Power BI fixes the issue completely. If your organization enforces strict security policies, you may also need your IT team to check that the Power BI process is allowed to load assemblies from the GAC.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
Poojara_D12
Super User
Super User

Hi @Kavi_9907 

The error you’re seeing, “The target principal name is incorrect. Cannot generate SSPI context”, indicates a Kerberos authentication issue rather than a Power BI-specific problem. Since you can connect to the old server (.209) but not the new one (.6), and the same credentials work via RDP but fail when connecting remotely through SSMS or Power BI, it suggests that the new SQL Server’s SPN (Service Principal Name) is either not registered correctly in Active Directory or not aligned with the service account running SQL Server. Kerberos requires the SPN to match the server name or IP being used, otherwise authentication fails. While you might temporarily bypass this by forcing SQL authentication instead of Windows authentication, the proper fix is on the server side: the AD/domain administrator should verify and register the correct SPN for the SQL Server service account on the new server and ensure that it matches the DNS name or IP you’re using to connect. This is why the .209 server works (its SPN is configured) but .6 does not. In short, you’ll need to raise this with your infrastructure or SQL admin team to configure SPNs correctly on the new server.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos"

Kind Regards,
Poojara - Proud to be a Super User
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS

My team says this is happening due to someone has changed some services runing on server agent to a seperate account (#####auth) changing the default account (NT Services) and they are not aware of how to change it back to default settings.

v-nmadadi-msft
Community Support
Community Support

Hi @Kavi_9907 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.


Thank you.

My team says this is happening due to someone has changed some services runing on server agent to a seperate account (#####auth) changing the default account (NT Services) and they are not aware of how to change it back to default settings.

Hi @Kavi_9907  ,
Thanks for reaching out to the Microsoft fabric community forum.

In that case you will have to create a new SQL Server Installation and then get all the required data into the new SQL Server
Go to SQL Server Installation center and then select New SQL Server standalone feature from Installation pane, from there you can install the new SQL Server Instance.

vnmadadimsft_0-1757418435503.png

 

 

I hope this information helps. Please do let us know if you have any further queries.
Thank you

v-nmadadi-msft
Community Support
Community Support

Hi @Kavi_9907 ,
Thanks for reaching out to the Microsoft fabric community forum.

Please double-check whether the SQL service is running. If it isn’t, start the service.
To verify its status, go to Services, locate the SQL Server instance, and check the server’s current status there.

vnmadadimsft_0-1756959739961.png

 



Additionally, Verify connectivity by checking for any network issues. For example, try pinging the IP address of the SQL Server from your machine to ensure the server is reachable.
For example, open Command Prompt or PowerShell and run ping <SQL_Server_IP> to confirm the server is reachable

Finally, Verify that the login credentials you are using have the necessary permissions to access the SQL Server and its databases.

I hope this information helps. Please do let us know if you have any further queries.
Thank you

Shahid12523
Community Champion
Community Champion

Issue: New server (.6) fails with “Cannot generate SSPI context” → Kerberos authentication is broken.
Fix:
- Register correct SPN for the SQL service account using setspn.
- Ensure SQL Server runs under a domain account, not LocalSystem.
- Use FQDN instead of IP when connecting.
- Check for clock sync between your machine and the server.
- Try SQL authentication as a workaround if needed.

Shahed Shaikh

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors