Posted in: All Posts, MEMCM/SCCM, Scripts/Tools, Windows 10

Quick and Dirty Scripting – Invoke Full Hardware Scan

One of the issues I have struggled with in my SCCM/MECM environment is getting devices to report back a full hardware inventory. Running the Hardware Inventory from Client Notification, as well as running it from the Right Click Tools was ineffective. I put together a little script to ensure a full inventory scan is effectively kicked off. I call it Invoke-FullHardwareInventory.

Get-WmiObject -Namespace root\ccm\invagt -Class inventoryactionstatus | Where-Object {$_.inventoryactionid -eq "{00000000-0000-0000-0000-000000000001}"} | Remove-WmiObject
Invoke-WMIMethod -Namespace root\ccm -Class SMS_CLIENT -Name TriggerSchedule "{00000000-0000-0000-0000-000000000001}"

Again, this is one of those things I prefer to run as a Script from the SCCM/MEMCM console, but it could just as easily be packaged for deployment by running the below command as a batch.

Powershell.exe -ExecutionPolicy bypass -File "Invoke-FullHardwareInventory.ps1"
exit /b %errorlevel%

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.