Wrong host name column when using command line export
4 posts · Closed
Hi there,
I have two host name columns, and I am trying to use the export function. I need to export Host name (the SNMP host name), not the Host Name column - note the lowercase/uppercase difference in the name. I am using the following command line:
start /wait netscan.exe /hide /cols:"IP Address;System Description;Host name"
And it looks like I get the wrong host name column.

The Scanner's code looks for the first column matching the requested name, and the search is case-insensitive.
This can be easily worked around by renaming the SNMP column into something like SNMP Host Name and change /cols accordingly:
... /cols:"IP Address;System Description;SNMP Host Name"
Thanks,
We are planning to script a solution so will never actually use the GUI and it could be a different account using it (Task Scheduler). Is it possible to save the column names as a profile and load it? We will call it to scan multiple ranges.
Sure, it is possible. What you could do is configure the app as required with columns, IP address ranges, etc. Then save the current config to a file (via File - Current Config - Save to File) and use it like this:
netscan.exe /config:PATH-TO-CONFIGFILE.xml /cols:"IP Address;SNMP_Host_Name" /auto:"path-to-result.csv"
As a result, column settings, IP address ranges and all other settings will be loaded from CONFIGFILE.xml. Once the scan has finished, the results will be exported to result.csv and only the requested columns will be included.
To scan multiple ranges you can either define them as a part of the configuration or simply add to the command line:
/range:range1,range2,...
Specifying the /range parameter will override any ranges loaded from a config file with /config.