Like Powershell? Like KACE? If you're like me, you've noticed the KACE API sitting out there in right field, waiting on someone to hit a long fly. It's fantastic, but the barrier-to-entry might be a little daunting if you're unfamiliar with APIs.

I've written a small pet project called KaceSMA, a light weight SMA Powershell module that you can install on Windows,Mac,or Linux (mac/linux via PSCore). What it does is it essentially wraps the API in a Powershell compatibility layer and returns objects in a easy to digest format for all your automation needs. How do you use it you ask?

[edit] Updated way to install:

From an elevated PS shell:

Install-Module KaceSMA


Here's some basic examples of what you can do, along with the code to do it:


  • Return Machines with Encryption status of "Fully Encrypted"
  • Return SMA inventory machines with title 'Arduino' installed
  • Return all inventory members of smart label named "D - SmartLabel - Test"
  • Find the registry uninstall strings of all Software Inventory VMWare products
The only limit is really your API parameter creativity.

I expose the following Functions for use (today). You'll notice they're all read-only (GET method) requests. I don't have a non-production database to test some of the other API calls :p

(Get-Command -Module KaceSMA).name
Get-SmaAgentlessInventory
Get-SmaAsset
Get-SmaAssetType
Get-SmaBarcodeAsset
Get-SmaMachineInventory
Get-SmaMachineProcess
Get-SmaMachineService
Get-SmaOperatingSystemInventory
Get-SmaSoftwareInventory
Get-SmaStartupProgramInventory
Get-SmaUserAccount
Get-SmaUserPermissions


This isn't an exhaustive list of the API, there are a few I'm not exposing yet due to bugs on the SMA API end (dutifully ticketed and tracked already via support request with Quest), namely the Managed Install endpoint. If anyone has a request for a GET method that isn't covered, let me know- or submit a Pull Request!


Right now, installation involves cloning the repo, and importing the .psd1 file, but I will very soon publish to the Powershell Gallery. I wanted to gather any feedback here first.


Here's an output if a simple asset retrieval:

BB3tPM.png


Thanks, and happy coding!

Nathaniel Webb (isudothings)