PowerShell - List all SQL instances on my system?

后端 未结 7 2082
一生所求
一生所求 2021-02-19 15:04

Is there a Powershell command to list all SQL instances on my system? (MS SQL 2008)

7条回答
  •  孤独总比滥情好
    2021-02-19 15:53

    $a = "MyComputerName"
    
     [System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources() | ? { $_.servername -eq $a}
    

    Aaron method return a more sure response. Read Here about Instance.GetDataSources()

提交回复
热议问题