<?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: Unable to add administrators via mgmt_cli in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225714#M8777</link>
    <description>&lt;P&gt;The domain is only relevant on and is specified as part of the login call.&lt;BR /&gt;In all other cases, the session ID is sufficient.&lt;BR /&gt;In this case, I am piping the output out the login call to sid.txt so it can be read by subsequent calls (-s sid.txt).&lt;BR /&gt;Using the CSV file you provided, the following commands worked on my system:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;mgmt_cli -r true -s 'System Data' &amp;gt; sid.txt&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;mgmt_cli -s sid.txt&amp;nbsp;add administrator -b admins.csv&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;mgmt_cli -s sid.txt publish&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The publish is required for committing any changes made through the API.&lt;BR /&gt;Otherwise, the changes will be locked in the created session until it is published or discarded.&lt;BR /&gt;Here is the result the API provided when I queried the user:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;[Expert@R82-EA1:0]# &lt;STRONG&gt;mgmt_cli -s sid.txt show administrator name sayooj --format json&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;  "uid" : "1bb02495-4e3e-4c0e-9660-e2bc52224d5a",&lt;BR /&gt;  "name" : "sayooj",&lt;BR /&gt;  "type" : "administrator",&lt;BR /&gt;  "domain" : {&lt;BR /&gt;    "uid" : "a0eebc99-afed-4ef8-bb6d-fedfedfedfed",&lt;BR /&gt;    "name" : "System Data",&lt;BR /&gt;    "domain-type" : "mds"&lt;BR /&gt;  },&lt;BR /&gt;  "email" : "",&lt;BR /&gt;  "phone-number" : "",&lt;BR /&gt;  "authentication-method" : "check point password",&lt;BR /&gt;  "must-change-password" : true,&lt;BR /&gt;  "permissions-profile" : {&lt;BR /&gt;  "uid" : "ff2c8363-eedd-4d06-a140-a2ede779f09e",&lt;BR /&gt;  "name" : "Super User",&lt;BR /&gt;  "type" : "domain-permissions-profile",&lt;BR /&gt;  "domain" : {&lt;BR /&gt;    "uid" : "a0bbbc99-adef-4ef8-bb6d-defdefdefdef",&lt;BR /&gt;    "name" : "Check Point Data",&lt;BR /&gt;    "domain-type" : "data domain"&lt;BR /&gt;  },&lt;BR /&gt;  "icon" : "General/Role",&lt;BR /&gt;  "color" : "black"&lt;BR /&gt;},&lt;BR /&gt;"sic-name" : "",&lt;BR /&gt;"comments" : "",&lt;BR /&gt;"color" : "black",&lt;BR /&gt;"icon" : "General/Administrator",&lt;BR /&gt;"tags" : [ ],&lt;BR /&gt;"meta-info" : {&lt;BR /&gt;  "lock" : "unlocked",&lt;BR /&gt;  "validation-state" : "ok",&lt;BR /&gt;  "last-modify-time" : {&lt;BR /&gt;    "posix" : 1725486662429,&lt;BR /&gt;    "iso-8601" : "2024-09-04T16:51-0500"&lt;BR /&gt;  },&lt;BR /&gt;  "last-modifier" : "WEB_API",&lt;BR /&gt;  "creation-time" : {&lt;BR /&gt;    "posix" : 1725486662429,&lt;BR /&gt;    "iso-8601" : "2024-09-04T16:51-0500"&lt;BR /&gt;  },&lt;BR /&gt;  "creator" : "WEB_API"&lt;BR /&gt;},&lt;BR /&gt;"read-only" : false,&lt;BR /&gt;"available-actions" : {&lt;BR /&gt;  "edit" : "true",&lt;BR /&gt;  "delete" : "true",&lt;BR /&gt;  "clone" : "true"&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;[Expert@R82-EA1:0]# &lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2024 22:07:50 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2024-09-04T22:07:50Z</dc:date>
    <item>
      <title>Unable to add administrators via mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225556#M8772</link>
      <description>&lt;P&gt;Dear Checkmates,&lt;/P&gt;&lt;P&gt;OS:R81.10 JHF_156&lt;/P&gt;&lt;P&gt;I am trying to import a list of administrators using a .csv file via the mgmt_cli but it doesn't work and shows the error:&lt;/P&gt;&lt;P&gt;"&amp;nbsp;Line 2: code: "err_inappropriate_domain_type"&lt;BR /&gt;message: "This command can work only on domains of type MDS. Cannot execute it in the current domain (current domain type is Domain)."&lt;/P&gt;&lt;P&gt;API details:&lt;/P&gt;&lt;P&gt;[Expert@SA_1:0]# mgmt_cli -r true login&lt;BR /&gt;uid: "7b8f6efd-fef1-4ab9-a152-f6205edbaffc"&lt;BR /&gt;sid: "jBl4yyzlVFA52kP2MWfisetNXQpGFHx6HfkRVEsQd_4"&lt;BR /&gt;url: "&lt;A href="https://127.0.0.1:443/web_api" target="_blank"&gt;https://127.0.0.1:443/web_api&lt;/A&gt;"&lt;BR /&gt;session-timeout: 600&lt;BR /&gt;last-login-was-at:&lt;BR /&gt;posix: 1725397582&lt;BR /&gt;iso-8601: "2024-09-04T02:36+0530"&lt;BR /&gt;read-only: false&lt;BR /&gt;standby: false&lt;BR /&gt;&lt;STRONG&gt;api-server-version: "1.8.1"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I am attaching a snap of the csv file which I have created, please let me know how to get this working.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;==========&lt;/P&gt;&lt;P&gt;WR,&lt;/P&gt;&lt;P&gt;FH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 23:04:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225556#M8772</guid>
      <dc:creator>Firewall_Head</dc:creator>
      <dc:date>2024-09-03T23:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add administrators via mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225565#M8773</link>
      <description>&lt;P&gt;Yes, because administrator users must be added only in the System Data domain &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/add-administrator~v1.9.1%20" target="_blank"&gt;as stated in the documentation&lt;/A&gt;.&lt;BR /&gt;Which means, at the login step, the domain must be specified (e.g. mgmt_cli -r true -d 'System Data').&lt;BR /&gt;This is true regardless of whether it's Multi-Domain or not.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 00:28:07 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225565#M8773</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2024-09-04T00:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add administrators via mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225691#M8774</link>
      <description>&lt;P&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;Thanks for your reply.&lt;/P&gt;&lt;P&gt;When i tried to do the same using the steps mentioned again I am encountering problems.&lt;BR /&gt;&lt;BR /&gt;Attaching image for your reference, can you help me with the right usage of the command if am wrong.&lt;/P&gt;&lt;P&gt;=======&lt;/P&gt;&lt;P&gt;WR,&lt;BR /&gt;FH&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 18:08:15 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225691#M8774</guid>
      <dc:creator>Firewall_Head</dc:creator>
      <dc:date>2024-09-04T18:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add administrators via mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225703#M8775</link>
      <description>&lt;P&gt;First of all, subsequent mgmt_cli commands must reference the session that was obtained from the login API call.&lt;BR /&gt;This is either done with the --session-id or -s parameter to mgmt_cli.&lt;BR /&gt;None of the following commands did that, which is why most of your commands after the login are failing.&lt;/P&gt;
&lt;P&gt;Second, you may not have defined the CSV file correctly.&amp;nbsp;&lt;BR /&gt;The first line in the CSV must correspond to the parameter names for the relevant API call:&amp;nbsp;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/add-administrator~v1.9.1%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/#cli/add-administrator~v1.9.1%20&lt;/A&gt;&lt;BR /&gt;The subsequent lines are the relevant values that are passed to each one.&lt;/P&gt;
&lt;P&gt;To troubleshoot issues with the CSV file, I'd need to see it (or a sample of it).&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 20:27:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225703#M8775</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2024-09-04T20:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add administrators via mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225712#M8776</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I tried as you suggested but no luck, I am pasting my session output below for your reference.&lt;/P&gt;&lt;P&gt;[Expert@SA_1:0]# mgmt_cli -r true login&lt;BR /&gt;uid: "c192f3fd-6405-4ceb-a8ef-d9412408eec6"&lt;BR /&gt;sid: "obw7pv2mp6o7-C6LMIKCQfad9QV87W9dd-x8tsHruwM"&lt;BR /&gt;url: "&lt;A href="https://127.0.0.1:443/web_api" target="_blank"&gt;https://127.0.0.1:443/web_api&lt;/A&gt;"&lt;BR /&gt;session-timeout: 600&lt;BR /&gt;last-login-was-at:&lt;BR /&gt;posix: 1725484400&lt;BR /&gt;iso-8601: "2024-09-05T02:43+0530"&lt;BR /&gt;read-only: false&lt;BR /&gt;standby: false&lt;BR /&gt;api-server-version: "1.8.1"&lt;/P&gt;&lt;P&gt;[Expert@SA_1:0]# mgmt_cli add administrator -b admins.csv --session-id obw7pv2mp6o7-C6LMIKCQfad9QV87W9dd-x8tsHruwM -d 'System Data'&lt;BR /&gt;Line 2: code: "err_inappropriate_domain_type"&lt;BR /&gt;message: "This command can work only on domains of type MDS. Cannot execute it in the current domain (current domain type is Domain)."&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[Expert@SA_1:0]# cat admins.csv&lt;BR /&gt;name,password,authentication-method,permissions-profile&lt;BR /&gt;sayooj,e3w2q1,check point password,Super User&lt;BR /&gt;[Expert@SA_1:0]#&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;======&lt;/P&gt;&lt;P&gt;WR,&lt;/P&gt;&lt;P&gt;FH&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 21:24:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225712#M8776</guid>
      <dc:creator>Firewall_Head</dc:creator>
      <dc:date>2024-09-04T21:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add administrators via mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225714#M8777</link>
      <description>&lt;P&gt;The domain is only relevant on and is specified as part of the login call.&lt;BR /&gt;In all other cases, the session ID is sufficient.&lt;BR /&gt;In this case, I am piping the output out the login call to sid.txt so it can be read by subsequent calls (-s sid.txt).&lt;BR /&gt;Using the CSV file you provided, the following commands worked on my system:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;mgmt_cli -r true -s 'System Data' &amp;gt; sid.txt&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;mgmt_cli -s sid.txt&amp;nbsp;add administrator -b admins.csv&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;mgmt_cli -s sid.txt publish&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The publish is required for committing any changes made through the API.&lt;BR /&gt;Otherwise, the changes will be locked in the created session until it is published or discarded.&lt;BR /&gt;Here is the result the API provided when I queried the user:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;[Expert@R82-EA1:0]# &lt;STRONG&gt;mgmt_cli -s sid.txt show administrator name sayooj --format json&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;  "uid" : "1bb02495-4e3e-4c0e-9660-e2bc52224d5a",&lt;BR /&gt;  "name" : "sayooj",&lt;BR /&gt;  "type" : "administrator",&lt;BR /&gt;  "domain" : {&lt;BR /&gt;    "uid" : "a0eebc99-afed-4ef8-bb6d-fedfedfedfed",&lt;BR /&gt;    "name" : "System Data",&lt;BR /&gt;    "domain-type" : "mds"&lt;BR /&gt;  },&lt;BR /&gt;  "email" : "",&lt;BR /&gt;  "phone-number" : "",&lt;BR /&gt;  "authentication-method" : "check point password",&lt;BR /&gt;  "must-change-password" : true,&lt;BR /&gt;  "permissions-profile" : {&lt;BR /&gt;  "uid" : "ff2c8363-eedd-4d06-a140-a2ede779f09e",&lt;BR /&gt;  "name" : "Super User",&lt;BR /&gt;  "type" : "domain-permissions-profile",&lt;BR /&gt;  "domain" : {&lt;BR /&gt;    "uid" : "a0bbbc99-adef-4ef8-bb6d-defdefdefdef",&lt;BR /&gt;    "name" : "Check Point Data",&lt;BR /&gt;    "domain-type" : "data domain"&lt;BR /&gt;  },&lt;BR /&gt;  "icon" : "General/Role",&lt;BR /&gt;  "color" : "black"&lt;BR /&gt;},&lt;BR /&gt;"sic-name" : "",&lt;BR /&gt;"comments" : "",&lt;BR /&gt;"color" : "black",&lt;BR /&gt;"icon" : "General/Administrator",&lt;BR /&gt;"tags" : [ ],&lt;BR /&gt;"meta-info" : {&lt;BR /&gt;  "lock" : "unlocked",&lt;BR /&gt;  "validation-state" : "ok",&lt;BR /&gt;  "last-modify-time" : {&lt;BR /&gt;    "posix" : 1725486662429,&lt;BR /&gt;    "iso-8601" : "2024-09-04T16:51-0500"&lt;BR /&gt;  },&lt;BR /&gt;  "last-modifier" : "WEB_API",&lt;BR /&gt;  "creation-time" : {&lt;BR /&gt;    "posix" : 1725486662429,&lt;BR /&gt;    "iso-8601" : "2024-09-04T16:51-0500"&lt;BR /&gt;  },&lt;BR /&gt;  "creator" : "WEB_API"&lt;BR /&gt;},&lt;BR /&gt;"read-only" : false,&lt;BR /&gt;"available-actions" : {&lt;BR /&gt;  "edit" : "true",&lt;BR /&gt;  "delete" : "true",&lt;BR /&gt;  "clone" : "true"&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;[Expert@R82-EA1:0]# &lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 22:07:50 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225714#M8777</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2024-09-04T22:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add administrators via mgmt_cli</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225716#M8778</link>
      <description>&lt;P&gt;Nailed it&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;Thank you so much for helping me out on this&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":hugging_face:"&gt;🤗&lt;/span&gt;.&lt;/P&gt;&lt;P&gt;Have a great day!&lt;/P&gt;&lt;P&gt;=======&lt;/P&gt;&lt;P&gt;WR,&lt;/P&gt;&lt;P&gt;FH&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 22:29:37 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Unable-to-add-administrators-via-mgmt-cli/m-p/225716#M8778</guid>
      <dc:creator>Firewall_Head</dc:creator>
      <dc:date>2024-09-04T22:29:37Z</dc:date>
    </item>
  </channel>
</rss>

