A repeatable mechanism for populating Configuration Manager with custom registry keys
Here are some of the immediate and obvious benefits:
– Extend Configuration Manager Inventory Definition once for custom registry value collection.
– Pin to the top of custom registry keys and immediately be able to recurse through all child keys. This is perfect for delegated environments.
– Allow different custom registry key inventory collections to different groups of devices and on different collection schedules.
An example of the finished solution is shown below:-
A high level overview of the solution is listed below:-
1. The Configuration Item (script) is edited and the registry key paths are added / modified as required.
2. The Configuration baseline is assigned to a group of devices.
3. The baseline executes and stores all the registry values in a local WMI table
4. The WMI table is collected by hardware inventory and available for reporting / queries
The solution zip file contains 3 elements:-
- The MOF File – See the MOF file import section below
- The Baseline Cab – See the compliance baseline import section below
- The script file – The raw VBScript code should any alterations be required
The script will collect all sub keys under the KEY_PATH and as such should the path be too shallow this will result in HINV (SCCM Inventory) failures because of inventory file sizes. Increases to the “Max MIF Size”Should be carefully considered and follow standard testing and change management processes.
Step 1 – MOF File Import
1. Under the Administration node. Modify the client settings, Hardware Inventory and select Set Classes.
2. Select Import and choose the CM_RegistryValues.mof file from the zip above.
3. Select the option to Import both hardware inventory classes and hardware inventory class settings.
4. Once the import is complete you should see the Registry Values (CM_RegistryValues) class as below.
Step 2 – Configuration Baseline Import
1. Under Assets and Compliance. Right click Configuration Items and Select Import. Select Add and browse for and select the Registry Values into WMI.cab file contained within the zip file above.
2. Once the import is completed. Right click the Registry Values into WMI Configuration Item and edit the Registry Values into WMI script.
3. Add any required Registry Keys Paths as per the examples and comments within the script. Please make sure you have read the warning above.
Step 3 – Deploy the Configuration Baseline
1. Right click the Registry Values into WMI Configuration Baseline and deploy this to a collection of your choosing.
Note: You should always trial anything new in the lab and ensure you check the contents of any files carefully.
Step Four – Baseline Evaluation and Hardware Inventory
1. During the next baseline and hardware inventory the registry values will be loaded into the SCCM Database. This can be monitored within the inventoryagent.log file.
Step Five – Importing the Registry Reports
- 26/01.2015 – Version 2.0 – Detect if a registry path goes directly to a setting and collect the value
Copyright 2015 Esebenza Limited. This program is distributed under the terms of the GNU General Public License.
Esebenza provides all tutorials, code and articles as is with no warranty or recourse to support. Should you experience any issues during deployment Esebenza can not be held liable.