SCCM - Inventaire matériel avec VBS & Powershell

Publié le par Charlie

Séquence Powershell et son équivalent en Script VBS pour exécuter un inventaire matériel sur un client SCCM.

 

Remarque : Ces séquences fonctionnent avec la version 32 Bits de cscript.exe et de PowerShell.

 

1. Séquence PowerShell
--------------------------------------------------------------------------------
# Séquence n° 1

((New-Object -ComObject "CPApplet.CPAppletMgr").GetClientActions() |
  ? {$_.Name -eq 'Hardware Inventory Collection Cycle'}).PerformAction()
--------------------------------------------------------------------------------

 

2. Script VBS
--------------------------------------------------------------------------------
# Séquence n° 2

Set SCCMControlPanel = CreateObject("CPApplet.CPAppletMgr")

Set Actions = SCCMControlPanel.GetClientActions

For Each Action in Actions
  If Action.Name = "Hardware Inventory Collection Cycle" Then Action.PerformAction
Next
--------------------------------------------------------------------------------

 

 

Publié dans SCCM - PowerShell

Pour être informé des derniers articles, inscrivez vous :
Commenter cet article