• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

AutoIT Installed Software list - Ps + WMI + SCCM

Status
Not open for further replies.

DDoSer

The Real DDoSer
User
Joined
Oct 9, 2013
Messages
352
Reputation
0
Reaction score
4,578
Points
243
Credits
0
‎11 Years of Service‎
51%
[HIDE-THANKS]Short Version: Grouped by Program

Code:
>#RequireAdmin
#include

$iPid = run("powershell (Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | fl ProductName,InstallDate,InstalledLocation,ProductVersion,UninstallString | out-string).trim()", "" , @SW_HIDE , 0x2)

$sOutput = ""

While ProcessExists($iPid)
       $sOutput &= StdoutRead($iPID)
WEnd

$aOutput = stringsplit($sOutput, @LF , 2)
_ArrayDisplay($aOutput)
Long Version: Each Category in its own column, modular pieces.

Code:
>;CIMClasses
#include
#RequireAdmin

$iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select ProductName" , "" , @SW_HIDE , 0x2)

$sOutput = ""

While 1
       $sOutput &= StdoutRead($iPID)
       If @error Then
           ExitLoop
       EndIf
   WEnd

$aProductName = stringsplit($sOutput , @CR , 2)


;;;;;-------------------------------------------

$iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select InstallDate" , "" , @SW_HIDE , 0x2)

$sOutput = ""

While 1
       $sOutput &= StdoutRead($iPID)
       If @error Then
           ExitLoop
       EndIf
   WEnd

$aInstallDate = stringsplit($sOutput , @CR , 2)

;;;;;-------------------------------------------


$iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select InstalledLocation" , "" , @SW_HIDE , 0x2)

$sOutput = ""

While 1
       $sOutput &= StdoutRead($iPID)
       If @error Then
           ExitLoop
       EndIf
   WEnd

$aInstalledLocation = stringsplit($sOutput , @CR , 2)

;;;;;-------------------------------------------

$iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select ProductVersion" , "" , @SW_HIDE , 0x2)

$sOutput = ""

While 1
       $sOutput &= StdoutRead($iPID)
       If @error Then
           ExitLoop
       EndIf
   WEnd

$aProductVersion = stringsplit($sOutput , @CR , 2)

;;;;;-------------------------------------------

$iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select UninstallString" , "" , @SW_HIDE , 0x2)

$sOutput = ""

While 1
       $sOutput &= StdoutRead($iPID)
       If @error Then
           ExitLoop
       EndIf
   WEnd

$aUninstallString = stringsplit($sOutput , @CR , 2)

;;;;;-------------------------------------------


Local $aOut[ubound($aProductName)][5]

For $i = 0 to ubound($aProductName) - 1
   $aOut[$i][0] = $aProductName[$i]
   $aOut[$i][1] = $aInstallDate[$i]
   $aOut[$i][2] = $aInstalledLocation[$i]
   $aOut[$i][3] = $aProductVersion[$i]
   $aOut[$i][4] = $aUninstallString[$i]
Next

_ArrayDisplay($aOut , "SMS Installed Software")
[/HIDE-THANKS]

 
Status
Not open for further replies.
Back
Top