AnsweredAssumed Answered

API Launch PC Scan Error " Please enter at least one IP/Group to scan "

Question asked by Sam Friday on May 3, 2018
Latest reply on May 3, 2018 by Sam Friday

While trying to launch a PC scan from the API get the following error "CODE: 999  TEXT: Please enter at least one IP/Group to scan"

NOTE: These IPs have already been added to necessary asset group and the Domain group

I can launch a scan on the same IPs with the API for a VM Scan (see PowerShell below).  Yet if I sign in with the same user to the GUI and manually run a scan I get the error : " The IP addresses listed below are not currently in this account and thus not available for processing. You may add them to the account or cancel the action and try again. "

If I select "OK" and add the IPs then I can go back and run the PC scan from the API just fine.

The Question is how do I "add them to the account" (user account) from the API instead of manually adding them in the GUI?

$url = 'https://'+$v2_server+"/api/2.0/fo/scan/?action=launch&scan_title=$VMtitle&option_id=$VMoptionID&iscanner_id=$scannerID&ip=$scanIPs"

[xml]$VMreturn=Invoke-RestMethod -Uri $url -Method post -Headers $header -WebSession $websession

$url = 'https://'+$v2_server+"/api/2.0/fo/scan/compliance/?action=launch&scan_title=$PCtitle&option_id=$PCoptionID&iscanner_id=$PCscannerID&ip=$scanIPs"

[xml]$CPreturn=Invoke-RestMethod -Uri $url -Method post -Headers $header -WebSession $websession

Outcomes