List all SQL Servers running on your Domain using a single command

Sometimes you want to find all the SQL servers running on your Domain with one quick command. SQLCMD providess facility to do so. Your client workstation should have Microsoft SQL server client installed on it for SQLCMD to work.

1. Go to Command Prompt. If you are on Windows Server 2008. Right Click Command Prompt and say “Run as Administrator”

2. At thepromp type:

SQLCMD -L

This will list all the SQL servers running on your network.

3. To save as csv file

SQLCMD -L > allservers.csv

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s