Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

initiating inventory - out of the schedule

Status
Not open for further replies.

enginefs

IS-IT--Management
Nov 28, 2006
5
0
0
IL
Hi,
I'm trying to find how can I initiate a hardware inventory out of the scheduled inventories.
After I deploy a security patch, I want the SMS client to initiate inventory so that the SMS server will hold the updated information about the status of the client.
The best solution for me is a command line command that will initiate the inventory.
Any ideas?
 
I am familiar with the program you suggested, but this is not my desire.
I wish to write my own script that inventories the SMS client.
I don't want to install any additional programs to my SMS server.
Do you know another way to remotely inventory the client?
 
Robert Mahl? wrote this I think:

##### copy below to text file fullhinv.vbs #####

' 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"

wscript.quit


' *******************************************************************
' 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" )

' 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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top