全部博文(74)
分类: WINDOWS
2008-05-25 10:33:43
http://thepowershellguy.com/blogs/posh/archive/2007/02/09/powershell-get-sqlserverlist.aspx
有很多相关链接介绍, 不过链接所在的blog网站被封锁了, sigh.........
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 containing information about all visible SQL Server 2000 or SQL Server 2005 instances.
就是调用了一个.Net类中方法...不过在PowerShell中这样的操作就是简单...