KACE - Custom Inventory for ODBC connections
Looking for a quick method to find systems with DSN's configured to specific data sources. Not needing it to be clean but at least something we can parse through with an .XLS report. I've tried the following but it shows in the inventory list for a small fraction of our systems but most return a null value.
ShellCommandTextReturn(reg query HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI)
Is there another method that anyone has gotten to work?
Answers (2)
I was also looking at doing this as well for a custom inventory rule. I think I am going to do this with a vbs script that outputs it to a txt file and the have the K1000 read the contents.
Similar to this:
Const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\ODBC\ODBC.INI\ODBC DATA SOURCES" objRegistry.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValueNames, arrValueTypes For i = 0 To UBound(arrValueNames)strValueName = arrValueNames(i)objRegistry.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue Wscript.Echo strValueName & " -- " & strValueNext
Comments:
-
I saw the VB script on TechNet but it doesn't seem to work (at least on Windows 8.1). Did you have success with that? - sgreenwall 10 years ago
Try it like this:
ShellCommandTextReturn(cmd /c reg query HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI)
Comments:
-
Will this account for inventory of both 32 and 64 bit nodes for instances where a machine may have ODBC configured for each? - sgreenwall 9 years ago
-
I don't remember offhand. It depends on where the registry key is stored for the different versions. It might be in SysWOW. - jknox 9 years ago