Custom Windows 10 OS Build Number WMI Classes and reporting into SCCM

Device management

Updated:

Since SCCM 1802, inventory is included Windows 10 build version numbers. So this post is outdated now.

Additional Note:
Since I posted this, I got an excellent feedback from Mike Terrill @miketerrill , he asked me why not just use the registry property provider to inventory the UBR registry.
I guess I must admit that I didn’t know I can do that. I am terribly learning modify mof file, always worry if I make a typo.
Here are some links about how to get registry to hardware inventory, thanks again to Mike:
https://miketerrill.net/2015/10/11/inventory-secure-boot-state-and-uefi-with-configmgr/
http://www.enhansoft.com/blog/how-to-use-regkeytomof
http://blog.coretech.dk/kea/how-to-get-registry-information-into-hardware-inventory/
http://it.peikkoluola.net/2013/06/20/extend-sccm-client-hardware-inventory-with-a-custom-attribute-value/

I think it might be easier do the inventory registry way. But here is how I do it in WMI way. 🙂

Because of WannaCrypt ransomware, I need to have a report about which Windows 10 has not installed March.2017 Windows Updates, unfortunately I couldn’t run this report.
Why? Because this update is two months old, SCCM has already clean it up, so there is not reports.

I was thinking, ok, maybe I can query the OS build number, you know when you use winver, you can see there us updated OS build number after applied CU updates.

Example I have here OS build 14393.1198, means I have already installed May update. check details from here:

https://technet.microsoft.com/en-us/windows/release-info.aspx
https://support.microsoft.com/en-us/help/4000825/windows-10-windows-server-2016-update-history

I couldn’t find any reports or query shows this OS Build numbers in SCCM. I think it may not exist? I am not 100% sure.
Anyway, you can find this “1198” in registry: HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion, Name “UBR”, it is a Dword.

So I use PowerShell create a new WMI class call PS_OSBuildDetails, and added three properties: CurrentBuild, UBR, OSBuildNumber, here is the result
note: I use PS_OSBuildDetails, because OSBuildDetails is kind of too common, I am worried if MS decides to use the name someday. 🙂

Then I use SCCM Default Client Setting policy, open up hardware inventory, connect to my machine, add this PS_OSBuildDetails as part of hardware inventory.

I deploy Configuration Baseline name “Get Windows 10 OS Build Number” to other machines, so that it creates this PS_OSBuildDetails WMI class.

Run this query, you will get a report of what OS build number of your Windows 10 version 1607 machines:

select SMS_R_System.NetbiosName, SMS_G_System_OPERATING_SYSTEM.BuildNumber, SMS_G_System_PS_OSBUILDDETAILS.OSBuildNumber, SMS_R_System.LastLogonUserName from  SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_PS_OSBUILDDETAILS on SMS_G_System_PS_OSBUILDDETAILS.ResourceID = SMS_R_System.ResourceId where SMS_R_System.OperatingSystemNameandVersion like "%Microsoft Windows NT Workstation 10%" and SMS_G_System_OPERATING_SYSTEM.BuildNumber = "14393"

You can download the scripts and the exported CB from my OneDrive: Click here

(I use WMI modules from www.powershellDistrict.com , that’s why the script looks a bit long, but I like that module 😀 )

Here is example how to use CI and CB to get Monitor Details, you will find in this post how to add those information to hardware inventory.

http://sccmshenanigans.blogspot.fi/2013/11/custom-wmi-classes-and-reporting-into.html

As always, use it as your own risk. 🙂

2 thoughts on “Custom Windows 10 OS Build Number WMI Classes and reporting into SCCM

  1. Requesting you to please share the steps to run the Powershell script through WMI Baseline in all the client computers.

    1. I am not sure if I understand, PowerShell script and the exported baseline is in the end of my post. You just need to import the baseline to ConfigMgr, and deploy it to your test machines. You can find many other post about how to use baseline, I won’t write those steps again because there are already many other good folks shared them already.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.