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()