cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1964
Views
0
Helpful
2
Replies

Powershell Hash table and "-or" query

kf4ape4067
Level 1
Level 1

So I am using the function DUO gave me and trying to do some “-or” queries for the admin logs…cant get it to work…the parameters are basically a hash table

if I try multiple queries, the throttling kicks in and kills the script…thoughts?

here is an example of the data I am trying to get, and according to the API, I should be able to do an “OR” query…just no clue how

$rawdisableddata = (Invoke-DuoMethod -Ikey $ikey -Skey $skey -host $Uri -Method get -path “/admin/v2/logs/authentication” -Params `
@{mintime=$starttime;maxtime=$stoptime;reasons=“user_disabled”}).response.authlogs

$rawbadpasscodedata = (Invoke-DuoMethod -Ikey $ikey -Skey $skey -host $Uri -Method get -path “/admin/v2/logs/authentication” -Params `
@{mintime=$starttime;maxtime=$stoptime;reasons=“invalid_passcode”}).response.authlogs

$rawnoresponsedata = (Invoke-DuoMethod -Ikey $ikey -Skey $skey -host $Uri -Method get -path “/admin/v2/logs/authentication” -Params `
@{mintime=$starttime;maxtime=$stoptime;reasons=“no_response”}).response.authlogs

$rawnokeypresseddata = (Invoke-DuoMethod -Ikey $ikey -Skey $skey -host $Uri -Method get -path “/admin/v2/logs/authentication” -Params `
@{mintime=$starttime;maxtime=$stoptime;reasons=“no_keys_pressed”}).response.authlogs

2 Replies 2

kabuchan15
Level 1
Level 1

what are you doing this by those script?

kf4ape4067
Level 1
Level 1

I was using this to create automated reporting of events for folks and upstream application…but I needed a way to filter for multiple criteria…while the api would allow it, the hash table the function had did not, so I had to adjust the function a bit…I ended up creating a unique index id for each row…not pretty but works

Quick Links