Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2002-05-22 : 13:59:20
|
| Had to do this today in response to the various security alertsso wrote a little script to do it for me - hope its useful to someonecopy and paste into notepad and save as auditsa.vbs and run it fromthe command line to get a report in file sqlservers.txt (Since it usesthe SQLSMO ListAvailableServers method it is limited to the localsubnet I believe although if you have aliases set up it should use them)cscript auditsa.vbs >sqlservers.txtHTHJasper Smith'Audit subnet for Servers with blank sa passwordDim oAppDim oServerDim oDatabaseDim oNamesDim oNameSet oApp = CreateObject("SQLDMO.Application")Set oNames = oApp.ListAvailableSQLServers()On Error Resume NextFor Each oName In oNames Set oServer = CreateObject("SQLDMO.SqlServer") oServer.LoginSecure = False oServer.LoginTimeout= 30 oServer.Connect oName,"sa","" If Err.Number=0 Then WScript.Echo "!!!Server " & oName & " has a blank sa password" WScript.Echo oServer.VersionString WScript.Echo "" End If oServer.DisConnect Set oServer = Nothing Err.ClearNextoApp.QuitSet oApp = NothingWscript.Quit |
|
|
|
|
|