Friday, March 30, 2012

Instances list on remote IP

Is there a way to get all the SQL Server instances with SQL SMO from a
remote computer?
I got few instances on some remote IP and
how to list them, how to pass to the function this address - could it be
done at all?
Second question:
Locally I'm using SmoApplication.EnumAvailableSqlServers, but
I've got SQLEXPRESS and MSDE SP 4, and got MYCOMPUTERNAME\SQLEXPRESS and
MYCOMPUTERNAME\MSDE2000 but if I do that:
DataTable dt = SmoApplication.EnumAvailableSqlServers(false);
if (dt.Rows.Count > 0)
{
foreach (DataRow dr in dt.Rows)
{
ddlSQLServerInstances.Items.Add(new
ListItem(dr["Name"].ToString(), dr["Name"].ToString()));
}
}
In my dropdownlist appears only MYCOMPUTERNAME, nothing more...
I'll be happy for any suggestions.
Thank you!!!I had the same problem and it turned out to be that the firewall is blocking
the packets. I think one needs to have UDP 1343 open outbound, but unless I
turn off the firewall I still do not get non-local server instances in the
enumeration; The data seems to be sent back on random UDP ports > 2700, (th
e
port range is not confirmed) and I'm not sure if one can specify ranges usin
g
the built-in Windows XP SP2 firewall.
If anyone has a solution for this that lets me use the same firewall and
still get the enumeration, please reply. I'm curious.
"christof" wrote:

> Is there a way to get all the SQL Server instances with SQL SMO from a
> remote computer?
> I got few instances on some remote IP and
> how to list them, how to pass to the function this address - could it be
> done at all?
> Second question:
> Locally I'm using SmoApplication.EnumAvailableSqlServers, but
> I've got SQLEXPRESS and MSDE SP 4, and got MYCOMPUTERNAME\SQLEXPRESS and
> MYCOMPUTERNAME\MSDE2000 but if I do that:
> DataTable dt = SmoApplication.EnumAvailableSqlServers(false);
> if (dt.Rows.Count > 0)
> {
> foreach (DataRow dr in dt.Rows)
> {
> ddlSQLServerInstances.Items.Add(new
> ListItem(dr["Name"].ToString(), dr["Name"].ToString()));
> }
> }
> In my dropdownlist appears only MYCOMPUTERNAME, nothing more...
> I'll be happy for any suggestions.
> Thank you!!!
>

No comments:

Post a Comment