<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: users via API in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/72330#M4301</link>
    <description>&lt;P&gt;Would anyone happen to have a script that would list all users and all groups with users?&amp;nbsp; We have a client that requests a list of users and groups every month.&amp;nbsp; I was able to use this script to get the groups individually and then merged the txt files into an Excel spreadsheet, but would like to avoid that last step if at all possible.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2020 15:32:48 GMT</pubDate>
    <dc:creator>Karen_Askelson</dc:creator>
    <dc:date>2020-01-15T15:32:48Z</dc:date>
    <item>
      <title>users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13578#M950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;BR /&gt;I would like to ask if there are some plans to include handling users via API in future releases (local account creation, certificate generation, etc.)? Now there is no such possibility via API and I think it could be very handy when migrating from different platforms&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx for info&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 14:12:07 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13578#M950</guid>
      <dc:creator>Ivo_Hrbacek</dc:creator>
      <dc:date>2017-11-20T14:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13579#M951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivo,&lt;/P&gt;&lt;P&gt;Yes, there are plans to support User objects via API.&lt;/P&gt;&lt;P&gt;Unfortunately, I cannot provide estimations for release version/date at this moment.&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 14:55:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13579#M951</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2017-11-20T14:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13580#M952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is also a feature&amp;nbsp;I would like. Is there any update on when it may be included?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 12:29:51 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13580#M952</guid>
      <dc:creator>Paul_Melinn</dc:creator>
      <dc:date>2018-05-01T12:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13581#M953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;Our R&amp;amp;D is working to provide full support for users creation with a standard API commands.&lt;/P&gt;&lt;P&gt;Meanwhile, you can use this thread to create users with a non-standard approach -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.checkpoint.com/docs/DOC-2844"&gt;https://community.checkpoint.com/docs/DOC-2844&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 12:34:38 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13581#M953</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2018-05-01T12:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13582#M954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Robert, appreciate the speedy response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have an audit requirement to send a list of&amp;nbsp; users that are contained within a specific user group monthly. It sounds like an easy request but so far I am failing.&amp;nbsp; I'm no API / JSON expert by the way.&amp;nbsp; Do you know if&amp;nbsp;there's a simple way to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 12:56:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13582#M954</guid>
      <dc:creator>Paul_Melinn</dc:creator>
      <dc:date>2018-05-01T12:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13583#M955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This bash script expects an users group name as its parameter, and creates a &lt;STRONG&gt;text file&lt;/STRONG&gt; with this name containing all users names -&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;JQ=${CPDIR}/jq/jq&lt;BR /&gt;&lt;BR /&gt;GROUP_NAME=$1&lt;BR /&gt;USERS_FILE="users.json"&lt;BR /&gt;USER_FILE="user.json"&lt;BR /&gt;USER_NAMES_FILE="$GROUP_NAME.txt"&lt;BR /&gt;&lt;BR /&gt;&amp;gt; $USER_NAMES_FILE&lt;BR /&gt;&lt;BR /&gt;mgmt_cli -r true show generic-objects name $GROUP_NAME details-level full -f json &amp;gt; $USERS_FILE&lt;BR /&gt;if [ $? -ne 1 ]; then&lt;BR /&gt;&amp;nbsp; USERS_UIDS=($($JQ -r '.objects[] | .emptyFieldName[] | .' $USERS_FILE))&lt;BR /&gt;&amp;nbsp; for USER_UID in ${USERS_UIDS[@]}; do&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo 'User UID: '"$USER_UID"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mgmt_cli -r true show generic-object uid $USER_UID -f json &amp;gt; $USER_FILE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if [ $? -ne 1 ]; then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USER_NAME=($($JQ -r '.name' $USER_FILE))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo 'User Name: '"$USER_NAME"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $USER_NAME &amp;gt;&amp;gt; $USER_NAMES_FILE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fi&lt;BR /&gt;&amp;nbsp; done&lt;BR /&gt;fi&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should run it on your management server.&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 13:24:59 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13583#M955</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2018-05-01T13:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13584#M956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again Robert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took the script. Copied it onto my Mgt Server (/home/admin). Renamed it as Users_in_group.sh&amp;nbsp; .&amp;nbsp; Did a chmod to allow for execution (777).&lt;/P&gt;&lt;P&gt;In expert mode ran as "./Users_in_group.sh&amp;nbsp;&amp;nbsp;Our-Group-name-var"&lt;/P&gt;&lt;P&gt;And got "/Users_in_group: cannot execute binary file" error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Excuse my lack of knowledge here but am I doing something wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 14:39:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13584#M956</guid>
      <dc:creator>Paul_Melinn</dc:creator>
      <dc:date>2018-05-01T14:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13585#M957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;run dos2unix on it before the execution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2018 14:46:19 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13585#M957</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2018-05-01T14:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13586#M958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apologies Robert - I was offsite the least week.&amp;nbsp; I tried it there and it's working for me a treat. Thanks so much for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2018 15:25:30 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13586#M958</guid>
      <dc:creator>Paul_Melinn</dc:creator>
      <dc:date>2018-05-11T15:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13587#M959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more thing Robert - It runs fine from the command line as admin.&amp;nbsp; When I try to schedule the command via job scheduler on GAIA www&amp;nbsp;GUI it gives me the following errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp; It's the same user running the same command in both cases.&amp;nbsp; Maybe it's shell related?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The scheduled job is to run this command (your script is called Usergplist.sh)&lt;/P&gt;&lt;P&gt;&amp;nbsp;./Usergplist.sh treas_users&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The job fails with the following output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: medium;"&gt;./Usergplist.sh: line 12: mgmt_cli: command not found&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: medium;"&gt;./Usergplist.sh: line 14: /jq/jq: No such file or directory&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2018 16:19:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13587#M959</guid>
      <dc:creator>Paul_Melinn</dc:creator>
      <dc:date>2018-05-11T16:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13588#M960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you apply the chmod 777 on the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2018 19:31:15 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13588#M960</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2018-05-11T19:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13589#M961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert&lt;/P&gt;&lt;P&gt;Yes I did. The script works fine directly from SSH command line. It only fails, as above, via job scheduler on Web Interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The job scheduler command syntax is also exactly the same via SSH command line and Web interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 May 2018 07:18:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13589#M961</guid>
      <dc:creator>Paul_Melinn</dc:creator>
      <dc:date>2018-05-13T07:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13590#M962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;I've no idea how the job scheduler works.&lt;/P&gt;&lt;P&gt;Maybe &lt;A href="https://community.checkpoint.com/migrated-users/2075"&gt;Dameon Welch Abernathy&lt;/A&gt;‌ can assist here.&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 May 2018 08:20:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13590#M962</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2018-05-13T08:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13591#M963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's because&amp;nbsp;certain environment variables aren't set when you run via cron/job scheduler that ARE set when run from the CLI.&lt;/P&gt;&lt;P&gt;From the above:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;mgmt_cli isn't in the command execution path (replace with /opt/CPshrd-R80/bin/mgmt_cli)&lt;/LI&gt;&lt;LI&gt;$CPDIR isn't defined (replace with /opt/CPshrd-R80)&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 May 2018 13:54:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13591#M963</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2018-05-13T13:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13592#M964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dameon&amp;nbsp; &amp;amp; &lt;A href="https://community.checkpoint.com/migrated-users/47511"&gt;Robert Decker&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have now modified the script as below but am now getting a different error. I don't even see how this shared library is being called by the script. Reckon this is hopefully the last hurdle!&lt;/P&gt;&lt;P&gt;Just to confirm, the script still runs fine from CLI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error from Job scheduler:&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt;"&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: medium;"&gt;/opt/CPshrd-R80/bin/mgmt_cli: error while loading shared libraries: libmgmt_cli_utils.so: cannot open shared object file: No such file or directory&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adjusted script:&lt;/P&gt;&lt;P&gt;#!/bin/sh&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;JQ=/opt/CPshrd-R80/jq/jq&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;GROUP_NAME=$1&lt;/P&gt;&lt;P&gt;USERS_FILE="users.json"&lt;/P&gt;&lt;P&gt;USER_FILE="user.json"&lt;/P&gt;&lt;P&gt;USER_NAMES_FILE="$GROUP_NAME.txt"&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&amp;gt; $USER_NAMES_FILE&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;/opt/CPshrd-R80/bin/mgmt_cli -r true show generic-objects name $GROUP_NAME details-level full -f json &amp;gt; $USERS_FILE&lt;/P&gt;&lt;P&gt;if [ $? -ne 1 ]; then&lt;/P&gt;&lt;P&gt;USERS_UIDS=($($JQ -r '.objects[] | .emptyFieldName[] | .' $USERS_FILE))&lt;/P&gt;&lt;P&gt;for USER_UID in ${USERS_UIDS[@]}; do&lt;/P&gt;&lt;P&gt;echo 'User UID: '"$USER_UID"&lt;/P&gt;&lt;P&gt;/opt/CPshrd-R80/bin/mgmt_cli -r true show generic-object uid $USER_UID -f json &amp;gt; $USER_FILE&lt;/P&gt;&lt;P&gt;if [ $? -ne 1 ]; then&lt;/P&gt;&lt;P&gt;USER_NAME=($($JQ -r '.name' $USER_FILE))&lt;/P&gt;&lt;P&gt;echo 'User Name: '"$USER_NAME"&lt;/P&gt;&lt;P&gt;echo $USER_NAME &amp;gt;&amp;gt; $USER_NAMES_FILE&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;P&gt;done&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2018 10:15:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13592#M964</guid>
      <dc:creator>Paul_Melinn</dc:creator>
      <dc:date>2018-05-14T10:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13593#M965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;The&amp;nbsp;libmgmt_cli_utils.so library is used &lt;STRONG&gt;internally&lt;/STRONG&gt; by mgmt_cli tool.&lt;/P&gt;&lt;P&gt;It is located in - "/opt/CPshrd-R80/lib" folder. You have to reference this folder too in your command execution path.&lt;/P&gt;&lt;P&gt;Robert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2018 10:24:41 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13593#M965</guid>
      <dc:creator>Robert_Decker</dc:creator>
      <dc:date>2018-05-14T10:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13594#M966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have played around with this for a while with no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this what you mean below?&amp;nbsp; I doubt it...&amp;nbsp; it doesn't look right to me and I'm&amp;nbsp;a&amp;nbsp;complete novice. &amp;nbsp;If so - it's still failing with the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry about this - how should the "/opt/CPshrd-R80/lib/" be included in the command execution path?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#!/bin/sh&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;JQ=/opt/CPshrd-R80/jq/jq&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;GROUP_NAME=$1&lt;/P&gt;&lt;P&gt;USERS_FILE="users.json"&lt;/P&gt;&lt;P&gt;USER_FILE="user.json"&lt;/P&gt;&lt;P&gt;USER_NAMES_FILE="$GROUP_NAME.txt"&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&amp;gt; $USER_NAMES_FILE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;　&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/opt/CPshrd-R80/bin/mgmt_cli -r true show /opt/CPshrd-R80/lib/generic-objects name $GROUP_NAME details-level full -f json &amp;gt; $USERS_FILE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if [ $? -ne 1 ]; then&lt;/P&gt;&lt;P&gt;USERS_UIDS=($($JQ -r '.objects[] | .emptyFieldName[] | .' $USERS_FILE))&lt;/P&gt;&lt;P&gt;for USER_UID in ${USERS_UIDS[@]}; do&lt;/P&gt;&lt;P&gt;echo 'User UID: '"$USER_UID"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/opt/CPshrd-R80/bin/mgmt_cli -r true show /opt/CPshrd-R80/lib/generic-object uid $USER_UID -f json &amp;gt; $USER_FILE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if [ $? -ne 1 ]; then&lt;/P&gt;&lt;P&gt;USER_NAME=($($JQ -r '.name' $USER_FILE))&lt;/P&gt;&lt;P&gt;echo 'User Name: '"$USER_NAME"&lt;/P&gt;&lt;P&gt;echo $USER_NAME &amp;gt;&amp;gt; $USER_NAMES_FILE&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;P&gt;done&lt;/P&gt;&lt;P&gt;fi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2018 14:57:39 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13594#M966</guid>
      <dc:creator>Paul_Melinn</dc:creator>
      <dc:date>2018-05-14T14:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13595#M967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your script, include the following line before any commands are executed:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;source&amp;nbsp;&lt;SPAN class=""&gt;/opt/CPshrd-R80/tmp/.CPprofile.sh&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN class=""&gt;This should set all the necessary variables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;(Note this may need to be changed after major upgrades)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;Then you can do the mgmt_cli commands without paths (e.g.&amp;nbsp;&lt;STRONG style="color: #333333; background-color: #ffffff; border: 0px; font-weight: bold; font-size: 14px;"&gt;mgmt_cli -r true show generic-objects name $GROUP_NAME details-level full -f json &amp;gt; $USERS_FILE&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2018 15:47:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13595#M967</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2018-05-14T15:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13596#M968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dameon - that's a very useful command. All working now.&amp;nbsp; Thanks for all you help ( &amp;amp; Robert too).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2018 09:59:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13596#M968</guid>
      <dc:creator>Paul_Melinn</dc:creator>
      <dc:date>2018-05-15T09:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: users via API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13597#M969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for this! I hit the same well getting a script to run &amp;amp; found this point. Problem solved!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2018 14:27:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/users-via-API/m-p/13597#M969</guid>
      <dc:creator>Daniel_Taney</dc:creator>
      <dc:date>2018-11-02T14:27:42Z</dc:date>
    </item>
  </channel>
</rss>

