1
It is possible to use SMO substitute for the SQLDMO within the SSMS (SQL Server 2008 R2 version)? Use functions such as listing instances within the network similar to ListAvailableSQlServers()
sqldmo?
1
It is possible to use SMO substitute for the SQLDMO within the SSMS (SQL Server 2008 R2 version)? Use functions such as listing instances within the network similar to ListAvailableSQlServers()
sqldmo?
1
According to Technet, the SQLDMO feature has been removed from SQL Server 2012 onwards. The SMO feature has been retained. However, you must use it either by Powershell or by some application written in Visual Studio. The SSMS function is another.
ListAvailableSQlServers()
sqldmo?The idea is that all existing support using SQLDMO is transferred to Powershell. ListAvailableSQLServers
can be rewritten as:
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.Filter = ("computer")
$objSearcher.PropertiesToLoad.Add("name")
$Computers = $objSearcher.FindAll()
foreach ($machine_name in $Computers | sort computername )
{
$sql_servers = get-wmiobject -class win32_service -computer $machine_name
$sql_servers | where { $_.name -like 'MSSQL$' -or $_.name -eq 'MSSQLSERVER'} | select name
}
Browser other questions tagged sql-server
You are not signed in. Login or sign up in order to post.
Thanks Gypsy, I will really have to make "some" kkkkkk changes. It had some very useful codes... but...... take a look at this one:
– Marcelo