Skip to main content

MEMCM Inventory Installed Windows Capabilities

It used to be (prior to 1809 Windows 10) that one could inventory the wmi class win32_optionalfeatures and know if RSAT was installed or not. Apparently that is no longer the case; and from what I could discover online, the only supported method is to use the powershell command Get-WindowsCapability -online (with additional filters if desired).

Gary Blok also found that the information for "Installed" things would also show up HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\ComponentDetect -- as subkeys. Unfortunately, that isn't easily translated into a "just a mof edit".

In order to tease out this information, it will need to be a script to populate a custom WMI class anyway, using the POSH command is much easier than parsing those regkeys. (at least, in my opinion)

If, like me, you are tasked with "Create reports to know who has RSAT feature enabled on Windows 10", this may be a solution for you.

Attached --> Here <-- is a zip file, with the script.

To use this...

  1. in your console create a new Configuration Item, call it whatever you want. Example: Inventory Staging for Get-WindowsCapability
  2. under Settings, it will be a "Script", "String"
  3. Paste in the contents of the text file. The "test for compliance" will be Existential, that any value is returned at all.
    1. OPTIONAL; the script is written presuming you only want the "Installed" results to be inventoried. If you want both installed and not installed capabilities, change the variable "$TypesToGet" from "Installed" to instead say "Both"
  4. Add this CI to a Baseline, deploy the baseline.
    1. Optional, testing. On a device which has run the baseline, using your favorite WMI viewing tool (I use WMIExplorer) go check out the local results in root\cimv2\cm_WindowsCapability. If you have results, yay, it worked.
  5. In your Console, Administration, Client Settings, Default Client Settings, right-click properties, Hardware Inventory. Set Classes... and click on "Add..." connect to that sample computer, root\cimv2, and find cm_WindowsCapability in the results, and add that. Monitor your server's dataldr.log to confirm all is well.
  6. Wait. Wait some more. After you've waited long enough, go look at select * from v_gs_cm_windowscapability0

Sample SQL query, if you are looking for Machines with RSAT Active Directory Tools

select s1.netbios_name0, wc.name0, wc.state0
from v_r_system s1
join v_gs_cm_windowscapability wc on wc.resourceid=s1.resourceid
where wc.name0 like 'Rsat.ActiveDirectory.DS-LDS.Tools%'
order by s1.netbios_name0

CMCB, SQL

  • Created on .