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 username:password "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 username:password https://localhost:8445/remote/core.help you will get a full list of API commands available to you.
Certified McAfee Product Specialist - ePO
Thank you Richard.
- ProductID is the Product code in the database, for example VSE 8.8 is ProductID VIRUSCAN8800. To export the policies you can use this URL: https://eposerver:8443/remote/policy.find?searchText=VIRUSCAN8800
- Output to XML, using the example above: https://eposerver:8443/remote/policy.find?searchText=VIRUSCAN8800&:output=xml (add &:output=xml to the end)
- Use https://eposerver:8443/remote/core.help to find the commands in YOUR ePO. Since the API commands are controlled by the extensions, everyone’s available commands will differ. You can then use https://eposerver:8443/remote/core.help?command=policy.find (replace policy.find with your favorite) to get the options for the command.
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!
I wasn't able to attend FOCUS 15. Can I get a copy of your presentation, please?
Thanks, Eric, but that site requires a password I don't have (presumably because I didn't attend the conference). Is there another way to get the presentation?