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 192.168.1.1 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 192.168.30.20 to AS400 so that the system will automatically resolve that 'AS400' to 10.12.2.1 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:
[HKEY_USERS\S-1-5-21-3618473697-2522214889-598438478-1288\Software\ODBC\ODBC.INI\AS400]
"Driver"="C:\\WINDOWS\\system32\\cwbodbc.dll"
"Description"=""
"System"="192.168.1.1"
"Signon"="1"
"UserID"="USER0001"
"SSL"="2"
"SQLConnectPromptMode"="0"
"Naming"="0"
"CommitMode"="2"
"DefaultLibraries"="QGPL APLUS6FCH"
"Database"=""
"ConnectionType"="2"
"DateFormat"="5"
"DateSeparator"="1"
"TimeFormat"="0"
"TimeSeparator"="0"
"Decimal"="0"
"MaximumDecimalPrecision"="31"
"MaximumDecimalScale"="31"
"MinimumDivideScale"="0"
"ExtendedDynamic"="1"
"DefaultPkgLibrary"="QGPL"
"DefaultPackage"="QGPL/DEFAULT(IBM),2,0,1,0,512"
"LazyClose"="0"
"PreFetch"="0"
"AllowDataCompression"="1"
"Concurrency"="0"
"ExtendedColInfo"="0"
"QueryTimeout"="1"
"BlockSizeKB"="32"
"MaxFieldLength"="15360"
"BlockFetch"="1"
"CursorSensitivity"="0"
"TrueAutoCommit"="0"
"SortSequence"="0"
"SortTable"=""
"SortWeight"="0"
"LanguageID"="ENU"
"LibraryView"="0"
"ODBCRemarks"="0"
"SearchPattern"="1"
"CatalogOptions"="3"
"ForceTranslation"="0"
"TranslationDLL"=""
"TranslationOption"="0"
"CCSID"="0"
"AllowUnsupportedChar"="0"
"Graphic"="0"
"UnicodeSQL"="0"
"HexParserOpt"="0"
"TraceFileName"="C:\\Documents and Settings\\USER0001\\My Documents\\IBM\\Client Access\\Service\\Trace Files"
"MaxTraceSize"="0"
"Trace"="0"
"MultipleTraceFiles"="1"
"QAQQINILibrary"=""
"SQDiagCode"=""
porkramenAsked:
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.

amit_gCommented:
This would work for you if you run it as administrator...

http://www.windowsitpro.com/Article/ArticleID/40714/40714.html?Ad=1
ACSIPaulCommented:
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
     [HKEY_USERS\S-1-5-21-3618473697-2522214889-598438478-1288\Software\ODBC\ODBC.INI\AS400]
     "System"="AS400"

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

bbfn,
Paul.

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.

amit_gCommented:
[HKEY_USERS\S-1-5-21-3618473697-2522214889-598438478-1288\Software\ODBC\ODBC.INI\AS400]

can be replaced with

[HKEY_CURRENT_USERS\Software\ODBC\ODBC.INI\AS400]

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="192.168.1.1"

on error resume next
Dim WshShell, bValue, bKey
Set WshShell = WScript.CreateObject("WScript.Shell")
bKey="HKCU\Software\Software\ODBC\ODBC.INI\AS400\System"

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
Databases

From novice to tech pro — start learning today.