Hi masher,
Thanks, it really worked for me. It helped me to Block almost 120 IP addresses at once using this method. The detailed procedure of my task is mentioned below. Hope it can help others too.
Step 1 : Make the CSV file of object name and IP address in following format (filename =script1.csv)
name,ip-address
name1,xxx.xxx.xxx.xx
name1,xxx.xxx.xxx.xx
name1,xxx.xxx.xxx.xx
Login to the device through CLI
change the location to tmp ( cd /tmp )
create a script file inside it ( vi Script1.csv )
paste the CSV file
to check whether the file is created or not paste (cat script.csv)
Run CSV file (mgmt_cli add host --batch script1.csv)
provide username and password
Step 2 : Make CSV file of Object group name and object name (filename = script2.csv)
name,members.add
groupname, name2
groupname, name2
groupname, name2
Login to device through CLI
change the location ot tmp ( cd /tmp )
create a script file inside it ( vi Script2.csv )
paste the csv file
to check weather the file is created of not paste (cat scrip2.csv)
mgmt_cli -r true login > session.id
mgmt_cli -s session.id set group -b script2.csv
mgmt_cli -s session.id publish
mgmt_cli -s session.id logout
If the locked session error is seen then try to publish and install the previous policies and logout/disconnect or takeover all the Read and write sessions and ten try Step 2
Refrences
https://www.youtube.com/watch?v=li4vRH63-_8
https://community.checkpoint.com/t5/Management/Format-of-csv-file-to-add-object-in-group/td-p/8987