A Microsoft file hosting and synchronization service.
Hey Bruno,
I'm currently facing the same problem as you did. Did you ever get a solution for that problem and could kindly share it with me if so?
Thank you,
Jonas :)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello eveyone, I hope someone would help me with my issues/questions.
Here is the scenario:
I have a VM that has a task set up in task scheduler and it checks a local folder which is synched with a sharepoint folder. The problem I'm facing is that the folder does not sync when the task is started by task scheduler (with the VM closed and user not logged in). When I run the task manually, it works.
The setup:
The task is set up to "Run whether user is logged on or not" and "Run with highest privileges" check box checked. The configured account/user (set up to run the task) has admin authorities.
VM that has the task scheduler set up runs a Windows Server 2016
Onedrive version Build 23.142.0709
Couple of things I notice (tests were done using the same account/user):
With the above findings, I changed my script to start onedrive (when it is not running), by doing this, the task starts onedrive, and it syncs the folder as it should, but got a side effect... the onedrive icon does not show in the taskbar neither the sync icons aren't displayed in the folders/files (indicating its status) eventhough onedrive.exe is running. In this scenario I got a sync problem that the files got deleted from sharepoint folder (online) don't sync with the local folder. Checking the task manager, onedrive.exe is not running under the user.
So couple of questions:
Attached is a screenprint where it indicates the onedrive running under the user and onedrive icon displayed in task bar (scenario that I want to happen when running the task thru task scheduler).
A Microsoft file hosting and synchronization service.
Hey Bruno,
I'm currently facing the same problem as you did. Did you ever get a solution for that problem and could kindly share it with me if so?
Thank you,
Jonas :)
Hello @Bruno Hashimoto,
Thank you for your question and for reaching out with your question today.
The behavior you are experiencing with OneDrive and Task Scheduler on a Windows Server 2016 VM might be related to how Windows handles user logon sessions and interactive sessions.
When you log in to the VM interactively, your user session is considered an interactive session, and OneDrive is automatically started in that session. The OneDrive icon appears in the taskbar, and it syncs the folders as expected.
However, when you run a task through Task Scheduler with the "Run whether user is logged on or not" option selected, the task is executed in a non-interactive session, which means it doesn't have access to the user's desktop or taskbar. As a result, OneDrive is not started automatically, and you might encounter synchronization issues.
To address this, you can try the following steps:
Please note that using Task Scheduler to run OneDrive in a non-interactive session might not fully replicate the behavior of OneDrive running in an interactive session. Some features, such as the taskbar icon and sync status, might not be available in non-interactive sessions.
Additionally, consider the security implications of running tasks with user credentials. If your OneDrive setup involves sensitive data, ensure that the task's credentials are adequately protected.
As a general recommendation, it is best to use OneDrive in interactive sessions to ensure the full user experience and sync functionality. Automated solutions might have limitations in non-interactive scenarios.
I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.
If the reply was helpful, please don’t forget to upvote and accept as answer.
Best regards.