Skip to main content

Use API to Pull Software Inventory for Every Computer in an Organization


Tony-Automox

Using the standard API call for software packages installed will just give you software installed on a single device referenced by the server ID#. This script will give you software packages installed on every device in an organization referenced by the computer names. By altering the script you can add additional fields - but make sure the Set-Content line reflects all of the fields you add to the Select-Object part of the last line of the script. You’ll also want the Set-Content line to have the fields in the same order as the Select-Object.

 

Available fields can be found here from the Response tab:

https://developer.automox.com/openapi/axconsole/operation/getDevicePackages/

 

View the script on GitHub

 

You can also modify it to do things like not show Windows updates & hotfixes by altering the Where-Object part of the last line of the script. For example:

Where-Object {$.installed -EQ $true -and $.repo -notlike “Windows*”}

 

 

You’ll need to set the following before running the script:

 

 

$apiKey = 'YOUR_API_KEY' - in your console, go to Settings->API and select the API key. Note that the API key is per admin user, so you and another admin in your console will have different API keys.

 

 

$orgID = 'YOUR_ORG_ID' - put in your Org ID which can be found by looking at the URL on the dashboard and selecting the value after the “?o=”: [https://console.automox.com/dashboard?o=1234]. In this example the Org ID is 1234.

 

 

You can also modify $filepath if you want to change the file name or save it in a different location. Keep in mind the script will overwrite a previously generated file if it exists.

 

 

17 replies

  • Novice
  • 8 replies
  • April 1, 2021

@Tony - do you have a script that will pull for a specific software that contains a specific name?


Tony-Automox
  • Author
  • Automox Employee
  • 35 replies
  • April 2, 2021

Forum|alt.badge.img

Hi Tony @Tony , i´m trying to modify the script to not include info about any Intel*, Security update*, Update*, in the report, to try to be more accurate with the software that appear in the installed programs in the control Panel, but for now i can´t figure out a way to exclude that in the Script. For us that would be a good report to present to our clients.


Any help would be appreciated to remove that particular info, and any other from the script.


Regards


  • Rookie
  • 1 reply
  • September 29, 2021

HI Everyone,


Is there a way to incorporate a group ID as well?


We have the requirement to create a software list / audit for certain groups?


Thank you.


Dan


Forum|alt.badge.img
  • Rookie
  • 2 replies
  • August 31, 2022

This is not working.


Forum|alt.badge.img
  • Novice
  • 5 replies
  • September 15, 2022

I’m getting an error on this software inventory.

 

At C:\Program Files (x86)\Automox\execDir043744995\execcmd071137510.ps1:107 char:15
+               | Select-Object @{label=�??Computer�??; Expression= {"$ ...
+               ~
An empty pipe element is not allowed.
At C:\Program Files (x86)\Automox\execDir043744995\execcmd071137510.ps1:109 char:15
+               | Sort-Object Display_Name | Export-Csv -Path $filepath ...
+               ~
An empty pipe element is not allowed.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : EmptyPipeElement
 

COMMAND TIMED OUT.


  • Rookie
  • 3 replies
  • January 17, 2023

same error for me any one fixed it?


Forum|alt.badge.img
  • Novice
  • 7 replies
  • January 18, 2023

@rasejo @Shasan This powershell script is meant to run from your workstation not as a worklet. You need to plug in your api and org key explained by Tony. 


  • Rookie
  • 3 replies
  • February 15, 2023
avicario wrote:

@rasejo @Shasan This powershell script is meant to run from your workstation not as a worklet. You need to plug in your api and org key explained by Tony. 

Just ran this from my workstation using an admin powershell window. Same error. Opening it in the Powershell ISE, I see it reports the same error at both pipe symbols on lines 107 and 109. Not really sure what to do about it, though.


  • Rookie
  • 3 replies
  • February 15, 2023
avicario wrote:

@rasejo @Shasan This powershell script is meant to run from your workstation not as a worklet. You need to plug in your api and org key explained by Tony. 

yes i know, and i am running it from powershell not worklet. im getting error


Forum|alt.badge.img
  • Novice
  • 6 replies
  • August 18, 2023

The CSV is blank. Just Computer,display_name,version at the top.

 

Any suggestions?


AnthonyM-Automox

@ahjw , @Shasan and @ArcherFX 

 

I’ve just performed a top-down rework of this script to address some API changes and infuse a bit more clear error detail.

 

The original post above has been updated with this new script.

 

Let me know if anyone has questions.

 

Thanks!

 

- Anthony M.


Hi, is there a way to add “install date” to this script? what would the “column headers” for installed date?

 

Thanks

Steve


  • Novice
  • 9 replies
  • September 20, 2023
Steve.Bishop wrote:

Hi, is there a way to add “install date” to this script? what would the “column headers” for installed date?

 

Thanks

Steve

Hey Steve, I’m not sure you can with that API. You can get the date created, but that’s the date at which the patch is found.

A bit off-topic from the original post, but I’ve been using the data-extracts API with the “patch-history” type, which gives you the patch available and patch installed times for the past [x] days, which I can then cross reference against the server/package list through the Automox ID and package ID. If you can import the data extracts into a database or other log analysis type tool, you can build a view of patch lifecycles across your fleet.

All the data is coming out of Automox so there might also be another console view or report somewhere already that has this information that I haven’t come across,

Ed


Edward wrote:
Steve.Bishop wrote:

Hi, is there a way to add “install date” to this script? what would the “column headers” for installed date?

 

Thanks

Steve

Hey Steve, I’m not sure you can with that API. You can get the date created, but that’s the date at which the patch is found.

A bit off-topic from the original post, but I’ve been using the data-extracts API with the “patch-history” type, which gives you the patch available and patch installed times for the past [x] days, which I can then cross reference against the server/package list through the Automox ID and package ID. If you can import the data extracts into a database or other log analysis type tool, you can build a view of patch lifecycles across your fleet.

All the data is coming out of Automox so there might also be another console view or report somewhere already that has this information that I haven’t come across,

Ed

Thanks Ed, I was more looking “install date” on all software. Keeping track of unproved software that shouldn’t be installed. 

 


AnthonyM-Automox

@Steve.Bishop 

 

Hey Steve!

 

Sorry for the delay on this one. The script has been re-homed to GitHub for proper versioning support and you can find the latest version ( including Install Date ) over here.

 

Let me know if you have any questions.

 

Thanks!

 

Anthony M.

 


  • Novice
  • 9 replies
  • September 21, 2023

 

Steve.Bishop wrote:
Edward wrote:
Steve.Bishop wrote:

Hi, is there a way to add “install date” to this script? what would the “column headers” for installed date?

 

Thanks

Steve

Hey Steve, I’m not sure you can with that API. You can get the date created, but that’s the date at which the patch is found.

A bit off-topic from the original post, but I’ve been using the data-extracts API with the “patch-history” type, which gives you the patch available and patch installed times for the past [x] days, which I can then cross reference against the server/package list through the Automox ID and package ID. If you can import the data extracts into a database or other log analysis type tool, you can build a view of patch lifecycles across your fleet.

All the data is coming out of Automox so there might also be another console view or report somewhere already that has this information that I haven’t come across,

Ed

Thanks Ed, I was more looking “install date” on all software. Keeping track of unproved software that shouldn’t be installed. 

 

Yeah okay, “$package.create_time” is date it is found, so for something unapproved installed outside of Automox it would be the install date, but for anything patched through Automox, it will be the date that the package/update was found ready to be applied, not installed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings