In larger customer environments, it is not always easy to deploy the node agents manually, due to the large numbers of targets to deploy to and the wider dispersal of targets.
In order to address this issue, many customers would prefer an automated deployment method to deploy to targets.
The aim of this article is to provide customers with a Batch Script that can be used to deploy the Enterprise Recon agent automatically and without end-user interaction.
Our specific example provides a method to deploy via Active Directory in a Windows domain-based environment. However, the batch script can be used across a variety of software deployment tools that support scripting.
Creating the Batch File
Below are the commands for the Batch Script:
msiexec.exe /i <location of Node agent .msi file> /QN INSTALLDIR=" location where you want to install it" TARGETIP=<masterserver IP address> TARGETKEY=<masterServerPublicKey> TARGETGROUP=<GroupName>
NET STOP "Enterprise Recon 2 Agent"
NET START "Enterprise Recon 2 Agent"
Replace <location of Node agent .msi file> with the path and location of the Node agent installer file e.g. C:\Windows\SYSVOL\er2_2.0.19-windowsx64-9360.msi
INSTALLDIR is the customized location for the install, by default, the Agent is installed under %PROGRAMFILES%\Ground Labs\Enterprise Recon 2
*Keep the TARGETIP and TARGETKEY fields on the same line as the msiexec command, the install can fail if these are saved on a new line.
**Remember to ensure all the machines on which the package needs to be installed can access this location and have the correct rights to do so.
***You may need to use two separate scripts for 32 bit and 64 bit machines within your environment.
Replace <masterserver IP address> with the IP Address of your Enterprise Recon Master Server.
Replace <GroupName> with the Group on the Master Server you wish to place the machines in e.g. Default
Copy the commands into a text file and then save it with a meaningful name such as ER2Deploy and change the extension to .bat.
Assigning an AD GPO Startup Script
- Copy the scripts (along with correct agent .msi) you want to use to the Machine\Scripts\Startup folder for the related policy. Policies are stored in the %SystemRoot%\Sysvol\Domain\Policies folder on domain controllers.
- In the Group Policy Management Console, right-click the GPO for the site, domain, or organizational unit you want to work with and then select Edit. This opens the policy editor for the GPO.
- In the Computer Configuration node, double-click the Windows Settings folder and then click Scripts.
- To work with startup scripts, right click Startup and then select Properties.
- Click Show Files. If you copied the computer script to the correct location in the Policies folder, you should see the script.
- Click Add to assign a script. This opens the Add A Script dialog box. In the Script Name field, type the name of the script you copied to the Machine\Scripts\Startup folder for the related policy.
You now have setup your Startup Script to deploy the Enterprise Recon agent to target machines within the domain.