memdocs
memdocs copied to clipboard
Not recommended to use win32_Product query.
The recommended detection method relies on a discouraged method Win32_product.
Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -match "Microsoft Update Health Tools"}
As documented in this article Win32_Product should not be used for application detection. Can the recommended detection method be updated. I'm currently using the existence of the "C:\Program Files\Microsoft Update Health Tools\expediteupdater.exe" exists as valid installation detection.
https://learn.microsoft.com/en-us/powershell/scripting/samples/working-with-software-installations?view=powershell-7.2
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 4e6d726f-bd44-d168-0af5-c0fe73e06eb9
- Version Independent ID: a87f06b1-f284-42db-a5ed-2cba46bdf2b9
- Content: Use Intune to expedite Windows quality updates
- Content Source: memdocs/intune/protect/windows-10-expedite-updates.md
- Service: microsoft-intune
- Sub-service: protect
- Technology: ****
- GitHub Login: @Brenduns
- Microsoft Alias: brenduns
@Brenduns Please help us in resolving this issue. Thanks
Checking with PM/Dev if there are recomended alternatives.
@endersstory Thanks for raising this as an issue. I've checked with our developers and we've a pending update for content that will provide a method that doesn’t rely on the Win32_Product. While the current method can be used, it is a bit cranky and isn’t ideal. The new method will replace the current details in the published content later this afternoon, and appears as follows
$Session = New-Object -ComObject Microsoft.Update.Session
$Searcher = $Session.CreateUpdateSearcher()
$historyCount = $Searcher.GetTotalHistoryCount()
$list = $Searcher.QueryHistory(0, $historyCount) | Select-Object -Property "Title"
foreach ($update in $list)
{
if ($update.Title.Contains("4023057"))
{
return 1
}
}
return 0
If the script returns a 1, the device has UHS client. If the script returns a 0, the device doesn’t have UHS client.