Tuesday, November 28, 2006

SQLDMO

Here is a small script using SQLDMO against a MS SQL Server 2000 or 2005 to obtain the TCP port number currently used. I know the Books Online for SS05 indicates that DMO is no longer supported - well I guess that they're wrong:

$s = New-Object -comobject "SQLDMO.SQLServer"
$s.loginsecure = $true
$s.connect("SERVERNAME01")
$s.registry.tcpport
$s.close()

1 comment:

LordFox said...

AFAIK SQLDMO is supported in SQL2005 but is slated to be removed in future versions of SQL Server.