Thursday, May 13, 2010

Finding all SQL server on your network from sql server 2005/08

By default xp_cmdshell is disabled on SQL server 2005/08. You need to enable this using


sp_configure 'show advanced options', 1
GO
RECONFIGURE
GO
sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
GO


you can then run OSQL command as follows

EXEC master..XP_CMDShell 'OSQL -L'

No comments: