Standard inventory on managed computers collects more than 100 predefined data classes. Inv_SW_Patch_Windows belongs to Hardware group of data classes. You may experience a situation when an inventory task has completed successfully but the Inv_SW_Patch_Windows data class is empty.
The following messages can be seen in the Agent logs:
The inventory for [SW Patch Windows] is an empty string, will create an empty NSI.
OR
Entry 1:
Gathering inventory for SW Patch Windows
-----------------------------------------------------------------------------------------------------
Date: 4/5/2021 1:41:25 PM, Tick Count: 34813011 (09:40:13.0110000), Size: 275 B
Process: AeXNSAgent.exe (2516), Thread ID: 4640, Module: InvAgent.dll
Priority: 8, Source: Inventory::Run
Entry 2:
Gathering OS Patches Information
-----------------------------------------------------------------------------------------------------
Date: 4/5/2021 1:41:25 PM, Tick Count: 34813011 (09:40:13.0110000), Size: 278 B
Process: AeXNSAgent.exe (2516), Thread ID: 4640, Module: InvAPI.dll
Priority: 8, Source: CCEOSUpdatesInfo::DoProcess
Entry 3:
GetVistaOSupdates Fails
-----------------------------------------------------------------------------------------------------
Date: 4/5/2021 1:58:27 PM, Tick Count: 35835005 (09:57:15.0050000), Size: 269 B
Process: AeXNSAgent.exe (2516), Thread ID: 4640, Module: InvAPI.dll
Priority: 8, Source: CCEOSUpdatesInfo::DoProcess
Entry 4:
Failed to collect inventory
-----------------------------------------------------------------------------------------------------
Date: 4/5/2021 1:58:27 PM, Tick Count: 35835005 (09:57:15.0050000), Size: 277 B
Process: AeXNSAgent.exe (2516), Thread ID: 4640, Module: InvAPI.dll
Priority: 8, Source: InvAPI::GetInventoryInformation
ITMS 8.1 RU2 and later
The QuickFixEngineering table and Inv_SW_Patch_Windows data class are populated by Inventory solution.
The following query is used to populate the Inv_SW_Patch_Windows data class:
select HotFixID,InstalledOn,InstalledBy,Description,ServicePackInEffect,FixComments from Win32_quickFixEngineering.
Post ITMS 8.1 RU2, we have a 10 minutes timeout. If the query is not completed in 10 minutes, we return false and do not report anything.
Dism /online /Cleanup-Image /StartComponentCleanup
FOR /F "usebackq" %i in (`DISM /online /Get-Packages /Format:Table /English | find /I "Superseded"`) do DISM /online /norestart /Remove-Package /PackageName:%i /English /Quiet
The example above is for manual running only. Running in a batch script requires escaping of '%' and '|'