Tattoo and inventory the registry

OBS: This post is primary about how to tattoo the registry with any given information, and then inventory it with SCCM2012.

In need of knowing when a client got it’s OS intalled/reinstalled? Read further. There is no built-in feature in ConfigMgr, that quickly enables you to find that piece information, which basically means we have to make our own.

In following post I will explain what I do, using hardware inventory in ConfigMgr 2012.

First off, we have to make sure that the information we need, in this instance, the date of OS deployment is created during the actual installation. This can be achieved in various ways. I choose to add an entry to the registry.

Running following commandline from within your OS task sequence does just that:

reg add “HKLM\Software\COMPANYNAME” /v InstallDate /t REG_SZ /d “%date%”

RunDeployDate

With this in place, we have what we need on the clientside. The command will leave a trace of the actual date of when the computer got installed.

Now we need to tell ConfigMgr how to use this, and for this I use hardware inventory.

Hardware inventory means changes to the configuration.mof. Download and use RegKeyToMof will make your life easier on this one: Download here

What you basically need to do, is to browse your way to the registrykey you wish to inventory. In this case HKLM\Software\COMPANYNAME\ and check off InstallDate. RegKeyToMof will automatically generate the necessary snippet of code to be inserted into the configuration.mof file and for your Client Settings in the ConfigMgr console.

Configuration.mof:

configmof

Client Settings:

clientmof

Now update the client’s policy, run a new hardware inventory cycle and monitor the log files. InventoryAgent.log on the client, and dataldr.log on the server are relevant in this case. Datalgr.log vil start updating once the changes to configuration.mof has been done.

If everything goes as expected, you will be able to run a resource explorer on the client from the ConfigMgr console, and see something similar to this:

resourcexplor

And finally from here, you will be able to use this information in queries or even build a report, and this way locate clients which haven’t been reinstalled for a long period of time.

Enjoy.