myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Deploy ODBC settings

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> Deploy ODBC settings Page: [1]
Login
Message << Older Topic   Newer Topic >>
Deploy ODBC settings - 9/9/2008 10:02:16 AM   
amartensson

 

Posts: 104
Score: 0
Joined: 7/25/2006
Status: offline
I'm trying to deploy an ODBC setting to our clients. manually I can do it either via a batscript or through a commandline with the command regedit /s regfile.reg. Odd enough when advertising either the batfile or the regfile with the exact same command, the system dsn is not added. The advertisement claims to be succesful as well! Anyone who has an alternative way of deploying ODBC settings? I've tried this way which I thought would work on several computers, but no luck at all. How can there be a difference between doubleclicking a regfile and running it through SCCM?
Post #: 1
RE: Deploy ODBC settings - 9/9/2008 11:29:01 AM  1 votes
jsandys


Posts: 530
Score: 17
Joined: 3/24/2005
From: San Antonio, TX
Status: offline
Context.  The only difference between the two is typically the account used to perform the action.  When deploying software or running a program through ConfigMgr/SMS while using the install with admin credentials option, the account used is the local System account.  Most of the time this does not cause any issues, but there are a few implications like the System account does not have its own HKU hive, you cannot run as/switch user contexts, the System account does not have a profile, etc.

Given that creating a System DSN writes to HKLM, my only hunch is that a reboot is required (or a service restarted) to make the change effective.  Have you checked the registry to verify the change was made?  Are your clients Vista or XP?



_____________________________

Jason
________________________________________
http://myitforum.com/cs2/blogs/jsandys/default.aspx

(in reply to amartensson)
Post #: 2
RE: Deploy ODBC settings - 9/10/2008 3:36:08 AM   
amartensson

 

Posts: 104
Score: 0
Joined: 7/25/2006
Status: offline
The clients I've tried are both XP and Vista, none work. I've checked the registry and the settings are not imported at all, even after a reboot. If the problem is context, would it be possible to create a new .bat or.cmd with the "Runas...." command in it to make it work?

(in reply to jsandys)
Post #: 3
RE: Deploy ODBC settings - 9/10/2008 7:46:58 AM   
eschloss


Posts: 616
Score: 25
Joined: 9/7/2004
From: Cincinnati
Status: offline
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.

(in reply to amartensson)
Post #: 4
RE: Deploy ODBC settings - 9/10/2008 7:54:14 AM   
hcortez463


Posts: 780
Score: 62
Joined: 4/8/2005
Status: offline
i usually use a vb scirpt for this.. add all your settings in the VB script so it wont be dependent on the .reg file, but ive done it both ways.  Example bellow

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


_____________________________

If it Helps, Please rate....

(in reply to eschloss)
Post #: 5
RE: Deploy ODBC settings - 9/10/2008 9:34:37 AM   
amartensson

 

Posts: 104
Score: 0
Joined: 7/25/2006
Status: offline
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! Thanks for informing me about the context, that really helped:)

(in reply to hcortez463)
Post #: 6
Page:   [1]
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> Deploy ODBC settings Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.188