Can the MSSQL JDBC driver connect to a SQL SERVER using a GMSA account?

Chiru 20 Reputation points
2023-10-20T09:20:34.7466667+00:00

Is it possible for the MSSQL JDBC driver to connect to a SQL SERVER using a GMSA account? If it is, what should the connection string look like? Can the connection URL include the GMSA account name, such as "jdbc:sqlserver://<server>:<port>;databaseName=<database>;user=<GMSA account name>" ?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,913 questions
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 102.3K Reputation points
    2023-10-20T22:09:33.1933333+00:00

    Yes, you can connect with a GMSA account - but only if you log on to Windows with that account. (Which would imply that your Java program is running as a service.)

    When you log with Window authentication, you first need to log on Windows with that Windows user. You cannot log on SQL Server with a different Windows user.


1 additional answer

Sort by: Most helpful
  1. CosmogHong-MSFT 23,946 Reputation points Microsoft Vendor
    2023-10-23T03:39:07.23+00:00

    Hi @Chiru

    A 64-bit architecture is required to run the Windows PowerShell commands used to administer group Managed Service Accounts.

    Please refer to this doc for more details: Getting Started with Group Managed Service Accounts.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.