I have .NET servers with multiple agents. While the GUI is nice, we have several agents on a single server which makes changing the collector and its related port very tedious. Is there a way to automate or simplify this? Maybe a script?
The .NET configuration tool is a GUI to basically simplify the configuration of environment variables.
You should have a look to the Powershell scripts on Github!
You are interested in InstallDotNETAgent.psm1
In the Enable-DotNETAgent function, you will find the commands to enable the agent on a particular process and how to set up the main variables (from line 66).
For more information, the agent documentation lists all variables and options.
Hope this helps,
as an addition to what Nic already said:
while you can use those scripts and the corresponding environment variables for the .NET agent configuration, there's also another way: the registry.
the .NET agent configuration tool actually modifies the registry which is then queried by the agents. you can also use this way e.g. via .reg files or automatically modifying the registry.
while this might be the easiest way to get the exact configuration from one machine to another, if you have to adapt the settings or add settings in an automated way, you're probably better off with the env vars.