
Installing an agent on Windows servers
Before we start managing any machine, we need to install an agent on it. This can be done in multiple ways, such as pushing it from the VCM console, installing it manually, or installing it with a script.
In this recipe, we will have a look at installing the agent manually and with a script on a Windows server.
Getting ready
Prepare a server to install the agent; the installer is available on the VCM Collector server, at X:\Program Files (x86)\Vmware\VCM\AgentFiles
and the certificate is available at X:\Program Files (x86)\Vmware\VCM\CollectorData
, where X
is the drive where VCM is installed.
Copy the installer and certificate on a shared location from where it can be copied to the server where we want to install it.
We need administrative access on the server where we will be installing the agent.
The local firewall should be disabled (not recommended) or port 26542
must be open between the managed machine and VCM Collector.
For an agent push, we need the machines to be registered as licensed machines on the VCM console and the network authority account to be a part of the local administrators group, and port 26542
should be open on the machine where we are pushing the agent.
How to do it...
We will split this recipe into three sections, as follows
- Manual agent installation
- Agent push from the console
- Licensing Windows machines
Manual agent installation
Log in to the server with an administrative account, copy the installer with a certificate locally, and follow this process:
- Start
VCMAgentInstall.exe
. - Click on Next, again on Next, and on the destination location screen, continue with the default
C:\Windows\CMAgent
value. - Select Allow HTTP, and go with the default port,
26542
. - On this page, browse to the location where the certificate is copied.
- Click on Next three more times, and it will start installing the agent.
- Once the agent has been installed, log in to VCM console.
- Go to Administration | Machines Manager | Licensed Machines | Licensed Windows Machines, and click on Add Machine.
- Select Basic and select automatically license machines.
- Provide details about the machine where you installed the agent, as follows:
- Provide the hostname for the Machine Name parameter
- Select the domain from the dropdown which the machine belongs to
- Select DNS as Type
- Select Windows Server as Machine Type
- Click on Next and then on Finish to close the wizard.
- Once the machine has been added to VCM, we need to hit the Refresh button on the console and click on Collect to start data collection.
- Monitor the data collection job, and finally, we are done with adding a machine to VCM.
Agent push from the console
The machine should be in the VCM console either by running a discovery rule or adding it manually. Now, we can perform a push of the agent from the console.
Log in to the VCM console and follow these steps to install the agent on the machine:
- Go to Administration | Machines Manager | Licensed Machines | Licensed Windows Machines, and select the machine which you want to add the agent to.
- Click on Install in the menu.
- The wizard will open. Make sure the machine appears in the Selected box.
- On the next page, set the following values:
- Install At: Keep this default.
- Install From: Keep this default.
- Options: Select HTTP and set the port to
26542
. Keep the rest default.
- On the schedule screen, select Run Now.
- Confirm the selection and click on Finish.
- Click on Jobs to see whether the job is successful, and after that, go back to the console, scroll to the right, and check whether the machine has its agent state changed from Unknown to Current Agent and shows its agent version as 5.8.2.
- Once the machine has its agent installed, perform an initial collection.
Licensing Windows machines
We will perform the following steps to license a managed machine. The steps are the same for Windows and Linux/Unix machines.
- Log in to the VCM console with an admin account.
- Click on Administration.
- Go to Machines Manager | Available Machines.
- Select the Windows machines to license.
- Click on License.
Follow the wizard to finish licensing the machine, and if the available number is below zero and in red, contact VMware to purchase more licenses.
How it works...
With this recipe, we are making sure that the machine we want to manage has an agent installed, is licensed in VCM, and that we have performed the data collection.
VCM has enough information about managed machines to start deploying software; put the machine in the correct machine group. We can perform further specific collections to find out the compliance status or patching status, and based on that, we can fix the machine or install missing patches.
There's more...
We can install the agent with a script.
Here is the code for the script:
cd C:\VCM_Agent CMAgentInstall.exe /s INSTALLPATH=C:\Windows\CMAgent PORT=26542 CERT=C:\VCM_Agent\VMware_VCM_Enterprise_Certificate_E5D8927D-A9A7-43E8-8E6F-5C88D1E40F12.pem
Here is what the options stand for:

Just run the batch file and then follow steps 6 to 11 to complete the agent installation.
You can also use the PowerCLI
commands Copy.VMGuestFile
and Invoke-VMSCript
to automate the deployment.