Home > Archive > Microsoft SQL Server forum > July 2005 > Can I use osql to known the database install on a server via 'guest' ?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Can I use osql to known the database install on a server via 'guest' ?
Florimond

2005-07-06, 7:23 am

Can I use osql to known the database install on a server via 'guest'
account ?

I had over 300 servers with sql server all around France (different
version : 6.5, 7 and 8)
I need to check all database on each servers from my place.
Of course, also it would have been to easy, I don't have all 'sa'
password...

Is that possible to use the 'guest' account to execute a query like
this via osql :

Extract.sql
exec sp_helpdb

Extract.cmd
for /f "usebackq tokens=1 delims=\n" %%i IN (ListServer.txt) DO
osql
-S%%i -Uguest -P -dmaster -i" C:\Extraction\Extrac
t.sql"
-o"C:\Extraction\%%i.rpt"

Could I query 'master' with the 'guest' account ?
Or any other ideas how to do this by an other way ?

Thanks

Erland Sommarskog

2005-07-06, 7:23 am

Florimond (florimond@gmail.com) writes:
> Can I use osql to known the database install on a server via 'guest'
> account ?
>
> I had over 300 servers with sql server all around France (different
> version : 6.5, 7 and 8)
> I need to check all database on each servers from my place.
> Of course, also it would have been to easy, I don't have all 'sa'
> password...
>
> Is that possible to use the 'guest' account to execute a query like
> this via osql :


"guest" is not a login, it's only a database user. To connect to SQL
Server you must either have a valid username/password for SQL
authentication, or your Windows login must have been granted access
to the server.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com