PowerShell - List all SQL instances on my system?

后端 未结 7 2036
一生所求
一生所求 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:58

    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | out-null
    $mach = '.'
    $m = New-Object ('Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer') $mach
    $m.ServerInstances
    

提交回复
热议问题