Does the Task scheduler can open in unattended session (user log off) eMS Office file (like excel)?

Rogaski, Pawel 0 Reputation points
2024-04-26T07:05:10.34+00:00

Hello,

I am trying to automate task which has to open excel file and refresh connections. I tried to use windows task scheduler on remote desktop.

Everything is working with option 'Run only when user is logged on".

I need to have it working remotely, but after choosing 'Run whether user is logged on or not' with option 'run with highest privileges' ticked, nothing is happening.

After setting scheduled trigger, close the VM and comeback few minutes later I see in the history log information that

Task Scheduler launched action "C:\Windows\System32\cmd.exe" in instance "{xxxxxxxxxxxxxxxxxx}" of task "\xxxxxxxxxx".

When user is logged on, action takes literally several seconds..

In unattended session there is no change in the excel file even waiting few minutes from start of the task.. like nothing happen

Excel is stored in one-drive (user has access), but I checked the same when excel and script vbs were stored in local VM drive.. also no success..

I would be super grateful for advise what I am missing with that configuration.. or maybe there are some limitations which I am not aware off when it comes to opening MS office files from task scheduler and doing some operations on them..

Thanks a lot in advance

Paweł

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,478 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Jiajing Hua-MFST 5,070 Reputation points Microsoft Vendor
    2024-04-26T08:32:41.4933333+00:00

    Hi @Rogaski, Pawel

    Do you use Microsoft 365 Apps?

    Here is a thread: Task Scheduler not able to start Excel if user is not logged in (Windows 10 and Office 365), Microsoft 365 Apps required an active foreground user session to work.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

  2. Rogaski, Pawel 0 Reputation points
    2024-04-26T08:42:25.7866667+00:00

    Hello,

    Yes, I saw this case raised by Dan and Karen Myers which You reffering in the link, but wasnt sure if its official stated somewhere in MS documentation in relation to Task Scheduler etc..

    Is there? Eventually can You propose some work around for this?

    Thanks

    Paweł

    0 comments No comments