Is there a way to find out a list of the SQL Servers that a windows authenticated ASP.NET user on an intranet site has access to?
I'd like to list them in a dropdown.
Is there a way to find out a list of the SQL Servers that a windows authenticated ASP.NET user on an intranet site has access to?
I'd like to list them in a dropdown.
There are a few ways, to be sure. One that I'm familiar with is the EnumAvailableSQLServers SMO method (have a look here: http://www.sqldbatips.com/showarticle.asp?ID=45)
The trick is verifying that they actually have access to a given server. First, you need to define "has access". Is it whether or not they have a valid SQL login? Whether or not they can access a certain database or securable? You'll need to run through the servers returned by SMO in order to validate each one, based upon whatever criteria you define.