Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Nadezhda
Contributor
Jump to solution

Download the list of users for viewing in MS Excel via API

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/

 

 

0 Kudos
1 Solution

Accepted Solutions
PhoneBoy
Admin
Admin

Note this command will only work if you have a small number of users locally defined.
For larger user databases, you will need to make multiple calls using the limit/offset parameters to get the next set of results returned by the API.

View solution in original post

0 Kudos
(1)
1 Reply
PhoneBoy
Admin
Admin

Note this command will only work if you have a small number of users locally defined.
For larger user databases, you will need to make multiple calls using the limit/offset parameters to get the next set of results returned by the API.

0 Kudos
(1)

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events