iT邦幫忙

0

windows10 如何批次匯入Task Scheduler的排程

我得到某台Server上的windows排程(XML Document),現在我要匯入到另一台Server中,請問有能進行批次處理的CMD指令? 或者CMD指令可匯入一支排程,我在把CMD寫進.bat去自己跑每支排程?

謝謝

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

2
japhenchen
iT邦超人 1 級 ‧ 2021-05-28 14:20:35
schtasks.exe /Create /XML task.xml /tn 排程名稱
eric1223 iT邦新手 5 級 ‧ 2021-05-31 16:33:39 檢舉

您好
我測試過,如果我從Server手動Create Task(test.xml) > 匯出XML > 用您的指令可以成功匯入(test.xml)

但是我換成另一台Server的Task.XML,會顯示以下問題

ERROR: The user name or password is incorrect.

另外測試了幾種可能

schtasks.exe /Create /XML task.xml /tn 排程名稱 /s Server Domain /U username /P passwrod
--username: task新的user account 
--password: 新的password
錯誤訊息:
ERROR: User credentials are not allowed on the local machine.

schtasks.exe /Create /XML task.xml /tn 排程名稱 /s Server Domain /U username /P passwrod
--username: task原本的user account 
--password: 原本的password
錯誤訊息:
ERROR: User credentials are not allowed on the local machine.

看來是匯出的XML檔裡有用戶帳號,查一下,如果有,改成匯入端的用戶名

eric1223 iT邦新手 5 級 ‧ 2021-05-31 18:13:38 檢舉

我不確定是否改這兩部分,但我改過還是同樣錯誤訊息:

ERROR: User credentials are not allowed on the local machine.

https://ithelp.ithome.com.tw/upload/images/20210531/20133775PdqZZZ0cA1.jpg

我要發表回答

立即登入回答