Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2143
  • Last Modified:

Find all SQL Servers in network/domain

Is there a way I can find out the names of the servers that  are running any version of MS SQL server? I'd like to run a command which scans the domain for SQL servers, either using powershelll, VBS, AD support tools, whatever.

All servers are 2005 to 2008 R2. Forest functional level 2008 R2.

I have basic powershell experience and very limited VBS knowledge.
0
David
Asked:
David
1 Solution
 
Rich WeisslerProfessional Troublemaker^h^h^h^h^hshooterCommented:
Pinal Dave's script will find SQL Servers that are broadcasting/advertising their existence.

You can also query the directory for SQL instances which have been registered in AD with the SETSPN command.  
"SETSPN -Q MSSQLSvc/*" checks the local domain.  "SETSPN -F -Q MSSQLSvc/*" checks the whole forest.
Unfortunately you can't always count on all instances of SQL being registered.  (Kerberos won't work without it, but plenty of folks don't worry about that.)

A third option would be to use Powershell:
1. Enumerate the computers you are concerned with, I assume Get-ADComputer will work for this purpose for you.
2. Use Get-Service to enumerate the services, and pull out entries for SQL.
0
 
tastasI.T.Commented:
Download Angry IP Scanner and scan your entire network for port 1433.  Microsoft SQL Servers uses port 1433.
0
 
DavidAuthor Commented:
Wow that was great!!! Thanks!! Super easy!!
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now