I don't think there's any simple or reliable way to do that- however see thoughts below.
Example:
This tutorial will show you how to enable or disable the OneDrive feature for all users in Windows 10 and Windows 11. OneDrive is built-in to Windows 11 by default. With OneDrive, you can sync files and folders between your computer and the cloud, so you can get to your files from anywhere -...
www.elevenforum.com
Examine the policy description in Option 1 step 5 - disabling access also means stopping syncing.
You'd need to consider access via the tray icon, the registry, the task manager and if available, Group Policy.
Someone may be able to suggest some approach.
AI suggests: (and some these don't appear to be relavant to your question or what I asked!)
To stop users from disabling OneDrive sync, use
Group Policy (GPO),
Microsoft Intune, or registry edits to enforce policies. Key methods include enabling "Silently sign in users" and "Prevent users from syncing personal OneDrive accounts". For IT admins, enforcing configuration policies prevents users from accessing settings to pause or unlink their accounts.
Key Policies to Enforce (Group Policy/Intune):
- Prevent users from syncing personal OneDrive accounts: Set to Enabled.
- Silently sign in users to the OneDrive app with their Windows credentials: Ensures sync stays on.
- Prevent users from redirecting their Windows known folders to their PC: Restricts removing folder backups.
- Disable OneDrive from launching at startup: While not disabling it entirely, disabling this in Task Manager/Group Policy prevents easy user-level disabling.
Alternatives for Managed Environments:
- Microsoft 365 Admin Center: Use to set "Allow syncing only on PCs joined to specific domains".
- Registry Edit: Configure DisablePersonalSync to prevent personal account usage.
For individual computers, users can disable sync by navigating to
OneDrive Settings > Account > Unlink this PC. The above policy restrictions prevent these actions.
--------------------------
1.
Configure Group Policy (GPO) for Lockdown
Use these policies in your Active Directory or Intune environment to force OneDrive to remain active:
- Prevent users from unlinking their business account: This keeps the account connected to OneDrive.
- Prevent users from syncing personal OneDrive accounts: This prevents users from switching to a personal account, forcing them to use the corporate one.
- Silent account configuration: Use the policy "Silently sign in users to the OneDrive sync app with their Windows credentials" to ensure it starts automatically.
- Prevent usage for file storage: Enable "Prevent the usage of OneDrive for file storage" to manage the app via policy rather than user
Note: OneDrive is horribly intrusive and complex and its effects can catch people out. Personal view- and expressed by others: avoid.