Create a Microsoft 365 plan for OneDrive for Business. The Microsoft 365 plan specifies which users and user groups are backed up, how long the data is retained, and which user and user groups are content indexed.
You will assign the Microsoft 365 plan to the users and user groups that you add to the OneDrive for Business app.
If some users and user groups have different backup requirements, you can create additional Microsoft 365 plans for OneDrive for Business.
Create a New Plan
-
From the navigation pane, go to Manage > Plans.
-
In the upper-right area of the page, click Create plan, and then select Office 365.
The Create Office 365 plan dialog box appears.
-
In the Plan name box, enter a name for the plan.
-
Under Retention settings, specify how long to retain the data:
-
To retain for an unlimited time, select Retain indefinitely.
-
To retain for a limited time, select Retain deleted items for, and then specify the amount of time.
-
-
To enable search on files, under Search settings, move the Content search toggle key to the right.
-
Click Save.
To include or exclude specific files and folders in your backup, edit the Microsoft 365 plan. From the plan page, in the OneDrive tile, click Edit. Create folder filters and file filters as per your backup requirements.
Exclude Specific Files or Folders from OneDrive Backups
You can use regular expressions or wildcards to back up files and folders by their names. For example, you can use a regular expression to back up all folders and files that contain "sales" in their names, such as "SalesQ3".
You can exclude specific files or folders from OneDrive backups by adding them in the Exclusions section of the Microsoft 365 plan. File or folder paths copied directly from the Failed Items list of a backup job might not work as-is. The exclusion path must be formatted correctly before adding it to the plan.
For example, if you want to exclude a specific file path, format it as follows:
Original path: \OneDrive\UserFolder\Documents\TestFile.docx
Formatted for exclusion: *UserFolder\Documents\TestFile.docx
Using Wildcards for Exclusions
You can use wildcards to simplify your exclusion entries and cover files that follow similar naming patterns.
-
Use
*(asterisk) to match zero or more characters.For example:
-
file*.txtmatchesfile.txt,file1.txt, orfileABC.txt. -
It does not match
file1.txtABCorfile1.pdf.
-
-
Use
?(question mark) to match exactly one character.For example:
-
file?.txtmatchesfile1.txtorfileA.txt. -
It does not match
fileABC.txt.
-
-
Combine
*and?for more flexible matching.For example:
-
log_??_*.csvmatcheslog_12_data.csvandlog_AB_2025.csv. -
It does not match
log_12_data.log.
-
-
Match files in a specific folder path by including the path before the pattern.
For example:
-
*\My Drive\RegTest3\File1*matches files such asMy Drive\RegTest3\File1.txtandMy Drive\RegTest3\File1AC.pdf. -
It does not match files outside that folder, such as
My Drive\File1.txt.
-
Important
- When no path is specified (as in the first three examples), the exclusion applies to any file that matches the pattern, regardless of its folder location.
- When a full or partial path is included, only files in that path are considered by the filter. Files with the same name in other folders are not excluded.