execute funcftion on agent

Hi,

I have a script that is on a Windows Dude server. The script uses openfiles tunneled through WinGrep and Find to return a value. This value represents the number of open instances of a specific file. The server is an agent for our main Dude server. I’ve build a function to execute this script:

array_element(execute(“countcash.cmd”,“”,“C:\beheer\batch”),1)

On a map I’ve added the device and have set the right agent in the settings. Probes are working. Now I’ve eddited the appearance of the device and added this to the label:
Cash users: [CashUsers()]

Locally this works fine, but from our main Dude server it does not. It seems that it is impossible to execute trough a function on an Agent Dude server. Can anyone confirm this?