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

Add-FolderSpecificAllowedActions

Use the Add-FolderSpecificAllowedActions cmdlet to add folder specific AllowedActions to an existing sync task.

Syntax

Add-FolderSpecificAllowedActions

  • -SyncTask
  • -FolderPath
  • [-PathDelimiter]
  • [-AllowSourceFolderCreate]
  • [-AllowTargetFolderCreate]
  • [-AllowSourceFolderDelete]
  • [-AllowTargetFolderDelete]
  • [-AllowSourceFolderModify]
  • [-AllowTargetFolderModify]
  • [-RestoreSourceFolderIfDeleted]
  • [-RestoreTargetFolderIfDeleted]
  • [-FolderPropertyPreference]
  • [-AllowSourceItemCreate]
  • [-AllowTargetItemCreate]
  • [-AllowSourceItemDelete]
  • [-AllowTargetItemDelete]
  • [-AllowSourceItemModify]
  • [-AllowTargetItemModify]

Add-FolderSpecificAllowedActions

  • -SyncTask
  • -FolderPattern
  • [-AllowSourceFolderCreate]
  • [-AllowTargetFolderCreate]
  • [-AllowSourceFolderDelete]
  • [-AllowTargetFolderDelete]
  • [-AllowSourceFolderModify]
  • [-AllowTargetFolderModify]
  • [-RestoreSourceFolderIfDeleted]
  • [-RestoreTargetFolderIfDeleted]
  • [-FolderPropertyPreference]
  • [-AllowSourceItemCreate]
  • [-AllowTargetItemCreate]
  • [-AllowSourceItemDelete]
  • [-AllowTargetItemDelete]
  • [-AllowSourceItemModify]
  • [-AllowTargetItemModify]

Description

This cmdlet is used to add synchronization AllowedActions to an existing SyncTask. An “AllowedActions” is what determines the direction of data flow, if any.

As a folder specific AllowedActions, the added element will only apply to the folder or folders that match the -FolderPath or -FolderPattern value provided.

You can view existing folder specific AllowedActions using the Get-SyncTask cmdlet. See the remarks and examples in Get-SyncTask for more details.

Through the use of folder specific AllowedActions, Super-ExMerge can be used to create a one-way sync of data, two-way sync, or a complex combination of options. Additionally, as a folder specific option, a SyncTask have have different synchronization AllowedActions for different folders in the same SyncTask.

Examples

Example 1
$task = Get-SyncTask | Select -First 1
Add-FolderSpecificAllowedActions -SyncTask $task -FolderPath '\Inbox' -AllowTargetFolderCreate -AllowTargetItemCreate -AllowTargetItemDelete -AllowTargetItemModify
Update-SyncTask -Task $task

This example retrieves the first SyncTask in the task queue and assigns it to the variable $task. The task is updated with an added set of AllowedActions for the ‘\Inbox’ folder. During sync, if the target store does not have an ‘\Inbox’ folder, the sync engine is now allowed to create the folder. Any items in the source ‘\Inbox’ that are new, modified, or deleted, are allowed to have the same operation performed on the target folder.
After the SyncTask is modified, it is updated in the task queue using Update-SyncTask.

This Example only applies these AllowedActions to the specific folder path entered: \Inbox

Example 2
$task = Get-SyncTask | Select -First 1
Add-FolderSpecificAllowedActions -SyncTask $task -FolderPattern 'Inbox$|Calendar$|Contacts
Update-SyncTask -Task $task

This example, similar to Example 1, adds a new folder specific sync right. This example uses a pattern matching routine to select the folders for which the AllowedActions apply. In this example, all folder paths that end with ‘Inbox’, ‘Calendar’, or ‘Contacts’ will be allowed to have their source items modified.

The pattern matching engine that is used is based on the .NET Framework regular expressions. This is also the same pattern matching engine that is used in PowerShell’s -match operator.

Parameters

-SyncTask

The SyncTask parameter is the task object in which the new folder specific AllowedActions are added.
This an instance of a SyncTask object is returned from either Get-SyncTask or New-SyncTask

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

-FolderPath

The FolderPath parameter is a text value that describes the full path of the folder that should have specific AllowedActions applied. The root of a folder path is the top of the connected store’s folder tree. For example, \Inbox\Important\From Alice.

Folder paths can be seen in the logs for a sync task, when run.

Required:Yes
Type:String
Aliases:None
Position:None (Name only)
Default Value:None

-PathDelimiter

The PathDelimiter parameter is used to define the character or string that is used to delimit folder names in a folder path string.
Example: -FolderPath @Inbox@Important@From Alice -PathDelimiter ‘@’

This can be valuable for cases where a folder name contains a backslash.

Required:No
Type:String
Aliases:None
Position:None (Name only)
Default Value:None

-FolderPattern

The FolderPattern parameter is a text value that is a .NET Regular Expression pattern that applies the specified sync AllowedActions to all folders that match the pattern.

The provided pattern is matched against each folder’s full path text.  As such, it is important to take the full folder path into consideration when creating the pattern.  For example, consider the following pattern, ‘Calendar’, which equates to: “any folder path containing the word ‘calendar’”
If a folder path were to exist as follows, \Inbox\Important\From Alice\Event Calendar\2019, the AllowedActions configured by this cmdlet would be applied to this folder.

In contrast, if only the main Calendar folder was intended to be selected, a the following pattern is more specific:  ^\\Calendar$.
Note that 2 back\slash characters are used.  This is required because the character is a special character for regular expressions and has to be ‘escaped’ by doubling it.  The ‘caret’ character (^) denotes the beginning of the text and the dollar sign ($) denotes the end of the string.  This pattern equates to “a folder path that starts with a backslash, followed by the word Calendar, and with no other characters afterwards”.

Multiple folders can be selected through the use of regular expressions, for example:  ^\\Calendar$|^\\Tasks$|^\\Invoices$

Required:Yes
Type:String
Aliases:None
Position:None (Name only)
Default Value:None

-AllowSourceFolderCreate

The AllowSourceFolderCreate switch parameter determines whether the matching folder is allowed to be created in the source store. This check is only made if the matching target folder exists and is seen as ‘new’, meaning never sync’d, which results in an attempt to create a folder in the source with the same name.

If this switch parameter is not present or is set to $false, the folder will not be created in the source store.

Required:No
Type:SwitchParameter
Aliases:asfc, csf, sfc
Position:None (Name only)
Default Value:False

-AllowTargetFolderCreate

The AllowTargetFolderCreate switch parameter determines whether the matching folder is allowed to be created in the target store. This check is only made if the matching source folder exists and is seen as ‘new’, meaning never sync’d, which results in an attempt to create a folder in the target with the same name.

If this switch parameter is not present or is set to $false, the folder will not be created in the target store.

Required:No
Type:SwitchParameter
Aliases:atfc, ctf, tfc
Position:None (Name only)
Default Value:False

-AllowSourceFolderDelete

The AllowSourceFolderDelete parameter determines whether a source folder can be deleted by the sync engine. When a matching target folder is found to have been deleted since the last sync, an attempt to delete the related folder in the source store is made, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, the matching folder(s) will not be deleted in the source store.

Required:No
Type:SwitchParameter
Aliases:asfd, dsf, sfd
Position:None (Name only)
Default Value:False

-AllowTargetFolderDelete

The AllowTargetFolderDelete parameter determines whether a target folder can be deleted by the sync engine. When a matching source folder is found to have been deleted since the last sync, an attempt to delete the related folder in the target store is made, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, the matching folder(s) will not be deleted in the target store.

Required:No
Type:SwitchParameter
Aliases:atfd, dtf, tfd
Position:None (Name only)
Default Value:False

-AllowSourceFolderModify

The AllowSourceFolderModify parameter determines whether a source folder can be modified by the sync engine. When a matching target folder is found to have been modified since the last sync, an attempt to modify properties of the related folder in the source store is made, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, the matching folder(s) will not be modified in the source store.

Required:No
Type:SwitchParameter
Aliases:asfm, msf, sfm
Position:None (Name only)
Default Value:False

-AllowTargetFolderModify

The AllowTargetFolderModify parameter determines whether a target folder can be modified by the sync engine. When a matching source folder is found to have been modified since the last sync, an attempt to modify properties of the related folder in the target store is made, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, the matching folder(s) will not be modified in the target store.

Required:No
Type:SwitchParameter
Aliases:atfm, mtf, tfm
Position:None (Name only)
Default Value:False

-RestoreSourceFolderIfDeleted

The RestoreSourceFolderIfDeleted parameter determines whether a source folder is re-created by the sync engine if it is found to be missing or deleted. When a matching target folder is found, but the related folder in the source store is missing or deleted the sync engine will attempt to re-create the folder, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, the matching folder(s) will not be re-created in the source store if found missing or deleted.

Required:No
Type:SwitchParameter
Aliases:rsf
Position:None (Name only)
Default Value:False

-RestoreTargetFolderIfDeleted

The RestoreTargetFolderIfDeleted parameter determines whether a target folder is re-created by the sync engine if it is found to be missing or deleted. When a matching source folder is found, but the related folder in the target store is missing or deleted the sync engine will attempt to re-create the folder, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, the matching folder(s) will not be re-created in the target store if found missing or deleted.

Required:No
Type:SwitchParameter
Aliases:rtf
Position:None (Name only)
Default Value:False

-AllowSourceItemCreate

The AllowSourceItemCreate parameter determines whether items can be created in a matching source folder. When the sync engine analyzes items in a matching target folder, any item that is seen as ‘new’ (meaning never sync’d) is set to be copied to the source folder, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, items in the matching folder(s) will not be copied to the source folder when found as new in the target.

Required:No
Type:SwitchParameter
Aliases:asic, sic, csi
Position:None (Name only)
Default Value:False

-AllowTargetItemCreate

The AllowTargetItemCreate parameter determines whether items can be created in a matching target folder. When the sync engine analyzes items in a matching source folder, any item that is seen as ‘new’ (meaning never sync’d) is set to be copied to the target folder, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, items in the matching folder(s) will not be copied to the target folder when found as new in the target.

Required:No
Type:SwitchParameter
Aliases:atic, tic, cti
Position:None (Name only)
Default Value:False

-AllowSourceItemDelete

The AllowSourceItemDelete parameter determines whether items can be deleted in a matching source folder. When the sync engine analyzes items in a matching target folder, any item that is seen as having been deleted since the last sync is set to be deleted in the target folder, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, items in the matching folder(s) will not be deleted in the source folder when found as deleted in the target.

Required:No
Type:SwitchParameter
Aliases:asid, sid, dsi
Position:None (Name only)
Default Value:False

-AllowTargetItemDelete

The AllowTargetItemDelete parameter determines whether items can be deleted in a matching target folder. When the sync engine analyzes items in a matching source folder, any item that is seen as having been deleted since the last sync is set to be deleted in the source folder, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, items in the matching folder(s) will not be deleted in the target folder when found as deleted in the source.

Required:No
Type:SwitchParameter
Aliases:atid, tid, dti
Position:None (Name only)
Default Value:False

-AllowSourceItemModify

The AllowSourceItemModify parameter determines whether items can be modified in a matching source folder. When the sync engine analyzes items in a matching target folder, any item that is seen as having been modified since the last sync is set to be modified in the source folder, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, items in the matching folder(s) will not be modified in the source folder when found as modified in the target.

Required:No
Type:SwitchParameter
Aliases:asim, sim, msi
Position:None (Name only)
Default Value:False

-AllowTargetItemModify

The AllowTargetItemModify parameter determines whether items can be modified in a matching target folder. When the sync engine analyzes items in a matching source folder, any item that is seen as having been modified since the last sync is set to be modified in the target folder, but is only allowed to do so if this parameter is true.

If this parameter is not present or set to $false, items in the matching folder(s) will not be modified in the target folder when found as modified in the source.

Required:No
Type:SwitchParameter
Aliases:atim, tim, mti
Position:None (Name only)
Default Value:False

Output

This cmdlet does not place any data on the pipeline.

How can we help?