Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, September 22, 2014 4:13 AM
In Server 2008 R2 is there any way to remotely deploy pre-configured ODBC to client machines?
Unsure if it's something via GP or scripting and can't find much online about this.
Has anyone done it before and if so would you be so kind as to share how you did it?
All replies (6)
Wednesday, October 15, 2014 1:19 AM ✅Answered
Hi Partner,
Thank for your patience. After doing some research, we found three articles as below which may help you.
- Deploy-ODBC-settings: http://www.myitforum.com/forums/Deploy-ODBC-settings-m185647.aspx
- Creating registry keys/values: http://www.tek-tips.com/viewthread.cfm?qid=1226231
Note: Microsoft provides third-party contact information to help you find technical support. This
contact information may change without notice. Microsoft does not guarantee the
accuracy of this third-party contact information.
After reviewing them, I think the methods in the first article is the most helpful. Here I have picked up the related portion.
============================
Method 1: I always use a reg file when I need to deploy ODBC. Here is an example of one that I use.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI]
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC_Name]
"Driver"="C:\WINNT\System32\SQLSRV32.dll"
"Server"="SERVER\NAMEDINSTANCE"
[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]
"ODBC_Name"="SQL Server"
Apply this reg file with "regedit.exe /s FILENAME.reg" in your package and make sure it is run with admin rights.
Method 2: I usually use a vb scirpt for this.. add all your settings in the VB script so it won’t be dependent on the .reg file, but I’ve done it both ways.
ON ERROR RESUME NEXT
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set
objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath =
"SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources"
strValueName = "XXXX" 'Name of
DSN name
strValue = "SQL Server"
objReg.SetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
strKeyPath =
"SOFTWARE\ODBC\ODBC.INI\XXXX" 'Same as Name of DSN
objReg.CreateKey
HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath = "SOFTWARE\ODBC\ODBC.INI\XXXX"
'Same as Name of DSN
strValueName = "Database"
strValue = "YYYY"
'Default database name
objReg.SetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
strValueName =
"Driver"
strValue = "C:\WINDOWS\System32\SQLSRV32.dll"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
strValueName = "Server"
strValue = "ZZZZ" 'SQL server name
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
Method 3: Actually I've tried the vbscript way too, with no luck. Works perfect when running manually, but not when doing it through SCCM. I've found a way to do it though, with a little app called CPAU from www.joeware.net . With this I can pass credentials to import the regfile and it works!
=========================
Hopefully this can be helpful.
Please let me know if you have any questions. Thank you for your time.
Best Regards,
Sophia Sun
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Monday, September 22, 2014 7:55 AM
you can push the odbc related registry keys using Group policy preferences.
The ODBC settings are under the following registry path:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI
or HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI for 32bit ODBC
check this article > http://technet.microsoft.com/en-us/library/cc753092.aspx
Another option is configuring the following Group policy preferences
User Configuration > Preferences > Control Panel Settings > Data Sources
or
Computer Configuration > Preferences > Control Panel Settings > Data Sources
check this article > http://technet.microsoft.com/en-us/library/cc770803.aspx
Tuesday, September 23, 2014 1:34 AM
Thanks Matteo, we will test this out and see what the outcome is.
Tuesday, September 30, 2014 7:00 AM
Hi,
I would like to confirm what is the current situation? Have you resolved the problem?
If there is anything that we can do for you, please do not hesitate to let us know, and we will be happy to help.
Best Regards,
Mandy
If you have any feedback on our support, please click here .
Wednesday, October 8, 2014 12:00 AM
No it hasn't worked for us yet, we are still trying to fix this issue.
Friday, October 10, 2014 10:39 AM
Hi Partner,
Thank you for your post.
From your description, I see that you want to know if there is a way to remotely deploy pre-configured ODBC to client machines.
Please let me know if I have misunderstood anything.
Since there is limited information regarding this, please allow us some time to do some research. I will let you know if there is any update.
Thank you for your time and understanding.
Best Regards,
Sophia Sun
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.