Yes, you can use both approaches together.
The GPO deployment method can be used to install and enroll the Wazuh agent on Windows endpoints. After the agent is installed, enrolled, and connected to the Wazuh manager, you can manage part of its configuration remotely using centralized configuration through the agent.conf file.
A common approach would be:
Deploy the Windows agent using GPO, including the required deployment variables, such as WAZUH_MANAGER and WAZUH_REGISTRATION_SERVER. You can also use the WAZUH_AGENT_GROUP variable to automatically assign the agent to a specific group during installation.
Ensure that the group already exists on the Wazuh manager before deploying the agents. If a non-existent group is specified during enrollment, the enrollment process will fail.
Configure the shared agent.conf file for that group on the Wazuh manager.
Once the agent is installed, enrolled, and assigned to the group, it will receive the centralized configuration from the manager.
Please note that centralized configuration is not used to install the agent itself. It is used to manage supported agent settings after the agent is already enrolled. Also, not every local ossec.conf option can be managed centrally, so you should check whether the module or setting you want to configure is supported in agent.conf.
For example, centralized configuration can be used for modules such as FIM/syscheck, log collection/localfile, SCA, syscollector, labels, rootcheck, command monitoring, and client buffer settings.
With this approach, the deployment can be fully automated: the agent is installed through GPO, assigned to the proper group during installation, and then receives the corresponding centralized configuration from the manager.
References:
Deploying Wazuh agents on Windows endpoints:
https://documentation.wazuh.com/current/installation-guide/wazuh-agent/wazuh-agent-package-windows.html
Deployment variables for Windows:
https://documentation.wazuh.com/current/user-manual/agent/agent-enrollment/deployment-variables/deployment-variables-windows.html
Deployment variables:
https://documentation.wazuh.com/current/user-manual/agent/agent-enrollment/deployment-variables/index.html
Centralized configuration:
https://documentation.wazuh.com/current/user-manual/reference/centralized-configuration.html
Grouping agents:
https://documentation.wazuh.com/current/user-manual/agent/agent-management/grouping-agents.html
Enrollment via agent configuration:
https://documentation.wazuh.com/current/user-manual/agent/agent-enrollment/enrollment-methods/index.html