Anyone have an example of a custom inv script to pull a registry hive?
Created: 05 Dec 2012 | Updated: 07 Dec 2012 | 10 comments
This issue has been solved. See solution.
I am looking for a script that will pull a registry hive
example
HKLM\Software\MyKey
Where it has multiple value's and each value has some data
I want it to pull everythign in the hive into a custom data clasee
so that I will end up with my data class showing 2 colums and rows
so basically from looking at a reg export this is what I have and would want in the database where mykey is the class
[HKEY_LOCAL_MACHINE\SOFTWARE\MyKey]
"ImageCutDate"="5/11/11"
"ImageVersion"="Windows 7 Pro SP1"
"Win7Revision"="2"
"Win7"="1"
"SP1"="True"
"Brand"="Lenovo"
"Model"="T420s"
"Type"="Laptop"
I see examples of pulling just 1 registry key or targetted, but the values in this reg key vary and could be 10 per machine or 100 per machine.
Discussion Filed Under:
Comments 10 Comments • Jump to latest comment
try reading https://www-secure.symantec.com/connect/forums/custom-inventory-troubleshooting
hope it helps.
Nelo
It looks like that script is getting specific values that they know about, unless I'm just reading the script wrong, which I could be I'm not a VB guru. I want to pull every single value in the registry key , some may not be known as they may be added manually or by processes that don't exist now but will in the future
EX:
today the key may contain only these values
myvalue1=25
myvalue2=test
and then tomorrow maybe it no longer has myvalue1 but rather has myvalue3, So I need a script that will just recursivly get every single value and its data in a registry hive.
Ok doing some searching and modifying some scripts and adding in the altiris specific NSE creation I did get a script to work. I know my values are only REG_SZ or REG_DWORD, so I ignore anything else found in the hive.
I still have to add error handling in case the registry hive doesn't exist but this script does what I need and populates a dataclass for the pc with multiple rows for each value/data combo in the registry hive.
Can you please show me a screenshot of your Attributes in the Custom Data Class for this custom inventory? I am new to 7.1 and I'm having a hard time understanding attributes.
I've attached a screenshot
Yes,
All of the values such as "ImageCutDate", "ImageVersion", etc will be placed into the Name attribute and the data such as "5/11/11", "Windows 7 Pro SP1", etc will be placed into the Value attribute.
So looking at the database table I would have 2 columns
Column Names- GISName GISValue
ImageCutDate 5/11/11
ImageVersion Windows 7 Pro SP1
... ...
etc
Thank you for all your help. If I have to also grab the Registy Key like HKLM\Software\Test, would I then need three attributes?
If you are grabbing 2 different registry hives I would say create 2 seperate data classes and have 2 seperate custom inventory scripts, 1 for each.
The issue with is that the hives under HKLM\Softwar\Test are created based on the application version installed like the screenshot below. I am very new to VBScript and 7.1 that tackling this problem is very challenging for me.
Would you like to reply?
Login or Register to post your comment.