Installing Key Manager Plus Agent in Endpoints via Windows GPO
This document details the steps needed to install the Key Manager Plus agent on multiple endpoints using Windows Group Policy Objects (GPO). Download the PowerShell script to trigger the installation from here and extract the script files.
Verify the SHA256 value of the downloaded PowerShell script file before proceeding:
ca91f8d0849097e15ebfd4274f6c008202f6d8a388867d4390f465ebb06bab7c
This help documents cover the following topics in detail:
- Prerequisites
- Creating a GPO in the Domain and Adding Target Machines
- Adding the Installation Script and Agent Zip to the GPO
- Troubleshooting
- Uninstalling the Agent from Endpoints
1. Prerequisites
Before you begin ensure the following:
- If the agents are already installed on the endpoints, follow these steps to uninstall them. The script uninstalls both the obsolete C++ and C agents.
- Create a Domain that includes all target machines to be used as endpoints where the agent will be installed.
- Navigate to the Key Manager Plus installation directory, open the system_properties.conf file, and set the system property pki.agent.SingleInstallKey.validMin=60. Restart the Key Manager Plus service after making this change. The value 60 denotes the agent install key validity period in minutes. The maximum allowed value is 60.
- Log in to the Key Manager Plus web interface and download the agent ZIP file. The install key is embedded in the ZIP file; ensure it is stored in a safe and secure location.
2. Creating a GPO in the Domain and Adding Target Machines
- Open the Server Manager and navigate to Tools >> Group Policy Management from the top-right corner.
- Right-click the domain name, click Create a GPO in this domain, and Link it here.

- Provide a name for the new GPO (for example, AgentGPO). Click the newly created GPO under Scope >> Security Filtering, and then click Add. In the Select User, Computer, or Group window, enter the target machine names or the name of the group that contains all the target endpoints, or enter the names of individual target machines, and click OK.
- Switch to the Delegations tab. Right-click the group you added and provide full access permission as shown below.

You have successfully created a Group Policy and added the target machines on which the Key Manager Plus agent will be installed.
3. Adding the Installation Script and Agent Zip to the GPO
- Right-click the GPO name in the left pane and click Edit settings, delete, modify security. The Group Policy Management Editor window opens.

- Navigate to the Policies >> Windows Settings and double-click Scripts. In the Scripts window, click Startup, and then click Properties.

- Switch to the PowerShell Scripts tab and click Show Files. The network directory opens. Copy the path of the network location.

- Open the extracted KMPAgentGPO PowerShell script in a text editor and make the following changes:
- Set the source variable to the network location path copied in the previous step. For example: \\zylker.com \SysVol\zylker.com\Policies\{33A6F6BE-4A9E-4CCA-AB5A-7C96E14F2ACB}\Machine\Scripts\Startup\KMPAgentInstaller.zip
- Set the destination path to a location of your choice, for example: C:\Temp. This is the location where the agent ZIP will be extracted and installed on the target endpoints. Ensure this path exists on all target machines.
- Copy the KMPAgentGPO PowerShell script file and the agent installation ZIP to the GPO network location.


- Click Add and enter KMPAgentGPO.ps1 under Script Name. Click Apply and then click OK to save the settings.
- In the Group Policy Management Editor, navigate to the Administrative Templates >> System and open Group Policy.
- Under the Group Policy folder, right-click Specify workplace connectivity wait time for policy processing.




- Select the Enabled option. Set the Amount of time to wait to 120 seconds. Click Apply and the click OK to save the settings.

- The GPO will be applied. Once you restart all the target endpoints, the Key Manager Plus agent PowerShell script will be invoked and the agent will be installed on the target machines.
- After the agent is successfully installed, disable the startup script for the GPO you created (AgentGPO, in this example). This will ensure that the script is not invoked every time the target machines are restarted.
4. Troubleshooting
Ensure that AgentGPO has a higher precedence than the other GPOs. This prevents other GPOs from overriding the permissions of AgentGPO. To verify this, click the GPO name, right-click the Enforced option, and check that it is enabled.

5. Uninstalling the Agent from Endpoints
If the Key Manager Plus agent was deployed using the GPO method, you can uninstall it by running the predefined batch script included in the installation package. Follow the steps below to uninstall the agent from the endpoints:
- Navigate to the agent installation directory on the target machine. By default, it is located at C:\Program Files (x86)\ManageEngine\KMPAgent
- Locate the script named uninstall.bat in this directory.
- Right-click uninstall.bat and select Run as administrator to start the uninstallation process.
The script removes the Key Manager Plus agent from the system. Once complete, the agent and all associated files will be uninstalled.