You open a folder synced with OneDrive and see files named like “Q4_Budget-DESKTOP-ABC123.xlsx” or “Meeting_Notes-LAPTOP-XYZ456.docx.” This happens when OneDrive appends your computer name to the file name. The cause is a conflict resolution feature inside OneDrive that renames files when it detects a sync conflict between two devices. This article explains why OneDrive appends the computer name to your files and provides a step-by-step fix using the Microsoft 365 admin center to stop this behavior.
Key Takeaways: Stop OneDrive From Adding Computer Name to File Names
- Microsoft 365 admin center > Settings > Org settings > OneDrive > Sync: Controls tenant-wide sync restrictions, file type blocking, and Known Folder Move behavior.
- SharePoint Online Management Shell cmdlet Set-SPOTenantSyncClientRestriction: Disables the conflict-rename feature that appends the computer name.
- OneDrive settings > Sync and backup > Advanced settings > Files On-Demand: Setting that controls whether files are downloaded on demand or kept locally; not directly related but often mistaken as the cause.
Why OneDrive Appends the Computer Name to File Names
OneDrive for Business uses a conflict resolution mechanism to handle situations where two users or two devices edit the same file at nearly the same time. When a sync conflict occurs, OneDrive keeps both versions of the file. It renames one copy by appending the computer name of the device that saved the change. This ensures no data is lost during sync conflicts. However, this behavior can be triggered incorrectly if sync is interrupted, if a file is left open on one device while another device tries to sync, or if the OneDrive sync client detects a file change that it cannot reconcile. The result is a duplicate file name that includes the computer name, such as “Report-DESKTOP-ABC123.docx.” This is not a bug. It is a deliberate safety feature designed to prevent data loss. But for many organizations, this renaming creates confusion and extra cleanup work.
The Sync Conflict Detection Process
OneDrive checks the file modification time, size, and content hash during every sync cycle. If two changes arrive for the same file within a few seconds, OneDrive cannot merge them automatically. It marks one version as the winner and renames the losing version. The renamed file gets the computer name appended. This happens most often when a file is saved on one device while the same file is still open on another device. It also happens when a mobile device uploads a photo while the desktop version of the same photo is still syncing.
When the Computer Name Is Not the Issue
Some users see computer-name suffixes on files that were never in conflict. This can occur if a user manually renames a file on one device while the sync client is still processing. The client interprets the rename as a new file and the old file as still existing, creating a duplicate. In this case, the duplicate is not a true conflict, but the sync client still renames it to avoid overwriting. The fix for both scenarios is the same: disable the conflict-rename behavior at the tenant level.
Steps to Stop OneDrive From Adding Computer Name to Duplicate Files
You must use the SharePoint Online Management Shell to disable the conflict-rename feature. This change applies to your entire Microsoft 365 tenant. No individual user setting exists for this behavior. You need the SharePoint Online Management Shell module installed and global admin or SharePoint admin permissions.
Install the SharePoint Online Management Shell
- Open Windows PowerShell as administrator
Right-click the Start button and select Windows PowerShell Admin or Terminal Admin. Confirm the User Account Control prompt. - Check if the module is already installed
Run the commandGet-Module -ListAvailable -Name Microsoft.Online.SharePoint.PowerShell. If the module appears, skip to step 4. If nothing appears, continue to step 3. - Install the SharePoint Online Management Shell
RunInstall-Module -Name Microsoft.Online.SharePoint.PowerShell. Type Y to confirm the installation from PSGallery. Wait for the installation to finish. - Connect to SharePoint Online
RunConnect-SPOService -Url https://yourdomain-admin.sharepoint.com. Replaceyourdomainwith your actual tenant domain. Sign in with a global admin or SharePoint admin account.
Disable the Conflict-Rename Feature
- Get the current tenant sync settings
RunGet-SPOTenantSyncClientRestriction. Look at the value of theExcludedFileExtensionsproperty. If it is empty, you have no file-type exclusions set yet. - Disable the conflict-rename behavior
RunSet-SPOTenantSyncClientRestriction -DisableReporting $true -ExcludedFileExtensions "". This command disables the sync client restriction reporting and clears any existing file-type exclusions. The key effect is that it stops the sync client from renaming files with the computer name on conflict. - Verify the change
RunGet-SPOTenantSyncClientRestrictionagain. Confirm that theDisableReportingvalue is nowTrue. - Wait for propagation
The change can take up to 24 hours to reach all sync clients. You do not need to restart any devices. Users will see the change after the next full sync cycle.
If OneDrive Still Creates Duplicate Files After the Fix
OneDrive still appends the computer name to files
If the computer name still appears on files after 24 hours, check that the PowerShell command ran without errors. Rerun Set-SPOTenantSyncClientRestriction -DisableReporting $true. Then ask a user to pause and resume OneDrive sync. Right-click the OneDrive icon in the notification area, select Pause syncing for 2 hours, then click Resume syncing. This forces a full re-sync and applies the new tenant policy.
Duplicate files appear without the computer name
If you see duplicate files that do not have the computer name appended, the cause is different. This usually happens when a file is saved to two different OneDrive folders or when a file is manually copied. Check the file path for both copies. If they are in different folders, delete the unwanted copy. To prevent this, educate users to save files only to the correct OneDrive folder and avoid dragging files between sync folders.
Users report files missing after the fix
Disabling the conflict-rename feature does not delete files. It only stops future renaming. Existing files with computer names in their file names remain. Users must manually delete or rename those old duplicates. Search for files containing the computer name by using Windows File Explorer search with the string DESKTOP- or LAPTOP- and the specific computer name suffix. Delete the duplicates after verifying the original file is intact.
Files On-Demand vs Conflict Renaming: Key Differences
| Item | Files On-Demand | Conflict Renaming |
|---|---|---|
| Description | Controls whether files are downloaded to the device or remain as online-only placeholders | Controls whether OneDrive renames files when a sync conflict occurs |
| User setting location | OneDrive settings > Sync and backup > Advanced settings > Files On-Demand | No user setting exists; controlled tenant-wide via PowerShell |
| Effect on file names | Does not change file names | Appends computer name to the losing version of a file during conflict |
| Typical trigger | User toggles the feature in OneDrive settings | Sync conflict between two devices or interrupted sync cycle |
| Admin control | No admin control; each user sets their own preference | Admin uses Set-SPOTenantSyncClientRestriction to disable |
You can now stop OneDrive from appending the computer name to duplicate files by using the SharePoint Online Management Shell. Run the Set-SPOTenantSyncClientRestriction -DisableReporting $true command and wait up to 24 hours for the change to propagate. After the fix, check for any existing duplicate files and clean them up manually. For ongoing management, monitor the Microsoft 365 admin center audit log for sync conflict events to identify users who frequently trigger the rename behavior.