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 |
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-13 : 15:33:25
|
Are you one of those, like me, who has plenty of SQL Servers in Enterprise Manager, but have forgot over the time which username and password you used to add the SQL Server to the list of servers and groups?Run this VbScript code!Dim oApp, lServer, lGroupsSet oApp = CreateObject("SQLDMO.Application")For lGroups = 1 to oApp.ServerGroups.Count For lServer = 1 To oApp.ServerGroups(lGroups).RegisteredServers.Count MsgBox oApp.ServerGroups(lGroups).Name & " - " & _ oApp.ServerGroups(lGroups).RegisteredServers(lServer).Name & " - " & _ oApp.ServerGroups(lGroups).RegisteredServers(lServer).Login & " - " & _ oApp.ServerGroups(lGroups).RegisteredServers(lServer).Password & " - " & _ oApp.ServerGroups(lGroups).RegisteredServers(lServer).UseTrustedConnection NextNextSet oApp = Nothing EDIT: TyposPeter LarssonHelsingborg, Sweden |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2007-01-13 : 18:27:37
|
as I recall DMO uses per-user encryption for this information in the registry so thankfully this can't be used to fetch others' passwords. at least I don't think it can. www.elsasoft.org |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-14 : 04:20:11
|
It shows, in plaintext, every username and password used to connect to each and one server...Peter LarssonHelsingborg, Sweden |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2007-01-14 : 13:41:21
|
when I said per-user, i meant per windows user. if you log in to your box with a different windows account, do you see the same list of regservers, etc? www.elsasoft.org |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-01-29 : 15:29:57
|
quote: Originally posted by Peso Are you one of those, like me, who has plenty of SQL Servers in Enterprise Manager, but have forgot over the time which username and password you used to add the SQL Server to the list of servers and groups?Run this VbScript code!Dim oApp, lServer, lGroupsSet oApp = CreateObject("SQLDMO.Application")For lGroups = 1 to oApp.ServerGroups.Count For lServer = 1 To oApp.ServerGroups(lGroups).RegisteredServers.Count MsgBox App.ServerGroups(lGroups).Name & " - " & _ App.ServerGroups(lGroups).RegisteredServers(lServer).Name & " - " & _ App.ServerGroups(lGroups).RegisteredServers(lServer).Login & " - " & _ App.ServerGroups(lGroups).RegisteredServers(lServer).Password & " - " & _ App.ServerGroups(lGroups).RegisteredServers(lServer).UseTrustedConnection NextNextSet oApp = Nothing Peter LarssonHelsingborg, Sweden
I think it has to be changed to this (oApp instead of App):Dim oApp, lServer, lGroupsSet oApp = CreateObject("SQLDMO.Application")For lGroups = 1 to oApp.ServerGroups.Count For lServer = 1 To oApp.ServerGroups(lGroups).RegisteredServers.Count MsgBox oApp.ServerGroups(lGroups).Name & " - " & _ oApp.ServerGroups(lGroups).RegisteredServers(lServer).Name & " - " & _ oApp.ServerGroups(lGroups).RegisteredServers(lServer).Login & " - " & _ oApp.ServerGroups(lGroups).RegisteredServers(lServer).Password & " - " & _ oApp.ServerGroups(lGroups).RegisteredServers(lServer).UseTrustedConnection NextNextSet oApp = Nothing CODO ERGO SUM |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-29 : 15:32:40
|
Thank you. Typo on my behalf.Peter LarssonHelsingborg, Sweden |
|
|
|
|
|
|
|