gabrielsroka / gabrielsroka.github.io

My website, including rockstar: Export Okta Users, Groups, etc. to CSV. Show SAML assertion.
https://gabrielsroka.github.io/
MIT License
92 stars 37 forks source link

Feature Request - Include Group Owners in Group Export #74

Open cslagel opened 2 months ago

cslagel commented 2 months ago

We use group owners as approvers for access requests with Okta IGA. Being able to dump the groups and see who the approvers are for all of them would be immensely helpful! Thank you!

gabrielsroka commented 2 months ago

this should work. it uses https://gabrielsroka.github.io/console

i posted it on macadmins Slack: https://macadmins.slack.com/archives/C0LFP9CP6/p1720785144938999?thread_ts=1720772301.545799&cid=C0LFP9CP6

// Export groups and their owners using https://gabrielsroka.github.io/console

limit = 15 // Try 15, 35, or 75 for the limit, depending on the org.
// see https://developer.okta.com/docs/reference/rl-additional-limits/#concurrent-rate-limits

url = '/api/v1/groups?limit=' + limit
log('id,name,owners')
promises = []
for await (group of getObjects(url)) {
  promises.push(getOwners(group))
  if (cancel) break
}
await Promise.all(promises) // Wait until all calls are finished before downloading CSV.
downloadCSV(debug.value, 'groups')

async function getOwners(group) {
  owners = await getJson(`/api/v1/groups/${group.id}/owners`)
  log(toCSV(group.id, group.profile.name, owners.map(o => o.displayName).join('; ')))
}