Did you know that it was possible to poll databases / datasets outside of the Automate database? All that is needed is a System DSN (OBDC Connection) on the agent you wish to query from, and you can then reference that in the following script function:

On the agent, open the ODBC Data Source Administrator and go in to the System DSN tab. Add your data source here.

To utilise the data, you want to function exactly as you would when looping through rows in a script from the Automate database. If you prefer, there’s a great example in the Scriptlets pack written by Darren White at ScriptletsPack – Scriptlets – MSPGeek