# Windows Scheduled Task

## List

> Retrieve Windows Scheduled Task

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/AVD/HostPool/{id}/Optimization/WindowsScheduledTask":{"get":{"tags":["0-Infrastructure/AVD/Host Pool//Optimization"],"summary":"List","description":"Retrieve Windows Scheduled Task","operationId":"237cc859-563a-48b4-b725-d77165fa731c","parameters":[{"name":"id","in":"path","description":"The ID of the optimization setting to retrieve the windows scheduled task.","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Success","content":{"application/json; api-version=1.0":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ImageOptimizationWindowsScheduledTask"}}}}},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"ImageOptimizationWindowsScheduledTask":{"type":"object","properties":{"task":{"type":"string","description":"<para type=\"synopsis\">Scheduled Task</para>\r\n<para type=\"description\"></para>","nullable":true},"location":{"type":"string","description":"<para type=\"synopsis\">Scheduled Task Location</para>\r\n<para type=\"description\"></para>","nullable":true},"type":{"$ref":"#/components/schemas/OptimizationFileType"}},"additionalProperties":false,"description":"<para type=\"synopsis\">Image Optimization - Windows Scheduled Task</para>\r\n<para type=\"description\"></para>"},"OptimizationFileType":{"enum":[["0 = Folder","1 = Task"]],"type":"string","description":"<para type=\"synopsis\">Whether file type is a folder or a task.</para>\r\n<para type=\"description\"></para>","format":"int32"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```

{% openapi src="/files/oEgjY6sMA31ZVBC35aoj" path="/api/AVD/HostPool/{id}/Optimization/WindowsScheduledTask" method="post" %}
[swagger 1.json](https://content.gitbook.com/content/jyGAUPrA6XIdGAfHCnJE/blobs/7mKwtvutT7xlWtmCVnxB/swagger%201.json)
{% endopenapi %}

## Delete

> Removes Windows Scheduled Task From Optimization.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/AVD/HostPool/{id}/Optimization/WindowsScheduledTask":{"delete":{"tags":["0-Infrastructure/AVD/Host Pool//Optimization"],"summary":"Delete","description":"Removes Windows Scheduled Task From Optimization.","operationId":"233a7dc6-5759-4a49-85ee-a49dd4d36c35","parameters":[{"name":"id","in":"path","description":"The ID of the optimization setting to remove the windows scheduled task.","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"description":"Windows Scheduled Task Settings","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/RemoveImageOptimizationWindowsScheduledTask"}}}},"responses":{"204":{"description":"No Content"},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"RemoveImageOptimizationWindowsScheduledTask":{"required":["location","task"],"type":"object","properties":{"task":{"maxLength":255,"minLength":0,"type":"string","description":"<para type=\"synopsis\">Scheduled Task</para>\r\n<para type=\"description\"></para>","nullable":true},"location":{"maxLength":255,"minLength":0,"type":"string","description":"<para type=\"synopsis\">Scheduled Task Location</para>\r\n<para type=\"description\"></para>","nullable":true}},"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```


---

# 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.parallels.com/landing/ras-rest-api-guide/api-reference/infrastructure/avd/host-pool/optimization/windows-scheduled-task.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.
