AIM

Image Handling – Part Two: Inventory

As mentioned in the previous blog, the management of Images continues. The next step is to collect the data about Images into the ConfigMgr database. This is a great way to keep track of the images in production.
First up, we need to extend the inventory data in the Configuration.mof file before we can collect the information to ConfigMgr. The Configuration.mof file is located in the ConfigMgr install folder on the Primary site, in my case this is D:\ConfigMgr\inboxes\clifiles.src\hinv.

b5
Figure 1- Where to find the Configuration.Mof file.
You have to edit the file with the extra configuration information for the Image registry keys, the following text below must be entered in between the opening and closing chapter “Added extensions start” and “Added extentions stop” and the text in red is only necessary in ConfigMgr 2007 environments.
You really should test this out in a controlled environment before you “jump in to production”!
// Image iventory by Richard Ulfvin @ FileMilk
// 2012-11-13 01:40:45

#pragma namespace (“\\\\.\\root\\cimv2”)
#pragma deleteclass(“Image”, NOFAIL)
[DYNPROPS]
Class Image
{
[key] string KeyName;
String Description;
String InstallDate;
String InstallPath;
String OS;
String Release;
};

[DYNPROPS]
Instance of Image
{
KeyName=”RegKeyToMOF_32″;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\FileMilk\\Image|Description”),Dynamic,Provider(“RegPropProv”)] Description;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\FileMilk\\Image|InstallDate”),Dynamic,Provider(“RegPropProv”)] InstallDate;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\FileMilk\\Image|InstallPath”),Dynamic,Provider(“RegPropProv”)] InstallPath;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\FileMilk\\Image|OS”),Dynamic,Provider(“RegPropProv”)] OS;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\FileMilk\\Image|Release”),Dynamic,Provider(“RegPropProv”)] Release;
};

#pragma namespace (“\\\\.\\root\\cimv2”)
#pragma deleteclass(“Image_64″, NOFAIL)
[DYNPROPS]
Class Image_64
{
[key] string KeyName;
String Description;
String InstallDate;
String InstallPath;
String OS;
String Release;
};

[DYNPROPS]
Instance of Image_64
{
KeyName=”RegKeyToMOF_64”;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\FileMilk\\Image|Description”),Dynamic,Provider(“RegPropProv”)] Description;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\FileMilk\\Image|InstallDate”),Dynamic,Provider(“RegPropProv”)] InstallDate;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\FileMilk\\Image|InstallPath”),Dynamic,Provider(“RegPropProv”)] InstallPath;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\FileMilk\\Image|OS”),Dynamic,Provider(“RegPropProv”)] OS;
[PropertyContext(“Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\FileMilk\\Image|Release”),Dynamic,Provider(“RegPropProv”)] Release;
};
When you save the configuration file, the MOF compilation will take place on the site server. You should check the dataldr.log file for a successful result.

b6

Figure 2 – Logfile presented to check the MofComp.
Next up, run the Machine Policy Retrieval & Evaluation Cycle and the Hardware Inventory Cycle on a computer that’s been branded by the ZTIImage.wsf script. Wait for the data to be populated in to the local WMI repository on the machine.
Then, navigate in the ConfigMgr console to Administation -> Client Settings -> Default Client Settings, right click and chose Properties. Go to Hardware settings and click on “Set Classes…”
b7
Figure 3- How to get to your Hardware Inventory classes.
In the lower right corner click the Add… button and then the Connect… button under the Add Hardware Inventory Class form that pops up.
Enter the name of the computer that has been branded with the ZTIImage.wsf script in the values box Computer name, then click on the Connect button.

b8
Figure 4- WMI connection to the computer with the Image values.
Add the Image class to the inventory list.

b9
Figure 5 – WMI Class of the Imagehandling.
The class will be added to the inventory data with all the values that is being branded.

b10
Figure 6 – Values being populated in the Hardware Inventory
The information will then show up in Resource Explorer.

b11
Figure 7 – Resource Explorer
In the final blogpost, we will look into how this information can be handy for managing your lifecycle of the desktop service.

Posted in Blog, Configuration Manager, Deployment, Windows Server 2012 R2.