Search code examples
sql-serverdatabase-administrationremote-connections

How to execute sys.dm_exec_connections on behalf of remote server?


I am trying to find active connections on multiple remote SQL Servers at once without establishing connection to them via SSMS. Is that possible? If yes, please help.

I want to see those connection information on the SSMS of my local SQL Server.


Solution

  • One way would be to create linked servers on your local instance, then you could connect there and reference all the other servers through a four-part name reference, like:

    LinkedServerName.master.sys.dm_exec_connections
    

    You could also look into Central Management Servers / registered server groups; SSMS provides some facilities for running the same batch against multiple servers in sequence.