1. Home
  2. Docs
  3. Super-ExMerge On-line Doc...
  4. PowerShell Cmdlet Referen...
  5. New-StartingFolder

New-StartingFolder

Use this cmdlet to define a pair of starting folders representing the top folder from a source and target store where the sync processing begins.

A SyncTask can have multiple starting folders defined. This cmdlet creates a single folder pair that can be added to a SyncTask’s StartingFolders property.

New-StartingFolder

  • -SourceFolderPath
  • -TargetFolderPath
  • [-QueueOrder]
  • [-IncludeSubfolders]
  • [-PathDelimiter]
  • [-TargetFolderCreateOption]

New-StartingFolder

  • -FolderPath
  • [-QueueOrder]
  • [-IncludeSubfolders]
  • [-PathDelimiter]
  • [-TargetFolderCreateOption]

Description

The New-StartingFolder cmdlet is used to define a non-default starting folder for a SyncTask. When a new SyncTask is created, the default starting folder is simply the root visible folder for the store type. There can be desire to sync only a specific folder or subtree in a given store. This cmdlet provides the mechanism to define such.

If there was a need to sync only the Calendar folder between a source and target mailbox, adding a StartingFolder with that definition would limit the synchronization session to that folder, and optionally its child folders.

Examples

Example 1
  New-StartingFolder -FolderPath \Inbox -IncludeSubfolders

This example will set the Inbox folder as the starting folder in both the source and target stores. The -IncludeSubfolders switch parameter is used to indicate that the children of the Inbox should be processed in addition to the Inbox folder itself.

Example 2
  New-StartingFolder -SourceFolderPath \{Calendar} -TargetFolderPath \Archives\BU-100023\John.Smith\Calendar

This example will set the starting folder to the Calendar folder from the source store, using the language-agnostic TokenizedPath of {Calendar} and will merge and sync that folder into the \Archives\BU-100023\John.Smith\Calendar folder of the target store.
The cmdlet does not have the -IncludeSubfolders switch parameter and will not process child folders of the selected folders.

Example 3
  
$first = New-StartingFolder -FolderPath \Inbox -QueuePosition 0
$second = New-StartingFolder -FolderPath \ -QueuePosition 100 -IncludeSubfolders

This example creates two starting folder objects. If both of these objects are added to a SyncTask’s StartingFolders property, the $first object, which will limit the sync to only the Inbox folder and which has a QueuePosition of zero will be processed first by the sync engine. Then the $second object will be processed, which will process all folders and their children in each store, including the Inbox.

This example shows how to set priority of specific folders in a sync session that will ultimately process the whole store. When the sync engine reprocesses the Inbox the second time, it will simply perform a delta-sync, and will most likely skip all items as “no change”.


Parameters

-SourceFolderPath

The SourceFolderPath parameter specifies the path of the Starting folder a source store in a SyncTask.
Note that folder paths in this cmdlet can be either explicitly named paths, or can be TokenizedPaths.

Required:
Yes
Type:
String
Aliases:
None
Position:
0
Default Value:
None

-TargetFolderPath

The TargetFolderPath parameter specifies the path of the Starting folder a target store in a SyncTask.
Note that folder paths in this cmdlet can be either explicitly named paths, or can be TokenizedPaths.

Required:
Yes
Type:
String
Aliases:
None
Position:
1
Default Value:
None

-FolderPath

The FolderPath parameter specifies the path of the Starting folder for both the source and target stores in a SyncTask. This is a convenience method to avoid having to type the same path twice. The same result is achieved by setting the -SourceFolderPath and -TargetFolderPath to the same value.
Note that folder paths in this cmdlet can be either explicitly named paths, or can be TokenizedPaths.

Required:
Yes
Type:
String
Aliases:
None
Position:
0
Default Value:
None

-QueueOrder

The QueueOrder parameter specifies the position in the order of staring folders of a SyncTask.
The QueueOrder parameter is not required to be unique; multiple starting folders may have the same QueuePosition, in which case they are in the order in which they were added.

Required:
No
Type:
Int32
Aliases:
None
Position:
2 (IndividualsStores); 1 (BothStores)
Default Value:
0

-PathDelimiter

The PathDelimiter parameter specifies the character used in the folder path parameters that separates folder names. The default value is a back\slash. If a folder name has a backslash, a backtick ‘`’ character can be used to instruct the sync engine to consider that character as part of the folder name. For example a folder named ‘Good\Bad’ should be written as ‘Good`\Bad’ if used in a folder path.
Alternatively, a different delimiter can be used and set on this parameter, as follows: ^Inbox^MyReports^Completed\Cancelled. In this example, there is no need to escape the backslash because the folder delimiter is the carat ‘^’ character.

Required:
No
Type:
String
Aliases:
None
Position:
Not a positioned parameter. Use by name only.
Default Value:
\

-TargetFolderCreateOption

The TargetFolderCreateOption parameter specifies how the source folder should be handled in relation to the target.

This parameter accepts one of three possible values: CreateFullPath, CreateFolderName, MergeWithTarget.

CreateFullPath:
This option will create the full path of the selected source folder as a child path of the value provided for the target path.

CreateFolderName:
This option will create only the source folders name (the last folder in the path) as a child of the value provided for the target path.

MergeWithTarget:
This option will merge the source folder with the folder identified by the target path, even if they have different names.

Required:
No
Type:
Enum [FolderSyncPair.FolderCreateOptions]
Aliases:
None
Position:
Not a positioned parameter. Use by name only.
Default Value:
Varies by usage. If a single folder path is provided, this value is CreateFullPath. If two folder paths are provided, this value is MergeWithTarget.

Output

This cmdlet will place a FolderSyncPair object on the pipeline.

How can we help?