AutoDiscovery patterns for SharePoint folders
Who is this article for?
Users responsible for setting up filing Locations.
Shared config access is required.
This article contains information about all the elements you need to be familiar with when setting up AutoDiscovery for SharePoint sites.
1. Files
| Name | Description |
|---|---|
| MailManager.Autodiscovery.exe | Used to test the configurations. Located in: ...\Mail Manager\Program Files\x64 |
| AutoDiscoverySharePoint.txt | Contains the configuration patterns. Sample file located in: …\Mail Manager\Program Files\Sample\Mail Manager Config |
| Generated collections files | Created after running MailManager.Autodiscovery.exe. Used for checking and using with the Collections.txt as an alternative to using auto discovery. Files created in: %Temp%\Mail Manager\AutoDiscovery\SharePoint\Collections |
2. Configuration patterns
You can use a combination of any of the following elements when editing AutoDiscoverySharePoint.txt.
2.1. Hierarchy components
| Component | Description |
|---|---|
| Consolidation | Groups multiple directories into a single collection. Must be named, but doesn't need to include [C]. Must be the first hierarchy in the configuration and followed by Site. |
| Site | Cannot be followed by Folder. |
| DocLib | Document Library. Must be between Site and Folder. |
| Folder | Must be after a DocLib. |
2.2. Hierarchy separators
| Separator | Description |
|---|---|
| / | Separates the different hierarchy levels. |
| | | Separates components (e.g. Name). Hierarchy component must be the first thing in each level. |
2.3. Identifiers
| Name | Tag | Description |
|---|---|---|
| Collection | [C] | Specifies the Mail Manager Collection name. Must be before [D]. |
| Description | [D] | Specifies the Mail Manager Description name. Must be after [C] or Consolidation. Additional description [D] levels can not be applied. All folders after the [D] tag must be named. |
| Target | [T] | Option - Filing Location folder is always the last level. Can be a DocLib or Folder. |
2.4. Additional tags
| Name | Tag | Description |
|---|---|---|
| Partial | [P] | Can be applied to Named levels only. Performs a partial name match. For example, "Cont" will discover "Contoso", "Conteso", "osoCont", "o Cont os". By default, if the level is missing a [P] tag, it will discover structures looking for a full match. Levels after the description cannot be Partial. |
| Case Insensitive | [CI] | Can be applied to Named levels only. Performs case insensitive matching. Works both for Partial and Full name match. For example, "CoNtOsO" will discover "Contoso", "contoso", "CONTOSO". |
| Description Prefix | [DP] | Name of the discovered level appended to the right of the description [D] level |
| URL | [URL] | Looks for a text string in the path. Must include a string (e.g.: |\teams\) and use backward slashes, as they get converted into forward slashes in the search string. The string is always partial. |
| Followed Sites | [F] |
Discovery will still follow most of the regular rules, but it will look only for Sites which the authenticated user has followed. To activate it, add [F] at the first Site level in a setup or add DiscoverOnlyFollowedSites=1 in the EmailFiling.cfg. Differences between looking for Followed versus Regular Site:
|
| Discover and Rename | [R] |
Implemented only in the tester GUI for now. What the above will do is the following:
The program will continue going through the sequence until it finds a matching Folder. If it doesn’t find any named Folder in the sequence, it won’t return any Location. For now, [D] and [T] have to be on the final Folder level. Leading to the final Folder level, you can still find and rename other Folders. |
| Create Folder | [CF] |
Used via the Autodiscovery Testing Tool to create missing Folders where the path matches the autodiscovery pattern but the target folder does not exist. In the below example a folder called 'Correspondence' would be created at the Target level.
In order for this to work the [D] and [T] tags have to both be on the final Folder level during execution. Once this has been run in the testing tool you should be able to view the newly created folder in Sharepoint. |
| Unloaded | [U] |
Must be combined with [C]. First time the Collection is added to the client database, it will include the unloaded flag, i.e. the collection light bulb is greyed out in the Location tool. |
| Search Only | [SO] |
Must be combined with [C]. Locations associated with the Collection will have a "Usage" of Search. |
| Ignore | [I] | Ignore all folders that match the full specified string. Case sensitive by default. For example, "Folder | [I] | Accounting" will discover every folder other than the ones named "Accounting". |
| Ignore Partial | [P] | [I] | Ignore all folders that contain the specified string in any part of the name. Case sensitive by default. For example, "Folder | [P] | [I] | sys" will discover every folder that does not contain "sys". "sysAdmin", "Testsys", "AsysB" will not be discovered. |
| Ignore Prefix | [IP] | Ignore all folders that start with the specified string. For example, "Folder | [IP] | [CI] | .a" will discover every folder that does not start with ".a" or ".A". |
| Ignore Suffix | [IS] | Ignores all folders that end with the specified string. For example, "Folder | [IS] | [CI] | old" will discover every folder that does not end with "old". |
2.5 Example
Below pattern would create a Collection called "Customer".
Site | Mail Manager / DocLib|Documents / Folder|Customer|[C] / Folder|[D] / Folder|Emails|[T]
Modifying more than one Collection at the same time?
You can configure multiple elements by separating them with a new line.
Be careful that the same Collection name, followed by the tag [C], is not specified in multiple lines or setups. Collections with the same name will be overwritten by the last one in the list.
Specifying the name of a level of an Auto Discovery path means auto discovery will specifically look for this name. If a part of the setup is not named then Auto Discovery will treat this as a wildcard and search all folders at that level
The above pattern could also be written as the following, using the Consolidation component, if the Collection name "Customer" was already taken:
Consolidation|CustomerCollection|[C] / Site | Mail Manager / DocLib|Documents / Folder|Customer / Folder|[D] / Folder|Emails|[T]