PowerShell get-SqlServerList
A handy onliner Function to get a list of SQL servers I have in my Profile
function get-SqlServerList {[System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources()}
This function retrieves a DataTable containing information about all visible SQL Server 2000 or SQL Server 2005 instances.
PoSH> function get-SqlServerList {[System.Data.Sql.SqlDataSourceEnumerator]::Instance.GetDataSources()}
PoSH> get-SqlServerList
ServerName InstanceName IsClustered Version
---------- ------------ ----------- -------
MOWMS002 No 8.00.194
MOWDT010 No 9.00.2047.00
MOWDT015 SQLEXPRESS No 9.00.1399.06
MOWDT036 No 8.00.194
MOWMS001 No 8.00.194
MOWDT022 SQLSERVER2005 No 9.00.2047.00
PoSH>
Thats all for this post,
but I have a lot of material about working with dataSets and ADO to fill them from different sources on my old blog
To see how you can connect to a SQL server see this post on my old blog
/\/\o\/\/ PowerShelled: Getting and Working With SQL Server data ...
And working with dataSets
/\/\o\/\/ PowerShelled: More DataTables and joining them in Monad
/\/\o\/\/ PowerShelled: MSH GUI Viewer for Dataset Example
PowerShelled- working with CSV files in MSH (part one)
some utility functions for working with dataSets >
PowerShelled- PowerShell out-DataGrid update and more
and there are more posts about ADO on my old blog.
Enjoy,
Greetings /\/\o\/\/