Where to find information on exporting KACE Inventory information to other data applications?
Where can I find information on exporting asset information such as Inventory IDs to other databases?
Answers (1)
You can use reporting to generate and email reports as CSV file or such.
You can use the API to pull.
You would need to see how your external applications can work with the rest api stuff.
and https://support.quest.com/kb/4288264/verifying-api-connection-with-postman
I am using KaceSMA to make it easier.
https://www.powershellgallery.com/packages/KaceSMA/2.0.1
https://github.com/ArtisanByteCrafter/KaceSMA/wiki
..but after Kace 12.0 you will need to edit one of his files.
C:\Program Files\WindowsPowerShell\Modules\KaceSMA\2.0.1\public\Connect-Server.ps1
I remarked the x-dell-api-version line and added the kace one.
#$script:Headers.Add('x-dell-api-version', '8')
$script:Headers.Add('x-kace-api-version', '12')
I also had to change the CSRF return from:
#$script:CSRFToken = $Request.Headers.'x-dell-csrf-token'
#$script:Headers.Add("x-dell-csrf-token", "$script:CSRFToken")
to :
If ($Request.Headers.'x-kace-authorization' -ne $null){
$script:CSRFToken = $Request.Headers.'x-kace-authorization'
$script:Headers.Add("x-kace-csrf-token", "$script:CSRFToken")
#'Kace Authorization found as: '+$script:CSRFToken
}
In my testing environment, I also found that I needed this for a self-signed server...but maybe it wasn't this....as I later found that I needed to run the commands very near each other in time.
# This next line was added for self-signed server
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
I use these variables to keep things easier:
$Cred = Get-Credential
$KBOX = [KACE SERVER URL]
$Org = ['Default' or ORG NAME]
As a last item of note, for me I need to connect and run the command within a short period of time, so I put the lines together.
Connect-SmaServer -Server $KBOX -Org $Org -Credential $Cred -Verbose;Get-SMAMachineInventory -QueryParameters '?shaping=machine limited&paging=limit ALL' | Tee-Object -Variable Test
The resulting variable named test can be shown as a list or table as normal $Test | FT
I use the Custom Inventory Rules (extensively) to add/pull information such as the Intune Device ID. I can then pull a list of the device that has that ID/item.
Connect-SmaServer -Server $KBOX -Org $Org -Credential $Cred -Verbose;Get-SMAMachineInventory -QueryParameters '?filtering=Machine_Custom_Inventory.Str_Field_Value co [Intune Device ID]' | Tee-Object -Variable Test
Use shaping to limit the return if desired:
Connect-SmaServer -Server $KBOX -Org $Org -Credential $Cred -Verbose;Get-SMAMachineInventory -QueryParameters '?shaping=machine limited&filtering=Machine_Custom_Inventory.Str_Field_Value co [SOME IDENTIFIER IN CIR]' | Tee-Object -Variable Test
As per Nathaniel Webb ArtisanByteCrafter: "By default, the SMA API limits queries to 50 results. To override this, use the string ?paging=limit XX in your -QueryParameters, where XX is the limit you want. Use ALL for all results."
I will be making some actions and such to use these.
I haven't yet included using a SAML account or the MFA...just haven't gotten to it...but I will.