Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using REST API to query users | Powershell

User_B65FUApr 21 2021 — edited Apr 22 2021

Afternoon,
I'm trying to exclusively use powershell to query a our users, to get information regarding their accounts (name, last login, enabled, email). and return a .json file.
I'm not a powershell developer and only got so far, my code is below. I would love for someone to help me get the rest of the way.

$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f "USERNAME","PASSWORD")))
$headers= @{Authorization=("Basic {0}" -f $base64AuthInfo)}
Invoke-RestMethod -Uri https://SERVERNAME.oraclecloud.com/hcmRestApi/scim/Users -Headers $headers -ContentType "application/json"
All I'm getting back is a list of 2000+ users on one line under "resources".

Thanks in advance

This post has been answered by Christyxo on Apr 21 2021
Jump to Answer
Comments
Post Details