Find SQL Instances with SQLCMD

  • Hi all,

    Im trying to create an inventory of all our SQL instances. Ive been using SQLCMD -L for one source of where all the instances are. But noticed it didn't have any of the instances from different subnets.

    I remoted onto a machine in a different site and subnet and reran the command from a sql box there and results from that subnet and the ones from my subnet (But without instances.) got returned.

    Any ideas what's going on? failing to find any decent info on the command via google so far.

    Thanks

    S

  • Hi, you can also use the command osql -L running from command prompt.

    To list out all the instances to a text file, run below command at command prompt.

    osql -L > c:\allsqlservers.txt

  • stebennettsjb (1/19/2012)


    Hi all,

    Im trying to create an inventory of all our SQL instances. Ive been using SQLCMD -L for one source of where all the instances are. But noticed it didn't have any of the instances from different subnets.

    I remoted onto a machine in a different site and subnet and reran the command from a sql box there and results from that subnet and the ones from my subnet (But without instances.) got returned.

    Any ideas what's going on? failing to find any decent info on the command via google so far.

    Thanks

    S

    (Ran across this community content from http://msdn.microsoft.com/en-us/library/ms181087(v=sql.90).aspx)

    "Troubleshooting can be difficult depending on where UDP 1434 is blocked. If blocking is done at the router between subnets, SQL Browser will work if the remote machine is on the same subnet, but not if it is across the router boundary on another subnet."

  • Have you try to use MAP. Check this link.

  • hi thanks for all the links 🙂

    currently using a combo of powershell scripts i can find online, SCCM, sqlcmd and just plugged in MAP to see what that brings out.

    found a few MySQL boxs a SQLlite box.. not sure what else is out there out..

    Found 5+ SQL Express installed for application servers that no one mentioned.. all of which if data is lost they would be crying a river!

    Few Enterpise Edition SQL servers out there that totally dont need to be.. so good process to go though if your in company thats not following some sensible management ITILL processes etc..

    thanks again for the links and help!

    S

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply