<?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 mgmt_cli Export all Hosts, Networks and Groups with members in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-Export-all-Hosts-Networks-and-Groups-with-members/m-p/241343#M8934</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;we want to export all hosts, network and group objects so we can import them into another management.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For networks:&lt;/P&gt;&lt;P&gt;mgmt_cli -m localhost -s sid.txt show networks --format json | jq '.objects[] | {name, subnet4, "mask-length4"}'&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;"name": "CP_default_Office_Mode_addresses_pool",&lt;BR /&gt;"subnet4": "172.16.10.0",&lt;BR /&gt;"mask-length4": 24&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;"name": "IPv6_Link_Local_Hosts",&lt;BR /&gt;"subnet4": null,&lt;BR /&gt;"mask-length4": null&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;"name": "test-network",&lt;BR /&gt;"subnet4": "192.168.0.0",&lt;BR /&gt;"mask-length4": 16&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Hosts:&lt;BR /&gt;mgmt_cli -m localhost -s sid.txt show hosts --format json | jq '.objects[] | {name, "ipv4-address"}'&lt;/P&gt;&lt;P&gt;Output:&lt;BR /&gt;"name": "test1",&lt;BR /&gt;"ipv4-address": "1.1.1.1"&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;"name": "test2",&lt;BR /&gt;"ipv4-address": "2.2.2.2"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only issue I have are the groups:&lt;/P&gt;&lt;P&gt;mgmt_cli -m localhost -s sid.txt show groups details-level "full" --format json | jq '.objects[] | {name, members}'&lt;/P&gt;&lt;P&gt;Output:&lt;BR /&gt;"name": "testgroup",&lt;BR /&gt;"members": [&lt;BR /&gt;"a25ca22d-1494-49d2-89a5-f7dc6a804aa5",&lt;BR /&gt;"6d6903bc-aa68-4446-821d-50d0aa33dcc4"&lt;BR /&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The members only show with the UUID and not in clear-text.&lt;/P&gt;&lt;P&gt;Yes, I can manually search for the UUID but it seems pretty uncomfortable to me:&lt;BR /&gt;mgmt_cli -m localhost -s sid.txt show object uid "a25ca22d-1494-49d2-89a5-f7dc6a804aa5" --format json | jq '.object | {name, type, "ipv4-address"}'&lt;BR /&gt;"name": "test1",&lt;BR /&gt;"type": "host",&lt;BR /&gt;"ipv4-address": "1.1.1.1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In contrast If I search for one specific group instead of "show groups" the members are shown in cleartext.&lt;/P&gt;&lt;P&gt;Any suggestions how to improve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Feb 2025 10:42:29 GMT</pubDate>
    <dc:creator>morris</dc:creator>
    <dc:date>2025-02-17T10:42:29Z</dc:date>
    <item>
      <title>mgmt_cli Export all Hosts, Networks and Groups with members</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-Export-all-Hosts-Networks-and-Groups-with-members/m-p/241343#M8934</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;we want to export all hosts, network and group objects so we can import them into another management.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For networks:&lt;/P&gt;&lt;P&gt;mgmt_cli -m localhost -s sid.txt show networks --format json | jq '.objects[] | {name, subnet4, "mask-length4"}'&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;"name": "CP_default_Office_Mode_addresses_pool",&lt;BR /&gt;"subnet4": "172.16.10.0",&lt;BR /&gt;"mask-length4": 24&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;"name": "IPv6_Link_Local_Hosts",&lt;BR /&gt;"subnet4": null,&lt;BR /&gt;"mask-length4": null&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;"name": "test-network",&lt;BR /&gt;"subnet4": "192.168.0.0",&lt;BR /&gt;"mask-length4": 16&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Hosts:&lt;BR /&gt;mgmt_cli -m localhost -s sid.txt show hosts --format json | jq '.objects[] | {name, "ipv4-address"}'&lt;/P&gt;&lt;P&gt;Output:&lt;BR /&gt;"name": "test1",&lt;BR /&gt;"ipv4-address": "1.1.1.1"&lt;BR /&gt;}&lt;BR /&gt;{&lt;BR /&gt;"name": "test2",&lt;BR /&gt;"ipv4-address": "2.2.2.2"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only issue I have are the groups:&lt;/P&gt;&lt;P&gt;mgmt_cli -m localhost -s sid.txt show groups details-level "full" --format json | jq '.objects[] | {name, members}'&lt;/P&gt;&lt;P&gt;Output:&lt;BR /&gt;"name": "testgroup",&lt;BR /&gt;"members": [&lt;BR /&gt;"a25ca22d-1494-49d2-89a5-f7dc6a804aa5",&lt;BR /&gt;"6d6903bc-aa68-4446-821d-50d0aa33dcc4"&lt;BR /&gt;]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The members only show with the UUID and not in clear-text.&lt;/P&gt;&lt;P&gt;Yes, I can manually search for the UUID but it seems pretty uncomfortable to me:&lt;BR /&gt;mgmt_cli -m localhost -s sid.txt show object uid "a25ca22d-1494-49d2-89a5-f7dc6a804aa5" --format json | jq '.object | {name, type, "ipv4-address"}'&lt;BR /&gt;"name": "test1",&lt;BR /&gt;"type": "host",&lt;BR /&gt;"ipv4-address": "1.1.1.1"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In contrast If I search for one specific group instead of "show groups" the members are shown in cleartext.&lt;/P&gt;&lt;P&gt;Any suggestions how to improve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 10:42:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-Export-all-Hosts-Networks-and-Groups-with-members/m-p/241343#M8934</guid>
      <dc:creator>morris</dc:creator>
      <dc:date>2025-02-17T10:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli Export all Hosts, Networks and Groups with members</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-Export-all-Hosts-Networks-and-Groups-with-members/m-p/241389#M8935</link>
      <description>&lt;P&gt;If it makes it better, you can take network group name or uid and put it in another API, show group.&lt;/P&gt;
&lt;P&gt;You can take names of groups and loop through all the names:&lt;/P&gt;
&lt;P&gt;mgmt_cli -r true show group name "Demo_Group" --format json&lt;BR /&gt;{&lt;BR /&gt;"uid" : "9bc6cc71-39d4-4ef1-acc8-c0f161df058b",&lt;BR /&gt;"name" : "Demo_Group",&lt;BR /&gt;"type" : "group",&lt;BR /&gt;"domain" : {&lt;BR /&gt;"uid" : "41e821a0-3720-11e3-aa6e-0800200c9fde",&lt;BR /&gt;"name" : "SMC User",&lt;BR /&gt;"domain-type" : "domain"&lt;BR /&gt;},&lt;BR /&gt;"members" : [ {&lt;BR /&gt;"uid" : "c717c05f-0285-4945-86a2-9b533d41e936",&lt;BR /&gt;"name" : "dummy1",&lt;BR /&gt;"type" : "host",&lt;BR /&gt;"domain" : {&lt;BR /&gt;"uid" : "41e821a0-3720-11e3-aa6e-0800200c9fde",&lt;BR /&gt;"name" : "SMC User",&lt;BR /&gt;"domain-type" : "domain"&lt;BR /&gt;},&lt;BR /&gt;"ipv4-address" : "1.1.1.1",&lt;BR /&gt;"icon" : "Objects/host",&lt;BR /&gt;"color" : "black"&lt;BR /&gt;}, {&lt;BR /&gt;"uid" : "0e696c35-d96e-4715-9b42-c933da5f9aaa",&lt;BR /&gt;"name" : "dummy2",&lt;BR /&gt;"type" : "host",&lt;BR /&gt;"domain" : {&lt;BR /&gt;"uid" : "41e821a0-3720-11e3-aa6e-0800200c9fde",&lt;BR /&gt;"name" : "SMC User",&lt;BR /&gt;"domain-type" : "domain"&lt;BR /&gt;},&lt;BR /&gt;"ipv4-address" : "2.2.2.2",&lt;BR /&gt;"icon" : "Objects/host",&lt;BR /&gt;"color" : "black"&lt;BR /&gt;},&lt;/P&gt;
&lt;P&gt;.....&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 15:36:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-Export-all-Hosts-Networks-and-Groups-with-members/m-p/241389#M8935</guid>
      <dc:creator>Amir_Senn</dc:creator>
      <dc:date>2025-02-17T15:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: mgmt_cli Export all Hosts, Networks and Groups with members</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-Export-all-Hosts-Networks-and-Groups-with-members/m-p/241450#M8937</link>
      <description>&lt;P&gt;There are existing tools that can help with this.&lt;BR /&gt;For example:&amp;nbsp;&lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion/CLI-API-Example-for-exporting-importing-and-deleting-different/m-p/40850#M2766" target="_blank"&gt;https://community.checkpoint.com/t5/API-CLI-Discussion/CLI-API-Example-for-exporting-importing-and-deleting-different/m-p/40850#M2766&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Feb 2025 23:51:17 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-Export-all-Hosts-Networks-and-Groups-with-members/m-p/241450#M8937</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2025-02-17T23:51:17Z</dc:date>
    </item>
  </channel>
</rss>

