You can use regular expressions or wildcards to autodiscover user accounts by UPN. For example, you can use regular expressions to discover all user accounts that contain "sales" in their UPN. The regular expressions that you use are case sensitive.
When you use regular expressions or wildcards to autodiscover user accounts, user accounts that match the regular expressions or the wildcard pattern are automatically assigned to the user-defined user group for which you enter the regular expressions or wildcards. If a user account does not match the expressions, then it is automatically assigned to the default user group.
What the regular expression matches
Examples of UPN that match the regular expression
UPN that begin with "sales" followed by any number of any characters
UPN that begin with "J" or "T", followed by "im", and then followed by any number of any characters
UPN that begin with any character in the range of "a" through "k" inclusive, followed by "Lee", and then followed by any number of any characters
To skip the entire first name, find the first space and then discover users with last name beginning with the letters "A" through "E".
Before You Begin
Enable autodiscovery of user accounts, and then select Regex patterns. For more information, see Enabling Autodiscovery of User Accounts.
From the navigation pane, go to Protect > Applications > Office 365.
The Office 365 apps page appears.
Click the OneDrive for Business app.
The app page appears.
On the User groups tab, update an existing user group or create a user group:
To add regular expressions to an existing user group, right-click the user group, and then select Manage.
The user group page appears.
To add regular expressions to a new user group, in the upper-right corner of the page, click Add user group.
The Add user group page appears.
On the Regex patterns tab, click Add pattern.
The Add new content dialog box appears.
In the Regular expression box, type a regular expression or wildcard pattern, and then click Add.
You can enter multiple regular expressions or wildcard patterns.
What to Do Next
Run a backup operation on this user-defined user group to back up all the user accounts that have UPN that match the regular expressions or the wildcard patterns that you entered.