4 Replies Latest reply on Feb 16, 2017 6:08 PM by dukes303

    cURL syntax?


      Can any show me or point me to a working example of a curl statement being sent to an EPO server with switches? For example:


      eeadmin.resetSelfRecovery EEADMIN.resetSelfRecovery userDn


      Can someone translate that into an actual curl command that would be sent?


      I got as far as getting the server to authenticate me, but the commands I'm sending are all failing.


      What I really need is eeadmin.addUser to work, and I don't want to have to learn Python to do it if I can do it with a simple, single curl command.

        • 1. Re: cURL syntax?



          note that the command is case sensitive. This means every character needs to be the correct case (upper or lower, whatever the example shows you).


          Also read this thread, it has some other suggestions that may help with syntax: https://www.community.mcafee.com/thread/88785?start=0&tstart=0


          I've had issues with case sensitivity before too, it's not unusual. Let everyone know how you go.

          • 2. Re: cURL syntax?

            Here's the command I'm trying to get to work:


            curl -k -u USERNAME https://SERVERNAME:8443/remote/eeadmin.assignUser?systemNode=True?nodeId=MACHINE _NAME?dn=CN=USERNAME,OU=X,OU=X,OU=X,OU=X,OU=DC=SOMETHING,DC=COM




            USERNAME is my user name.

            SERVERNAME is the IP address of the ePo server.

            I set systemNode to True because I'm assigning a user to a workstation.

            MACHINE_NAME is the name of the workstation.

            The DN is copied straight from AD. There are no spaces in this example.


            I tried adding an ldap server on the end with ?ldapServerName=SERVERNAME but it didn't make a difference.


            I have verified through the console that I have permissions to do this. My problem is with the cURL command line, somewhere.

            • 3. Re: cURL syntax?



              often some characters used in the command line are not understood by the command interpreter (cmd.exe) so you need to wrap some of the command in quotes.




              curl -k -u username:password "https://eposerver:8443/remote/command.example?blah&blah"


              In the above example the question mark or the ampersand may cause confusion for the command prompt and the quotes can avoid that issue sometimes. Depends whether you run this in a command prompt window or a powershell window, as results may differ between the two, and with or without quotes can give you different results (or different errors...).

              • 4. Re: cURL syntax?

                The problem was not with cURL. The problem was that the eeadmin.assignUser command is looking for a nodeID, not a machine name. I bit the bullet and after a few days made the switch to Python for this single command. The example Python script queries the ePo with the machine name and returns the nodeId. With that, the command works. I guess cURL is good for single commands, but not so much if you need to query information and pipe it back into another command.