Force hardware inventory (Full Version)

All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager



Message


Peekstra -> Force hardware inventory (5/6/2008 2:00:18 AM)

After installing an update via WOL during the maintance hours, I would like to force a hardware inventory scan before shutting down the clients.

After some searching I found that you should use cliutils.exe or you could manually start the SMS hardware service when using SMS.

However, cliutils.exe isn't present on the SCCM CD and I couldn't find a sms hardware service so my question is, how can I accomplish this with SCCM?

thanks!


Peek.




phaustein -> RE: Force hardware inventory (5/6/2008 10:17:19 AM)

Run this vbscript after your program has finished and it will force a HW inventory to execute.

' Reset the Hardware Inventory Cache
'ResetInventoryCache "{00000000-0000-0000-0000-000000000001}"

' Kickoff a Hardware Inventory cycle
KickoffClientAction "Hardware Inventory Collection Cycle"

'MsgBox "Hardware Inventory Resync Initiated"


' *******************************************************************
' ResetInventoryCache() - This sub will reset the inventory cache for the specified inventory action
' *******************************************************************
'Sub ResetInventoryCache(sInventoryActionID)

' Get a connection to the "root\ccm\invagt" namespace (where the Inventory agent lives)
' Dim oLocator
' Set oLocator = CreateObject("WbemScripting.SWbemLocator")
' Dim oServices
' Set oServices = oLocator.ConnectServer( , "root\ccm\invagt")
' If isnull (oServices) Then
'code for logging
' Exit Sub
' End if
' Delete the specified InventoryActionStatus instance
' oServices.Delete "InventoryActionStatus.InventoryActionID=""" & sInventoryActionID & """"
'End Sub
' *******************************************************************
' KickoffClientAction() - This sub will kickoff the specified client action
' *******************************************************************
Sub KickoffClientAction(sActionName)
' Create a CPAppletMgr instance
Dim oCPAppletMgr
Set oCPAppletMgr = CreateObject("CPApplet.CPAppletMgr")
' Get the available ClientActions
Dim oClientActions
set oClientActions = oCPAppletMgr.GetClientActions()
' Loop through the available client actions
Dim oClientAction
For Each oClientAction In oClientActions

 ' Is this the action we want to kickoff?
 If oClientAction.Name = sActionName Then
 
  ' Kickoff the action
  oClientAction.PerformAction      
 End If
Next
End Sub




Peekstra -> RE: Force hardware inventory (5/7/2008 4:46:40 AM)

That certainly helps! Thanks!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.21875