windows工作排程器以一般使用者執行job

  • 2072
  • 0

因專案開發會需要批次執行程式轉入資料,

而不可能設定排程啟動為"使用者登入才執行",

故開一個公用AD帳號專門來執行設定的排程

按照上圖的設定會出現以下錯誤:

This task requires that the user account specified has Log on as batch job rights.

The task requires...

解決方法如下:

1. Start -> Run-> Type in secpol.msc /s
2. Select "Local Policies" in MMCsnap in
3. Select "User Rights Assignment"
4. Right click on "Log on as batch job" and select Properties
5. Click "Add User or Group", and include the relevant user.

[題外]

因內部網路均會採AD認證,若排程欲以windows登入身分執行,

必須先讓新開的AD帳戶註冊到目前執行排程的電腦使其認得該帳號

Control Panel -> User Accounts -> User Accounts

ref:

https://blog.miniasp.com/post/2012/04/27/Grant-normal-user-right-on-Logon-as-a-batch-job