# Import multiple scheduled tasks from XML

**URL:** <https://forums.powershell.org/t/import-multiple-scheduled-tasks-from-xml/23232>\
**Category:** PowerShell Help\
**Created:** [November 29, 2023, 10:41am UTC](https://forums.powershell.org/t/import-multiple-scheduled-tasks-from-xml/23232 "2023-11-29T10:41:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![as21](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@as21](https://forums.powershell.org/u/as21)\
**Post date:** [November 29, 2023, 10:41am UTC](https://forums.powershell.org/t/import-multiple-scheduled-tasks-from-xml/23232/1 "2023-11-29T10:41:26Z")

</div>

How exactly?

I can export multiple tasks in XML file, but I cannot import multiple.  
Its working only with single task. Any idea?

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [November 29, 2023, 11:33am UTC](https://forums.powershell.org/t/import-multiple-scheduled-tasks-from-xml/23232/2 "2023-11-29T11:33:32Z")

</div>

as21,  
Welcome to the forum. 👋🏼

I have separated your post from the topic …

> [@Unable to manually run scheduled task after server upgrade from 2012 to 2019](https://forums.powershell.org/t/unable-to-manually-run-scheduled-task-after-server-upgrade-from-2012-to-2019/22071):
>
> In Windows 2012 (myServer1), I have a scheduled taks (myTask) running as myDomain\user1. I can manually run it any time in addition it runs as scheduled. After myServer1 was upgraded directly to 2019, myTask still runs successfully as scheduled, but when I run it manually, it failed with error message: The user account does not have permission to run this task. I tried the following command to assign permission to user1 $taskPath = "" $taskName = “myTask” $principal = New-ScheduledTaskPrin…

Please do not hijack threads from others. If you have a similar or follow up question you can create a new question for yourself and link the according thread as needed.

As for your question:

> [@as21](#):
>
> Any idea?

How about using a loop? 🤷🏼‍♂️

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:13pm UTC](https://forums.powershell.org/t/import-multiple-scheduled-tasks-from-xml/23232/3 "2024-05-16T20:13:41Z")

</div>

Closed on May 16, 2024, 8:13pm UTC


