Using PowerShell to Query ABR

Introduction

The Admin By Request API allows you to get the necessary data into your preferred SIEM system. This blog covers how to test functionality and get data from Admin By Request using Windows PowerShell.

IMPORTANT

In order to use Invoke-RestMethods cmdlets used during this task, you need to be running Windows PowerShell version 3.0 or higher.

Procedure

There are five tasks involved:

NOTE

To output the data to a TXT or CSV file for further aggregation, simply add >> filename to the end of the command. For example:

Invoke-Restmethod -uri $auditlog -header $header -Method GET >> auditlog.txt

Voila! You have now successfully used Windows PowerShell to get inventory and auditlog data written to screen or file.

This procedure was created with the assistance of Mads Christian Mozart Johansen.