# Installing OpManager agent on devices using Windows GPO Scheduler You can also install the OpManager agent in your devices using the Scheduler option of your Active Directory server. With the scheduler, you can **deploy the agent instantly** or at a specified time, unlike the [Startup-based script](https://www.manageengine.com/network-monitoring/help/agent-installation-gpo-startup.html) where the installation is performed when the device is restarted. To initiate the scheduler-based installation, follow the steps below: - [Creating or provisioning network share](#creating-or-provisioning-network-share) - [Create a GPO to identify targets for deployment](#create-a-gpo-to-identify-targets-for-deployment) - [Creating a scheduled task to execute deployment and installation of our Agent](#creating-a-scheduled-task-to-execute-deployment-and-installation-of-our-agent) ## Creating or provisioning network share 1. Login to your Windows Server as an **Administrator user**. 2. Open the **Server Manager Console** from the **Administrative Tools** menu. 3. From the **Server Manager Dashboard**, select **File and Storage Services**. 4. Open the **Shares tab**, click on **Tasks** and select **New Share**. ![OpManager agent installation using Windows gpo scheduler: Provisioning new share](https://www.manageengine.com/network-monitoring/help/images/agent-gpo-new-share.jpg) 5. On clicking, a **"New Share Wizard"** opens up. In the wizard, click on **"Select Profile"**, select the option **"SMB Share - Quick"**, then click **Next**. 6. In the **Shared Location** tab, enter the file path to the **shared folder** for deploying the agent installer, and then click **Next**. ![OpManager agent installation using Windows gpo scheduler: Configuring Shared folder details](https://www.manageengine.com/network-monitoring/help/images/agent-gpo-shared-folder-details.jpg) 7. On the **Specify share name** tab, enter a name for your share. Enter a share description, if needed. The wizard will now automatically create the local and remote file paths in the share. 8. After this, click **Next** to configure the settings. 9. On the **Configure Share Settings** wizard page, accept the default options in **Other Settings** (Allow caching of share) and click **Next**. ![OpManager agent installation using Windows gpo scheduler: Other details for Shared folder](https://www.manageengine.com/network-monitoring/help/images/agent-gpo-shares-other-settings.jpg) 10. On the **"Specify Permission to control access"** page, accept the default permissions and click **Next**. 11. On the **Confirm Selections** page, review your selections, and then click **Create**. The new public share is now visible in the Shares pane. 12. Now, right-click on the share and select **Open Share**. 13. Download the OpManager Agent zip file from the OpManager web console by navigating to **Settings > Discovery > Deploy Agent**. Extract the **OpManagerAgent.msi** and **OPMAgentServerInfo.json** files from the zip file and place them in the local directory. **NOTE:** It is mandatory to download a fresh copy of the OpManagerAgent.zip file and use the files within it for the installation process. 14. Also, download the script from [this page](https://www.manageengine.com/network-monitoring/help/files/InstallOPMAgent.txt) and save it as **InstallOPMAgent.vbs**. 15. Place **OpManagerAgent.msi**, **OPMAgentServerInfo.json**, and **InstallOPMAgent.vbs** in the share. **Note:** Take a note of the full network path (not just the local path) as we will be using this later in the installation process. ![OpManager agent installation using Windows gpo scheduler: Shares storage path](https://www.manageengine.com/network-monitoring/help/images/agent-gpo-share-files.jpg) ## Create a GPO to identify targets for deployment 1. Open the **Group Policy Management Console** (GPMC) by opening the Run window (Windows key + R) and typing **gpmc.msc**. 2. After opening the GPMC, right-click on your target organizational unit (in our case, a domain), and select **Create a GPO in this domain, and link it here**. ![OpManager agent installation using Windows gpo scheduler: Creating new GPO](https://www.manageengine.com/network-monitoring/help/images/agent-create-and-link-gpo.jpg) 3. Enter a name for the new GPO. For example, **"OpManager_agent_install"**. **Note:** By default, the GPO applies to all users and computers that successfully authenticate to the Active Directory domain that you selected. 4. Once the new GPO is created, you can see it in the GPMC in the left navigation pane, under **Group Policy Objects**. **Note:** You can modify the scope of computers to which the agent is deployed and installed by changing the Security Filtering values of the new GPO. ## Creating a scheduled task to execute deployment and installation of our Agent 1. Open the **Group Policy Management Editor** by right-clicking on the new GPO you created, and select **Edit**. 2. In the editor navigation tree, under **Computer Configuration**, click **Preferences → Control Panel Settings** and then right-click on **Scheduled Tasks**. 3. Click on **New** and select **Immediate Task (At least Windows 7)**. ![OpManager agent installation using Windows gpo scheduler: Creating a scheduled task for agent deployment and installation](https://www.manageengine.com/network-monitoring/help/images/agent-gpo-new-immediate-task.jpg) 4. This opens the New Task dialog box. Enter a name and a description (if needed). 5. Under **Security** options, click the **Change User or Group** button. 6. In the following dialog box, enter **"system"** in the text box, then click **Check Names**. Confirm that you have the correct values and click **OK**. ![OpManager agent installation using Windows gpo scheduler: Adding devices to task](https://www.manageengine.com/network-monitoring/help/images/agent-gpo-task-select-devices.jpg) 7. Make sure that the system object resolves to the value **"NT Authority\System"**, as shown in the **Security Options** group. 8. Also ensure: - **"Run whether user is logged on or not"** is selected. - **"Run with highest privileges"** is selected. - **"Configure for:"** is set to **Windows Vista or Windows Server 2008**. 9. Click on the **Actions** tab and then click **New**. 10. In the **New Action** dialog box, set the action drop-down to **Start a program**. In the **Program/script** text box, enter the **network file path** of the shared folder that you just created, along with the name of the script file. 11. Provide the arguments and provide the folder details in the **Start in** field and click **OK**. ![OpManager agent installation using Windows gpo scheduler: Adding action to task](https://www.manageengine.com/network-monitoring/help/images/agent-gpo-task-add-action.jpg) **Program/script:** ``` \\computer_name\\InstallOPMAgent.vbs ``` **Add arguments:** ``` OpManagerAgent.msi ``` **Start in:** ``` \\computer_name\\ ``` 12. In the **Conditions** tab, select the checkbox for **Start only if the following network connection is available**, then select **Any connection**. 13. Click **OK** to initiate the agent installation. It might take some time to install the agent in all your devices. 14. Finally, open the Inventory page and check if the selected devices have been added in OpManager. If the agent has not been installed in any of the devices or if you have any other issues with agent installation, please feel free to [contact our support team](mailto:opmanager-support@manageengine.com).