Hello Team!
We had a task to upload the list of users for viewing in MS Excel via API.
The following form :
name, comment, expiration date, what groups are members of
It took me some time to find the right syntax, and I'd like to share it with you.
I'd be very happy if someone could use it.
For 80.40 version It looks like this:
mgmt_cli --port 4434 -r true show-users details-level full --format json | jq '.objects[] | [.name, ."comments", getpath(["expiration-date","iso-8601"]), ."groups"[].name] |@csv' -r
For 81.10:
mgmt_cli --port 4434 -r true show-users details-level full --format json show-membership "true" | jq '.objects[] | [.name, ."comments", getpath(["expiration-date","iso-8601"]), ."groups"[].name] |@csv' -r
That's what helped me:
https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-users~v1.6.1%20
https://jqlang.github.io/jq/manual/