Scan for SQL servers on network

Marco Bakker | DBA.nl 72 Reputation points
2022-05-12T16:57:29.837+00:00

Hi,

I would like to scan our corporate network and find all running SQL servers. I tried SQLCMD -L, but it doesn't show me any information at all. Also tried [System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources() within PS, but also no results.
Can somebody assist me in getting the info? Or there another easy way to find the SQL servers?
I tried also MAP but I would like to scan the network without any tool.

kind regards
Marco

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

2 answers

Sort by: Most helpful
  1. Tom Phillips 17,741 Reputation points
    2022-05-12T17:25:45.237+00:00

    It depends on what exactly you are trying to find out.

    If you are wanting to know if SQL Server is installed, there is not a real way to do that from a PC connected to the network. There are many reasons a SQL Server would not show up in your list. You would have to use an "inventory scanner", like SCOM or MAP, which scans a machine for applications.

    If you are trying to find how to connect to a remote SQL Server, again, there is no way to do that from a PC. There are some ways to "listen" to browser broadcasts, but those are not reliable and can be turned off.


  2. Seeya Xi-MSFT 16,476 Reputation points
    2022-05-13T09:47:15.997+00:00

    Hi @Anonymous ,

    Welcome to Microsoft Q&A!
    You can reinstall sqlcmd and ensure to match your current computer: https://learn.microsoft.com/en-us/sql/tools/sqlcmd-utility?view=sql-server-ver15https://learn.microsoft.com/en-us/sql/tools/sqlcmd-utility?view=sql-server-ver15
    Also you can install the latest CU16: https://support.microsoft.com/en-us/topic/kb5011644-cumulative-update-16-for-sql-server-2019-74377be1-4340-4445-93a7-ff843d346896
    Finally, i put the document about MAP here: https://learn.microsoft.com/en-us/archive/blogs/markm/inventorying-sql-servers-with-the-microsoft-assessment-and-planning-toolkit-map

    Best regards,
    Seeya


    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.