On fresh installation, Windows Agent registration fails with ACC-4104: Agent is already registered<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Symptoms: When performing a fresh installation of ACC on a Windows device via script or deployment tool, where the agent uses a MID-less connection, the agent fails to register with the Instance. The agent record shows a status of "Registration failed". On the agent form, there is an Active ACC Error Message with code ACC-4104, with a message stating that the agent is already registered. Cause: The deployment script installs the agent, but after the installation, the script stops the agent, make changes to ACC configuration, and then starts the agent again. Here is an example of sequence of events that can lead to the registration failure, if ACC is being deployed with a script like this. 1. The deployment script installs ACC and the agent service starts 2. The agent begins its initial registration attempt 3. The Instance receives the registration request and creates the agent registration record (sn_agent_agent_registration) for the agent, keyed by the agent's unique agent ID 4. The deployment script stops the agent service, interrupting the registration. 5. The deployment script makes the desired configuration changes, then starts the agent service again. 6. Because the agent didn't complete the registration the first time, it attempts to register again. 7. The Instance receives the second registration request from this agent, but the Instance detects that an agent registration record already exists for this agent, and errors out stating the agent is already registered. Fix: The Windows MSI installation command can take a parameter that makes the agent service not start after the installation is complete. Add the "START_SERVICE" parameter, along with the value "False" to the installation command, like so: START_SERVICE="False" Now, when the installation completes, the agent will not start. The deployment script can then make the desired configuration changes, and afterwards the deployment script should start the agent. Remediation: If agents have already failed to register with the ACC-4104, then those agents will need to be re-registered. To re-register the agent, follow this procedure. 1. On the Instance, delete the agent record along with the corresponding sn_agent_agent_registration record. 2. On the agent host, stop the agent service. 3. Delete the certs in {agent config directory}\cert\cnc 4. Ensure the registration key is populated in the acc.yml. 5. Start the agent. The agent will re-register.