How to Sync OneDrive for Business on Windows Server Without Sign-In
Question details
The user needs to synchronize OneDrive for Business files on a Windows Server without requiring an interactive user session to remain active.

- Product
- OneDrive for Business
- Device & OS
- Windows Server
- Scenario
- Setting up unattended, automated server-side synchronization of OneDrive for Business files.
- Observed behavior
- The native OneDrive client syncs only when a user is interactively signed in. Attempting to bypass this using a Scheduled Task often results in the process stopping shortly after execution or failing to sync correctly.
Verify that you have administrative access to the Windows Server, and understand that the native OneDrive desktop client is officially designed only for interactive user sessions rather than background system services.
Use Microsoft Graph API for Unattended Synchronization
Utilize Microsoft Graph or supported enterprise server sync solutions designed specifically for unattended, system-level file operations.
Because the native OneDrive client requires an interactive user session, treating it as a Windows service is unreliable and unsupported by Microsoft. Microsoft Graph provides a robust API for server-to-cloud synchronization without requiring a signed-in user profile.
Log in to the Microsoft Entra admin center, navigate to 'App registrations', and create a new application to obtain your Client ID and Tenant ID.
Assign the necessary Microsoft Graph API permissions (such as Files.ReadWrite.All) to the application and click to grant admin consent for your organization.
Navigate to the 'Certificates & secrets' section in your app registration and create a new client secret. Save this value securely, as it will be used for authentication.
Use PowerShell, Python, or a dedicated third-party synchronization tool that supports Microsoft Graph API client credential flow to manage and sync files unattended.

Configure OneDrive via Windows Task Scheduler
Set up a scheduled task to launch OneDrive at system startup as a workaround, though this method is limited to the specified user's files and may be unstable.
Try WPS Office for Seamless Document Management
While configuring server-level background synchronization requires advanced setups, managing your daily local and cloud documents doesn't have to be complicated. WPS Office provides a free, lightweight alternative to Microsoft Office with excellent compatibility, a highly familiar user interface, and seamless file handling.
- 1. Download and Install: Visit the official WPS Office website to download the free, lightweight installer.
- 2. Open Your Documents: Launch WPS Office and easily open your existing Microsoft Office files without any formatting loss.
- 3. Edit and Save: Enjoy a familiar editing experience and seamlessly save your work locally or to your preferred cloud storage.

Frequently Asked Questions
Why does my OneDrive Scheduled Task stop shortly after running on Windows Server?
OneDrive is inherently designed to run within an interactive user desktop session. When launched via Task Scheduler without a logged-in user, the sync process lacks the necessary profile resources or UI elements, causing it to terminate or suspend operations unexpectedly.
Can a single instance of OneDrive sync all users' folders on a server?
No. OneDrive synchronization is strictly tied to individual user profiles. A running instance will only synchronize the files belonging to the specific account it was launched under.
Is it supported to run OneDrive as a Windows service?
Microsoft does not officially support running the OneDrive sync client as a system-wide background Windows service. For unattended automated file synchronization on servers, Microsoft recommends using the Microsoft Graph API or enterprise server sync solutions.




