January 29, 2010 at 8:56 am
Need to check all servers on domain to see which ones have sql server installed. Does anyone have a script that can do this?
I tried using OSQL -L on my local machine, but that just gave me a very short list, and I know there are much more than that.
Thanks!
January 29, 2010 at 9:47 am
Tough request, as there's lots of variables here.
Do you know if your SQL Servers are listening on the default port (1433)? Can you get a list of IPs to try and communicate with? Are there multiple instances on any of these servers? Do you have a userid that can login to each of the SQL Servers?
I have a small script that runs a simple query to see if the databases are responding. It's driven from a file where I place all my SQL Servers, loop thru it and run an 'OSQL' command (similar to what you've done). Hopefully it helps.
"server_up2.cmd" -- loops thru "serverlist.txt" and calls "doit.bat" for each server
"doit.bat" -- runs the OSQL command and formats some output
"serverlist.txt" -- file that contains a list of servers/IPs to query (not supplied, you'll have to create this)
Make sure to remove the .txt extensions to execute.
----------------------------------------------------------------------------
Sacramento SQL Server users group - http://sac.sqlpass.org
Follow me on Twitter - @SQLDCH
----------------------------------------------------------------------------
January 29, 2010 at 11:45 am
awesome, thanks very much! i'll give it a shot.
January 29, 2010 at 11:53 am
also look into SQLRecon;
it's free and does a very thorough scan of all IP's on your network, looking for SQL in multiple ways.
Lowell
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply