> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexxible.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy FlexxAgent via Group Policies (GPO)

> Guide for deploying the agent unattended using GPOs

FlexxAgent can be deployed on Windows using Group Policies (GPO). To do so, you need access to the agent installation package, which can be downloaded from the Flexxible portal.

## Deployment

1. Create a PowerShell script called `.Install.ps1` with the following content:
   Start-Process `Path to file\FlexxAgent-Installer.exe` /verysilent /AgentConfig="`Path to file\settings.conf`"

   Example:

   ```
   Start-Process C:\Temp\FlexxAgent-Installer\FlexxAgent-Installer.exe /verysilent /AgentConfig="C:\Temp\FlexxAgent-Installer\settings.conf"
   ```

<Note>
  Make sure that, in addition to the executable, the line includes the parameters required for the installation, such as the proxy, if needed.
</Note>

2. Save the file for later use.
3. Run the Windows Group Policy Management Console on a domain controller that has the remote computer management tools installed.
4. Create a new Group Policy inside the Group Policy container.
   <img src="https://mintcdn.com/flexxible/X87eAETtm8nG0tMl/images/guides/0depgpo.png?fit=max&auto=format&n=X87eAETtm8nG0tMl&q=85&s=7abcb3568f77c942d4d9510a9605a6b9" alt="0depgpo" width="458" height="358" data-path="images/guides/0depgpo.png" />
5. Give the new policy a name. Choose one that is meaningful.
6. Right-click the Group Policy and select `Edit`.
7. Expand the tree `Computer Configuration` -> `Windows Settings` and select `Scripts (Startup/Shutdown)`
   <img src="https://mintcdn.com/flexxible/X87eAETtm8nG0tMl/images/guides/1depgpo.png?fit=max&auto=format&n=X87eAETtm8nG0tMl&q=85&s=ddec9a5f00b41e1c1a64b66a7188a40a" alt="1depgpo" width="739" height="166" data-path="images/guides/1depgpo.png" />
8. A dialog will appear in a new window. In it, select `PowerShell Scripts`. Then click the `Show Files…` button.
   <img src="https://mintcdn.com/flexxible/X87eAETtm8nG0tMl/images/guides/3depgpo.png?fit=max&auto=format&n=X87eAETtm8nG0tMl&q=85&s=cb09c98ab5beb9e3a01063719ae22746" alt="2depgpo" width="854" height="182" data-path="images/guides/3depgpo.png" />
9. The network folder where the scripts for the Group Policy are stored will open.
   <img src="https://mintcdn.com/flexxible/X87eAETtm8nG0tMl/images/guides/3depgpo.png?fit=max&auto=format&n=X87eAETtm8nG0tMl&q=85&s=cb09c98ab5beb9e3a01063719ae22746" alt="3depgpo" width="854" height="182" data-path="images/guides/3depgpo.png" />
10. Copy the `Install.ps1` file that you created at the beginning and paste it inside the network folder that stores the Group Policy scripts.
    <img src="https://mintcdn.com/flexxible/X87eAETtm8nG0tMl/images/guides/4depgpo.png?fit=max&auto=format&n=X87eAETtm8nG0tMl&q=85&s=e84a5bb816a4810957d702f39afbf985" alt="4depgpo" width="657" height="171" data-path="images/guides/4depgpo.png" />
11. Close the Windows Explorer window that provided access to the folder with the Group Policy scripts.
12. The modal window for the startup script properties will appear again. Click the `Add…` button.
13. A dialog will appear to select files. Look for the script to use with the `Browse…` button.
14. The previous path will open, where the file created at the start of the procedure is located. Double-click it, or select it and click the `Open` button.
15. Once the file is selected, click OK to close the dialog. The file will appear in the configuration modal window.
16. Select `OK` to close this window. You will return to the Group Policy editor. This window can be closed.
17. Locate the branch of the organization, inside the domain controller, where the devices on which you want to install FlexxAgent are located. Select the branch and right-click it. `Select Link an Existing GPO`.
    <img src="https://mintcdn.com/flexxible/X87eAETtm8nG0tMl/images/guides/5depgpo.png?fit=max&auto=format&n=X87eAETtm8nG0tMl&q=85&s=5f9cad6d88dfcc8c9f69e862c7bc4ef2" alt="5depgpo" width="514" height="245" data-path="images/guides/5depgpo.png" />
18. A selection dialog will appear where you will select the policy created earlier. Once selected, click OK.

## Verification

To validate the installation of FlexxAgent on a domain computer, you need to restart at least one of the devices within it, so that the Group Policy takes effect.

After the restart, access the Event Viewer, in the Application log section, where you can review the events generated during the installation and the first run of FlexxAgent.

<img src="https://mintcdn.com/flexxible/X87eAETtm8nG0tMl/images/guides/6depgpo.png?fit=max&auto=format&n=X87eAETtm8nG0tMl&q=85&s=cfff9c7f84e1da2ed8466b1b2505c8fd" alt="6depgpo" width="626" height="438" data-path="images/guides/6depgpo.png" />

After a few minutes, you will see the new device registered in the Workspaces module and in the `Workspaces` view in the Portal.

<img src="https://mintcdn.com/flexxible/X87eAETtm8nG0tMl/images/guides/7depgpo.png?fit=max&auto=format&n=X87eAETtm8nG0tMl&q=85&s=2c434ff109d6c4ccbf8d2498d4257f7f" alt="7depgpo" width="999" height="450" data-path="images/guides/7depgpo.png" />

The installation log can be viewed in detail in the file `C:\Windows\Temp\FlexxAgentInstallation.log`.

<img src="https://mintcdn.com/flexxible/X87eAETtm8nG0tMl/images/guides/8depgpo.png?fit=max&auto=format&n=X87eAETtm8nG0tMl&q=85&s=3143bb1f162e15f08e5c6463192a4f5e" alt="8depgpo" width="600" height="480" data-path="images/guides/8depgpo.png" />
