--- title: "Create a server task to run compliance queries best practice" slug: "create-a-server-task-to-run-compliance-queries-best-practice" tags: ["Product Usage", "ePolicy Orchestrator – On-prem", "ePO 5.10.x", "ePO 5.10.0"] updated: 2026-09-07T17:46:26Z published: 2026-09-07T17:46:26Z canonical: "docs.trellix.com/create-a-server-task-to-run-compliance-queries-best-practice" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.trellix.com/llms.txt > Use this file to discover all available pages before exploring further. # Create a server task to run compliance queries best practice You must create a server task to run your compliance queries weekly to automate generating your managed systems' compliance report. Follow these steps to create a server task that runs your compliance queries every Sunday morning at 2:00 a.m.. Running the queries on Sunday morning allows you to run the report on Monday morning at 5:00 a.m. and deliver it by email to the administrators. For details about product features, usage, and best practices, click ? or Help. 1. Select **Menu** → **Automation** → **Server Tasks**, then click **Actions** → **New Task**. 2. In the **Server Task Builder**: 1. In the, **Descriptions** tab, type a name and notes. 2. In the **Schedule status**, click **Enabled**. 3. Click **Next**. 3. In the **Actions** tab, configure these settings. 1. In the **Actions** list, select **Run Query** and configure these settings: - For **Query**, select **VSE: Compliance Over the Last 30 Days**. - Select your language. - For **Sub-Actions**, select **Export to File** then click **OK**. - For C:\reports\, type a valid file name. - For **If file exists**, select **Overwrite**. - For **Export**, select **Chart data only**. - For **Format**, select **CSV**. 2. Click **+** to create another action, and in the second **Actions** list, select **Run Query** and configure these settings, then **Next**. - For **Query**, select **Inactive Agents**. - Select your language. - For **Sub-Actions**, select **Export to File**. - For C:\reports\, type a valid file name. - For **If file exists**, select **Overwrite**. - For **Export**, select **Chart data only**. - For **Format**, select **CSV**. 4. In the **Schedule** tab, change these settings, then click **Next**. 1. For **Schedule type**, click **Weekly**. 2. For **Start date**, select today's date. 3. For **End date**, click **No end date**. 4. Change the **Schedule** settings to configure the task to run on **Monday** at **2:00 AM**. > [!NOTE] > Note > > You can set the schedule to run when and as often as you want. 5. Confirm that all settings are correct in the **Summary** tab, then click **Save**. That completes creating the server task to automatically run the two compliance queries, then save the output of the queries to CSV files.