Using SCCM Client center Hardware Inventory for multiple machines


Description:

This script will use the sccm client center by Roger Zander for running Hardware inventory on Multiple machines.

Requirements:

  • Windows powershell 3.0 and above
  • smsclictr.automation.DLL from sccm client center.

Tested on

  • Window 10
  • Windows 7

Script

Import-Module "C:\Users\3RDP-ADMN-Modhurima\Desktop\SCCM Client Center 2 NEW\smsclictr.automation.DLL"

$computers= get-content "C:\Users\3RDP-ADMN-Modhurima\Desktop\comp.txt"

Function HWInv_Full($comp){

$SCCMClient = New-Object -TypeName smsclictr.automation.SMSClient($comp)

$SCCMClient.schedules.HardwareInventory($true)

}

foreach($comp in $computers){

    if ((Test-Connection $comp -Count 1 -Quiet) -eq $true){

        HWInv_Full($comp)

}

}

Same script has been uploaded in Github