简体   繁体   中英

Test SQL Server connection for an Active Directory account

I have a SQL Server login created (Windows Authentication) and SQL Server user linked to the login.

I want to test the connection to this SQL Server from another server on the network for this particular Active Directory account (different than my AD account). I do not have a SSMS(SQL Server Management Studio) installed on the server I want to test the connection from.

How can I do that?

Figured it out. Here is how I tested it:

  1. Create a Microsoft Data Link file (.udl) anywhere on the client machine. Just create a new test.txt file and rename it to test.udl

  2. Opening the properties dialogue of .udl file lets you test the connection to a SQL Server. My problem was that the connection to the SQL Server needs to be tested for an AD account different than mine. To do this, run the command prompt as that user on the client machine:

    在此处输入图片说明

  3. In command prompt, navigate to the folder that contains test.udl file and type the name of the file in the prompt.

  4. This will open the properties of the .udl file. Go to Connection tab and provide the SQL server name:

    在此处输入图片说明

  5. Select "Use Windows NT Integrated security" in section #2:

    在此处输入图片说明

  6. When you click on the database drop-down in section #3 and you are able to see the list of databases, that means that the login worked for the user. If you wish you can select a database from the list and click "Test Connection" button to test a specific database connection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM