See this post https://social.technet.microsoft.com/Forums/windowsserver/en-US/aede572b-4c1f-4729-bc9d-899fed5fad02/run-powershell-script-as-scheduled-task-that-uses-excel-com-object
And there are posts where they have described if you are invoking Excel you have to run it with account logged in.
https://www.experts-exchange.com/questions/28407956/VBScript-won't-run-as-Scheduled-Task.html
But its seems like you can get round it and the idea that you have to create these 2 directories is very real.
(32Bit, always)
C:\Windows\System32\config\systemprofile\Desktop
(64Bit)
C:\Windows\SysWOW64\config\systemprofile\Desktop
We had a task that called an Excel Object and then even though we had configured the Local Security policy to allow the account it was running as to Run as Logon Batch in
In Administrative Tools -> Local Security Policy. Under Security Options -> Network access:
Do not allow storage of passwords and credentials for network authentication.
User Rights Assignment -> Log on as a batch job. (Then add the account that the task was running as)
If it is Enabled,
set it to Disabled.
It would not execute when unattended and the account not logged in. But add the directories, it really worked.
Then also make note for Excel and Access macros to run and allow execution from a vbsccript. Do make sure under the account profile that the scheduled task is running on, in Access and Excel option settings, allow all macros to run in the Trust Center settings.
Then also make note for Excel and Access macros to run and allow execution from a vbsccript. Do make sure under the account profile that the scheduled task is running on, in Access and Excel option settings, allow all macros to run in the Trust Center settings.
Else Scheduled tasks get stuck when fired.
No comments:
Post a Comment