We have some TeamCity build agents running and I'd like to destroy and rebuild all agents over night automatically to have a clean set of agents in the morning. Destroying and provisioning the agent isn't a problem but I can't find a way to authorize the fresh agents automatically. The TeamCity documentation talks about the web UI only which is a pretty bad starting point for automation.
Anyone got a solution for this?