The problem lies in the smart label drop downs. Not every inventory field is shown when building a smart label and the inventory item OS Install Date is one of those items. In order to build a smart label for this we can use a simple SQL query pasted in over a new smart label.
First, build a new smart label from devices. It does not matter what you use since we will wipe out the query. Go to Label Management --> Smart Labels and click on the name of the smart label that was created.
Click on Edit SQL and paste in the following SQL statement:
SELECT MACHINE.NAME AS SYSTEM_NAME, OS_INSTALLED_DATE as TOPIC_ID FROM MACHINE WHERE (((TIMESTAMP(MACHINE.OS_INSTALLED_DATE) <= NOW() AND TIMESTAMP(MACHINE.OS_INSTALLED_DATE) > DATE_SUB(NOW(),INTERVAL 48 HOUR))))
Save the label. This will automatically label devices that were imaged within the last 48 hours.
Now we can use that label in a patch schedule that aggressively patches machines in that label while keeping older machines out of that patch schedule.
We can alter the time query a bit to find whatever devices we need. For example devices that were imaged over 2 years ago would use this query:
SELECT MACHINE.NAME AS SYSTEM_NAME, OS_INSTALLED_DATE as TOPIC_ID FROM MACHINE WHERE ((TIMESTAMP(MACHINE.OS_INSTALLED_DATE) < DATE_SUB(NOW(),INTERVAL 2 YEAR)))
Happy labeling!
UPDATE...Installed a system image that was sysprepped and the OS installation date is updated to today. So it seems the only instance that would cause this method to fail is if you deployed the image without sysprep which is against Microsoft best practices. - jamie_kace 8 years ago
I noticed looking at the db that the OS_INSTALLED_DATE isn't listed as a timestamp. Could this be an issue? Or what else may be causing it? I even changed the hours to 2000 hours, which should include a lot of machines but it doesn't. - crrussell3 8 years ago
SELECT MACHINE.NAME AS SYSTEM_NAME, OS_INSTALLED_DATE as TOPIC_ID FROM MACHINE WHERE ((TIMESTAMP(MACHINE.OS_INSTALLED_DATE) > DATE_SUB(NOW(),INTERVAL 1 WEEK)))
Forced the new VM to check in, and a couple of other older machines for good measure. The new VM was the only one to pick up this label. So it seems regardless of the field type in SQL it does seem to work. I suspect something either in the syntax or maybe the label you setup. Make sure when you create the manual label that is is used for Devices. And then create a new smart label, assign it to the manual label, and paste in your query.
Might be worth a call to support if the label is not working right as all my tests (on 6.4.120756 of K1000) work perfectly. - jamie_kace 8 years ago