PowerShell - List all SQL instances on my system?

后端 未结 7 2047
一生所求
一生所求 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 16:09

    The System.Data.Sql namespace contains classes that support SQL Server-specific functionality.

    By using the System.Data.Sql namespace you can get all MSSQL instances on a machine using this command in windows power shell: [System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources()

提交回复
热议问题