One of my customers is trying to automate “exporting” certain tasks from ePO. After reviewing the attached documentation , they have downloaded the curl https command line module for Windows. They can make a connection into their existing ePO server and query on the core.help command. However, when they run the following command below they need some clarification on the command line arguments which are not clear in the guide.”
curl -k -u usernameassword https://localhost:8445/policy.export productID
Lastly, if using curl is not the preferred method to achieve this, can someone suggest how they could accomplished this without having to resort to Python?
Nevertheless, if they go the route of having to use Python, can it support scripting these tasks with your API?
Please let me know. Thank you.
Taking a look at the help data returned from the API for the command you want to use we get:
policy.export productId [fileName]
Exports policies to an XML file in export folder
Requires view permission for at least one product
productId (param 1) - Product ID as returned by policy.find command
fileName (param 2) - Location within the export folder for the XML file to be
stored, e.g. foo.xml, foo/foo.xml, etc.
The product ID refers to the product ID in ePO, so for example Viruscan 8.8 = VIRUSCAN8800, which matches the Product folders in the software folder on the ePO server in <epoinstallfolder>\DB\Software\Current
so if you wanted to export policies for VSE for example the API call would look like:
curl -k -u usernameassword "https://localhost:8445/remote/policy.export?productId=VIRUSCAN8800&fileName=foo.xml" and you should get a response like:
Exported to 'D:\reports\foo.xml'.
If you also run
curl -k -u usernameassword https://localhost:8445/remote/core.help you will get a full list of API commands available to you.
Certified McAfee Product Specialist - ePO
The API Explorer (https://community.mcafee.com/docs/DOC-2931) is old but is a big help with syntax, along with the scripting guide.
Lastly, we will be talking about the Web API at FOCUS 2015, Session 89: Advanced McAfee ePO Techniques: Making ePO Work for You!
Please mark answered if appropriate!