Creating a task from command line with preferences


#1

Greetings,

I would like to be able to create a task from the command line and change some of the default preferences such as “Maximum concurrently scanned hosts”. I’ve tried the following but it didn’t work:

omp -i --xml '
<create_task>
<name>Test_01</name>
<preferences>
<preference>
<name>Maximum concurrently scanned hosts</name>
<scanner_name>max_hosts</scanner_name>
<value>100</value>
</preference>
</preferences>
<config id="74db13d6-7489-11df-91b9-002264764cea"/>
<target id="ddae5e51-392f-48ab-9445-8c35cc61b5e3"/>
</create_task>'

I get the following response:
<create_task_response status_text="Bogus element: name" status="400"></create_task_response>

Any idea how to do this?

Cheers.


#2

Fixed by removing <name>Maximum concurrently scanned hosts</name>

Cheers.