You can setup a full automation policy to collect the machine GUID, but this example will collect from just one agent for testing purposes.
From the UI go to Settings > Global Settings > CUSTOM FIELDS > Agents.
Add Custom Field:
Field Type =
While in Global Settings go to URL ACTIONS.
Add a URL Action:
Connect to a TeamViewer Session
URL Pattern =
Navigate to an agent with TeamViewer running (or apply using Settings > Automation Manager).
Go to Tasks.
Select Script =
TeamViewer - Get ClientID for client (this is a builtin script from script library)
Descriptive name of task =
Collects the ClientID for TeamViewer.
Collector Task =
Custom Field to update =
Click Next Check Manual Click Add Task
Right click on the newly created task and click Run Task Now.
Give it a second to execute, then right click the agent that you are working with and go to Run URL Action > TeamViewer Control.
It will launch the session and possibly prompt for a password in TeamViewer.