locked
System DSN RRS feed

  • Question

  • We have a 3rd party application that uses a system dsn to connect to a database. We moved the database to a new server. We kept the database name and the username. We have to use SQL Authentication. Pointing the dsn to the new server is easy. I can do this through the registry. On the new server, we changed the password for SQL Authentication. We have not gone live yet.  I have to change the password on the system dsn for 400 workstations. Can some one point me to a tool or script that allows me to change the password.

    Thank you.

    Sunday, September 28, 2014 8:35 PM

Answers

  • It's more a question for powershell/system administration.

    System DSN's are saved into registry. If you have access to their registry them you can execute it to all remote workstations.

    You can do it with powershell.

    I'd do it with psexec (www.sysinternals.com) and a batch file to execute the

    Create e.g. a file named regimport.bat

    regedit.exe /S exportedregistry.reg

    on the remote machines

    Command Line:

    psexec @filewithallcomputers.txt -u domain\admin -p password \\server\\share\\regimport.bat

    You also should create a text file containing all the computers you want this to run... (I named filewithallcomputers.txt)

    You can export the value from the registry so you can remotely import it(careful for differences between 32/64bit).

    This will help:

    http://blogs.technet.com/b/heyscriptingguy/archive/2005/07/25/how-can-i-retrieve-a-list-of-the-system-dsns-on-a-computer.aspx

    Hope this is enough...


    "If there's nothing wrong with me, maybe there's something wrong with the universe!"


    • Edited by cnk_gr Sunday, September 28, 2014 8:54 PM
    • Marked as answer by bfeltus Tuesday, September 30, 2014 10:21 PM
    Sunday, September 28, 2014 8:53 PM
  • System DSN ODBC password was working before (as I read) for the same application, so I suspect:

    • Either the application holds the password on some other location (registry, settings file) and enters it programmaticaly
    • The password was saved for that specific DB driver (e.g. Oracle)
    • It was working on SSPI 

    "If there's nothing wrong with me, maybe there's something wrong with the universe!"

    • Marked as answer by bfeltus Tuesday, September 30, 2014 10:23 PM
    Monday, September 29, 2014 3:51 AM
  • How do I get the new password on the workstations?

    It depends where the application stores the password.  It is not stored with the ODB system DSN.


    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

    • Marked as answer by bfeltus Tuesday, September 30, 2014 10:21 PM
    Tuesday, September 30, 2014 2:06 AM

All replies

  • It's more a question for powershell/system administration.

    System DSN's are saved into registry. If you have access to their registry them you can execute it to all remote workstations.

    You can do it with powershell.

    I'd do it with psexec (www.sysinternals.com) and a batch file to execute the

    Create e.g. a file named regimport.bat

    regedit.exe /S exportedregistry.reg

    on the remote machines

    Command Line:

    psexec @filewithallcomputers.txt -u domain\admin -p password \\server\\share\\regimport.bat

    You also should create a text file containing all the computers you want this to run... (I named filewithallcomputers.txt)

    You can export the value from the registry so you can remotely import it(careful for differences between 32/64bit).

    This will help:

    http://blogs.technet.com/b/heyscriptingguy/archive/2005/07/25/how-can-i-retrieve-a-list-of-the-system-dsns-on-a-computer.aspx

    Hope this is enough...


    "If there's nothing wrong with me, maybe there's something wrong with the universe!"


    • Edited by cnk_gr Sunday, September 28, 2014 8:54 PM
    • Marked as answer by bfeltus Tuesday, September 30, 2014 10:21 PM
    Sunday, September 28, 2014 8:53 PM
  • Also if you're going to scrap the old server on you can change DNS entry so the old server's name resolves to the  new server's IP (if you're keeping same instance name - or default, database name etc etc).

    "If there's nothing wrong with me, maybe there's something wrong with the universe!"

    Sunday, September 28, 2014 9:01 PM
  • Are you referring to a SQL Server DSN?  The password is not stored with the DSN; it must be supplied by the application when the connection is opened.  The DSN password is used only by the ODBC Administrator to retrieve connection settings and test the connection.  It is not stored at all.


    Dan Guzman, SQL Server MVP, http://www.dbdelta.com


    Sunday, September 28, 2014 11:12 PM
  • System DSN ODBC password was working before (as I read) for the same application, so I suspect:

    • Either the application holds the password on some other location (registry, settings file) and enters it programmaticaly
    • The password was saved for that specific DB driver (e.g. Oracle)
    • It was working on SSPI 

    "If there's nothing wrong with me, maybe there's something wrong with the universe!"

    • Marked as answer by bfeltus Tuesday, September 30, 2014 10:23 PM
    Monday, September 29, 2014 3:51 AM
  • I apologize if I was not clear on what I needed.

    1. We have a 3rd party application that use a sql database.

    2. Our client computers connect to the database via odbc with a system dsn, sql authentication.

    3. We built a test sql server and put a backup copy of the production database on the test server.

    4. We changed the password for sql authentication on the copied database because the one on production is weak.

    5. When we go live on the new server (test server) we have to point 400 clients (odbc) to the new server.

    6.  The system dsn name, username, and database name stays the same. I have to change the password and the sql server name.

    7. I know I can change the sql server name via registry.

    How do I get the new password on the workstations?

    I have a workstation setup with the new odbc settings. Are you saying I can import the settings from this workstation to the 400 clients and I will be able to connect to the new database server once we go live?

    Thank you.

    Monday, September 29, 2014 6:06 PM
  • How do I get the new password on the workstations?

    It depends where the application stores the password.  It is not stored with the ODB system DSN.


    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

    • Marked as answer by bfeltus Tuesday, September 30, 2014 10:21 PM
    Tuesday, September 30, 2014 2:06 AM
  • I get it now. Thanks.
    Tuesday, September 30, 2014 10:22 PM