Mass changing an ODBC entry on 50+ computers

I am getting ready to do a massive IP address scheme change here and I have 50+ systems deployed that have the IP address of our AS400 server hard coded as for their ODBC entry. Is there a way to easily change all of these systems to point their ODBC entry to the hostname so that it doesn't matter what IP address the AS400 has? E.g. change the to AS400 so that the system will automatically resolve that 'AS400' to or whatever IP it ends up with.

In the windows registry the only entry I see that is connected with the AS400 is as shown:
"DefaultLibraries"="QGPL APLUS6FCH"
"TraceFileName"="C:\\Documents and Settings\\USER0001\\My Documents\\IBM\\Client Access\\Service\\Trace Files"
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This would work for you if you run it as administrator...
Do your users run a logon script when they logon?

If yes, then you could create a .VBS script to modify the registry upon logon.  Or you could create a 3 line .REG file which looks something like:
     Windows Registry Editor Version 5.00

Make your logon script merge the above .REG file with their registry when they logon.


porkramenAuthor Commented:
Only issue with those solutions is that [HKEY_USERS\S-1-5-21-3618473697-2522214889-598438478-1288\Software\ODBC\ODBC.INI\AS400] varies from user to user.
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.


can be replaced with


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vadim RappCommented:
here's logon script, save as changeodbc.vbs ; it wil check if the value already exists and if so, change it. You can change condition bValue<>"" to bValue=""

on error resume next
Dim WshShell, bValue, bKey
Set WshShell = WScript.CreateObject("WScript.Shell")

bValue = WshShell.RegRead(bKey)
if err.number=0 and bValue<>"" then
  WshShell.RegWrite bKey, "AS400","REG_SZ"
end if
porkramenAuthor Commented:
In the ODBC manager I found that there is an entry for System DSN. We have been entering the AS400 under User DSN instead! I'll make a .reg containing the System DSN entry and have it import as part of a logon script.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.