Wednesday, July 31, 2019

Power-Shell script to delete the Hardware Inventory queue in client machine if it's stuck

If you see Inventoryagent.log says Hardware inventory already in queue and nothing running in inventory agent


$Computername = 'machinename'
$query = "SELECT * FROM InventoryActionStatus WHERE InventoryActionID='{00000000-0000-0000-0000-000000000001}'"
$hwint = Get-WmiObject -Query $query -ComputerName $Computername -Namespace "root\ccm\invagt"
$hwint.Delete()


No comments:

Post a Comment

Adding devices to SCCM collection using query method

  Overview   The "Add Machines to Collection" tool is a simple, user-friendly UI-based solution designed to quickly add machines...