# Manage Jobs

Once your Worker is active and healthy, you can create jobs to automate recurring tasks — audit reports, configuration drift monitoring, and more. Jobs are configured in the **IntuneAssistant portal** and picked up automatically by your Worker.

{% hint style="info" %}
**Prerequisite:** Your Worker must have a **Registration Status** of **Active** before jobs can be assigned to it. See [Finishing the Installation](broken://pages/e85be4ed15a18a8675ca88d66a19eca4f34be734) if you haven't activated your Worker yet.
{% endhint %}

## Available Job Types

<table><thead><tr><th width="249">Job Type</th><th>Description</th><th>Status</th></tr></thead><tbody><tr><td><strong>Intune Audit Report</strong></td><td>Periodic report of Intune audit events, delivered by email</td><td>Available</td></tr><tr><td><strong>Configuration Drift Monitor</strong></td><td>Detects and reports policy drift from your established baseline</td><td>Available (preview)</td></tr></tbody></table>

{% stepper %}
{% step %}

### Go to Jobs

1. Sign in to the **IntuneAssistant portal** at [portal.intuneassistant.cloud](https://portal.intuneassistant.cloud/)
2. In the left navigation, click **Worker**
3. Select **Job Management**

You will see a list of all configured jobs and their current status.

<figure><img src="/files/PcGRwzDFVCHmzJxba6y8" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create a New Job

Click **+ New Job** to open the job creation form.

Fill in the following fields:

#### General Settings

| Field        | Required | Description                                                                                   |
| ------------ | -------- | --------------------------------------------------------------------------------------------- |
| **Job Name** | ✅ Yes    | A descriptive name for this job (max 200 characters)                                          |
| **Job Type** | ✅ Yes    | Select the type of job to run (see Available Job Types above)                                 |
| **Worker**   | Optional | Target a specific Worker instance. If you only have one Worker, it is selected automatically. |
| **Enabled**  | —        | Toggle to enable or disable the job. Enabled by default.                                      |

#### Schedule

| Field            | Description                                                                                                                                                              |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Run every**    | How often the job should repeat. Enter a value in hours. Minimum: 1 hour. Maximum: 8,760 hours (1 year). Default: 168 hours (weekly).                                    |
| **First run at** | Optional. Schedule the first execution at a specific date and time (UTC). If left empty, the job will be queued immediately. Must be set to a future time within 1 year. |

**Common interval values:**

| Interval          | Hours |
| ----------------- | ----- |
| Every hour        | 1     |
| Every 6 hours     | 6     |
| Daily             | 24    |
| Weekly            | 168   |
| Monthly (approx.) | 720   |
| {% endstep %}     |       |

{% step %}

### Configure the Job

Each job type has its own configuration. Fill in the fields relevant to your chosen job type.

{% tabs %}
{% tab title="Intune Audit Report" %}
This job retrieves Intune audit events and sends them as an HTML report by email.

| Field                           | Required | Description                                                                                                                             |
| ------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Recipient Email**             | ✅ Yes    | The email address the report is sent to                                                                                                 |
| **CC Emails**                   | Optional | Additional recipients, comma-separated (e.g. `alice@contoso.com,bob@contoso.com`)                                                       |
| **Tenant ID**                   | ✅ Yes    | The Microsoft tenant ID to pull audit events from                                                                                       |
| **Lookback Days**               | —        | Number of days of history to include in the report. Default: **7 days**                                                                 |
| **Categories**                  | Optional | Filter events by category, comma-separated. Examples: `Application`, `Policy`, `Device`, `Role`. Leave blank to include all categories. |
| **Only report if events found** | —        | When enabled, no email is sent if there are no audit events in the period. Default: **off** (always send).                              |
| **Max Events**                  | —        | Maximum number of events to include in the report. Default: **500**                                                                     |

The report is attached to the email as an HTML file named `Intune-Audit-Report-YYYY-MM-DD.html`.
{% endtab %}

{% tab title="Configuration Drift Monitor" %}
This job compares your current Intune configuration against the stored baseline and reports any deviations.

| Field                           | Required | Description                                                                     |
| ------------------------------- | -------- | ------------------------------------------------------------------------------- |
| **Recipient Email**             | ✅ Yes    | The email address the drift report is sent to                                   |
| **CC Emails**                   | Optional | Additional recipients, comma-separated                                          |
| **Tenant ID**                   | ✅ Yes    | The Microsoft tenant ID to monitor                                              |
| **Only report if drifts found** | —        | When enabled, no email is sent if the configuration is in sync. Default: **on** |

The report is attached to the email as an HTML file named `Configuration-Drift-Report-YYYY-MM-DD.html`.

{% hint style="info" %}
Configuration drift is measured against the baseline snapshots stored in IntuneAssistant. Make sure you have at least one snapshot captured before enabling this job.
{% endhint %}
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### Save the Job

Click **Save** to create the job.

The portal will confirm the job has been created and display it in your jobs list with:

* The scheduled next run time
* Status: **Pending** (waiting to be picked up by the Worker)

Your Worker polls for new jobs every **30 seconds**. The job will be claimed and executed automatically when it is due.
{% endstep %}
{% endstepper %}

## Monitoring Job Runs

After a job has run, you can review its execution history from the job detail page.

### Job Status Values

| Status          | Meaning                                                  |
| --------------- | -------------------------------------------------------- |
| **Pending**     | Job is scheduled and waiting to be claimed by the Worker |
| **Claimed**     | Worker has reserved the job for execution                |
| **In Progress** | Job is currently running                                 |
| **Success**     | Job completed successfully and report was sent           |
| **Failed**      | Job encountered an error                                 |
| **Expired**     | Job was not picked up within the allowed window          |
| **Cancelled**   | Job was manually cancelled                               |

### Execution History

On the job detail page, the **Execution History** tab shows past runs with:

* Start and end times
* Duration in seconds
* Status (Success / Failed)
* Error message (if failed)

## Trigger a Job Manually

You can run any job immediately without waiting for the scheduled time:

1. Open the job in the portal
2. Click **Run Now**
3. The job will be queued with **Pending** status and picked up by the Worker within 30 seconds

The **Run Now** button is disabled for jobs that are:

* Currently disabled (toggle is off)
* Marked as **poisoned** (see below)

## Editing and Deleting Jobs

### Edit a job

Open the job and click **Edit**. You can update the job name, schedule, and all configuration fields. Changes take effect from the next scheduled run.

### Disable a job

Toggle the **Enabled** switch off to pause a job without deleting it. The job will remain in your list but will not be scheduled.

### Delete a job

Click **Delete** on the job detail page. This permanently removes the job and its configuration. Execution history is retained for audit purposes.

## Troubleshooting

### The job stays in Pending for a long time

* Check that your Worker is **Active** and the **Last Heartbeat** is recent (within 10 minutes).
* Verify the Worker is connected to the internet and not paused or stopped in the Azure Portal.

### The job status shows Failed

* Open the execution record and review the **Error Message** field.
* Common causes:
  * **Invalid Recipient Email** — verify the email address is correct and accessible.
  * **Tenant ID not found** — confirm your Worker has consent for the tenant being audited.
  * **Graph API permissions missing** — visit the consent page in IntuneAssistant to re-grant permissions.

### The job is marked as Poisoned

A job is automatically marked as **poisoned** after repeated consecutive failures. Poisoned jobs are excluded from scheduling to prevent runaway error loops.

To recover a poisoned job:

1. Identify and fix the root cause (check execution history for error messages)
2. Edit the job and re-save it — this clears the poisoned flag and reschedules the job

Check [Poisoned jobs](/extensions/worker/manage-jobs/poisoned-jobs.md) for more information about poisoned jobs&#x20;

## Need Help?

If your job is not running as expected, contact support with:

* Your **Worker instance ID** (visible on the Worker dashboard)
* The **Job ID** (visible in the job detail URL or execution history)
* The **error message** from the failed execution

**<support@intuneassistant.cloud>**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.intuneassistant.cloud/extensions/worker/manage-jobs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
