<?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: Delete Unused Objects v2.0 in Scripts</title>
    <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/221752#M1164</link>
    <description>&lt;P&gt;easy answer to this.... limited to 500 objects in the gui.... the API will allow you to iterate over them in turn,&amp;nbsp; for example on a single CMA I have over 3300 unused objects.&amp;nbsp; this is in a MDS with 20 domains... using the gui is far to slow compared to leveraging the api.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jul 2024 08:31:13 GMT</pubDate>
    <dc:creator>DanCannon</dc:creator>
    <dc:date>2024-07-24T08:31:13Z</dc:date>
    <item>
      <title>Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209858#M1142</link>
      <description>&lt;P&gt;One of the first ever pieces I wrote for CheckMates is a script that would delete unused objects. I was very specific to Host/Network/Group back then. Recently I had a reason to update the tool and now have a new version that will digest objects based off of TYPE so you get delete files you can use in batch commands by object type. I have found no limit to object database size since this loops.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will say something like this is going to be done quickly and easily with AI co-pilot but until then enjoy!&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/WadesWeaponShed/Delete-Unused-Objects" target="_self"&gt;https://github.com/WadesWeaponShed/Delete-Unused-Objects&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 19:13:39 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209858#M1142</guid>
      <dc:creator>Adam_Forester</dc:creator>
      <dc:date>2024-03-27T19:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209859#M1143</link>
      <description>&lt;P&gt;I should probably note that the Python version is till a work in progress... I'm not a python expert so that one still needs work. The Shell version works excellently.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 19:28:26 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209859#M1143</guid>
      <dc:creator>Adam_Forester</dc:creator>
      <dc:date>2024-03-27T19:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209870#M1144</link>
      <description>&lt;P&gt;Where can I get the shell version? Would like to try it in the lab.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 22:57:17 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209870#M1144</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-03-27T22:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209871#M1145</link>
      <description>&lt;P&gt;Nm, disregard, I see its in that link, let me try and will report if it works&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/4072"&gt;@Adam_Forester&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 22:58:51 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209871#M1145</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-03-27T22:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209875#M1146</link>
      <description>&lt;P&gt;Not sure if this looks right, but all I get is below. I also tried on another lab mgmt server, same thing&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Expert@cpazuremgmt:0]# ./delete-unused-objects.sh&lt;/P&gt;
&lt;P&gt;What is the IP address or Name of the Domain or SMS you want to check?&lt;BR /&gt;20.220.86.199&lt;BR /&gt;There are 1 objects&lt;BR /&gt;[Expert@cpazuremgmt:0]# ls&lt;BR /&gt;delete-unused-objects.sh&lt;BR /&gt;[Expert@cpazuremgmt:0]#&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 23:07:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209875#M1146</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-03-27T23:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209880#M1147</link>
      <description>&lt;P&gt;Ya know... It helps if I publish the correct version. &lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just updated it and retested in my lab.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can then take the files and run them as batch;&lt;/P&gt;
&lt;P&gt;Example: mgmt_cli -r true delete host --batch&amp;nbsp;&lt;STRONG&gt;host_127.0.0.1_unused_objects.log&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 01:18:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209880#M1147</guid>
      <dc:creator>Adam_Forester</dc:creator>
      <dc:date>2024-03-28T01:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209881#M1148</link>
      <description>&lt;P&gt;Thats better mate lol&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;
&lt;P&gt;[Expert@CP-management:0]# ./delete-unused-objects.sh&lt;/P&gt;
&lt;P&gt;What is the IP address or Name of the Domain or SMS you want to check?&lt;BR /&gt;172.16.10.252&lt;BR /&gt;There are 4 objects&lt;BR /&gt;[Expert@CP-management:0]# ls&lt;BR /&gt;address-range_172.16.10.252_unused_objects.log&lt;BR /&gt;delete-unused-objects.sh&lt;BR /&gt;group_172.16.10.252_unused_objects.log&lt;BR /&gt;host_172.16.10.252_unused_objects.log&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 01:29:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209881#M1148</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2024-03-28T01:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209907#M1149</link>
      <description>&lt;P&gt;Great one, Adam! Moved to ToolBox where it belongs. Can you please add a picture to the post?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 09:12:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/209907#M1149</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2024-03-28T09:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/210091#M1150</link>
      <description>&lt;P&gt;Thank you for sharing the script and it's always nice to see people leveraging our APIs&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I wanted to ask though, why you don't perform this action through the SmartConsole UI? (or perhaps the option is not visible enough...).&lt;/P&gt;
&lt;P&gt;If you open the Object Explorer (via the top menu or by clicking the three-dots in the right side Objects pane), there is a combobox at the top left that says "All" by default. If you open it, you can select "Unused Objects" instead and it will filter the contents. You also have the left side filters to hierarchically filter by object types.&lt;BR /&gt;Once you filtered for what you wanted, you can multi-select all objects and delete them.&lt;/P&gt;
&lt;DIV id="tinyMceEditor_647d7701ae19f7Tomer_Noy_2" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, another comment that can help you make the script more efficient is to leverage the "delete objects-batch" command that can delete many objects in a single API call and transaction:&lt;BR /&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/delete-objects-batch~v1.9.1%20" target="_blank" rel="noopener"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/delete-objects-batch~v1.9.1%20&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2024 08:51:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/210091#M1150</guid>
      <dc:creator>Tomer_Noy</dc:creator>
      <dc:date>2024-03-31T08:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/210184#M1151</link>
      <description>&lt;P&gt;Hey Tomer! Great question... I wrote the original version back in 2016, this was more of I need to update based on time passed and efficiency of my own code practices.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the batch delete command it would require me to one line this and my original idea was for the code to be in a format that was reviewable and the executed with the --batch command based on object type.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate the input! I may add a second part that would output them into a single code line as an optional output&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 14:35:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/210184#M1151</guid>
      <dc:creator>Adam_Forester</dc:creator>
      <dc:date>2024-04-01T14:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Unused Objects v2.0</title>
      <link>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/221752#M1164</link>
      <description>&lt;P&gt;easy answer to this.... limited to 500 objects in the gui.... the API will allow you to iterate over them in turn,&amp;nbsp; for example on a single CMA I have over 3300 unused objects.&amp;nbsp; this is in a MDS with 20 domains... using the gui is far to slow compared to leveraging the api.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 08:31:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Delete-Unused-Objects-v2-0/m-p/221752#M1164</guid>
      <dc:creator>DanCannon</dc:creator>
      <dc:date>2024-07-24T08:31:13Z</dc:date>
    </item>
  </channel>
</rss>

