Hi.
Have you worked with TEWS before for any task?
I haven't personally tried this function but the idea probably should be quite similar to a View User task. You first of all need to make sure you enable Web Services globally, have the right security, proper privileged account to execute queries, then you should enable your tasks for Web Service. Then, you should generate your wsdl interface and work either with the SEARCH or QUERY interfaces to find your objects.
Usually working with a tool like SOAP UI is the easiest to start with since it will allow you to construct the XML requests and get their responses where you can see the data in that client tool.
Personally, I suggest you start with a task like View User. Once you get View User to work from SOAP UI then you can basically be at a point where you have proven that your environment is set up correctly, privileges are good (at least initially) and all working. Then, you may want to extend and to develop for other possibly more complicated tasks such as the task you're referring to.
If this helped -> wonderful. If not, then I would imagine you have already done all that and now are stuck on your task where you know the environment is fine and just this task has a problem. If that is the case, you may want to reply to this and include your XML request, XML response you're receiving and WSDL interface as well.
It may come to requesting you open a Support Case.
Regards,
Sagi