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

New-DateRange

Use this cmdlet to create a new date range object to control which items are synchronized, by comparing the items’ modified date to a specific range.

IMPORTANT! Super-ExMerge only uses the last modification date of items in its comparisons. It does not use sent or received dates, or any other date values. Additionally, Microsoft Exchange controls the modified date – it is a read-only value.
Creating or modifying items in a PST file, however, do not cause dates to change. As such, date range filtering in a PST file may have mixed results depending on the tools and process used to place data in the PST file. Super-ExMerge will set the last modified time on items in a PST, but the same may not be true for other tools, including Microsoft’s.

New-DateRange

  • -RangeTop
  • -RangeBottom

    New-DateRange

    • -DateTop
    • -DateBottom

      Description

      The New-DateRange cmdlet creates a DateRangeOption class instance that can be set on a SyncTask object. When processing items, Super-ExMerge will compare the last modification date of each item to the configured date range, and if within the range will process the item. If the item falls outside of the range, the item is ignored.

      The New-DateRange cmdlet operates in two modes: Days and Dates.
      In the ‘Days’ mode, only numeric values are provided and define a number of ‘days’ from the date the sync executes.
      In the ‘Dates’ mode, specific date values are provided to specify the date range period.

      Note that the ranges can be inclusive or exclusive. See examples for detail.

      Examples

      Example 1
        New-DateRange -RangeTop 0 -RangeBottom 90
      

      This example specifies an inclusive range of days. Items that have a modified date within the last 90 days will be processed.

      Example 2
        New-DateRange -RangeTop 90 -RangeBottom 30
      

      This example shows a exclusive date range. This example will cause items modified between 30 and 90 days old to be skipped, while all other items are processed.

      Example 3
        New-DateRange -UseDatesForRange -DateTop '2019-01-01' -DateBottom '2018-01-01'
      

      This example shows an inclusive range using specific dates. Items modified between January 1, 2018 and January 1, 2019 will be processed. The date values provided are always included in the check, so items modified on January 1, 2019 or January 1, 2020 will be processed as well.

      The date format can be any string date format that is accepted by the .NET framework. This example use the yyyy-MM-dd format.


      Parameters

      -UseDatesForRanges

      The UseDateForRanges switch parameter specifies determines whether the top and bottom of the range uses date values or integer values representing ‘days old’.

      Required:
      Yes
      Type:
      SwitchParameter
      Aliases:
      None
      Position:
      Not a positioned parameter. Use by name only.
      Default Value:
      False

      -RangeTop

      The RangeTop parameter is only used with the UseDatesForRange switch parameter is missing or set to $false.
      The RangeTop parameter is a non-negative number that defines the top of the date range. The current date, at the time of synchronization, is incremented by the number of days of this number and the resulting date is compared to the last modified date of the item. If the item’s last modified date is on or before the calculated date then the item is processed. If the item’s modified date is after the calculated date, the item is skipped.

      Required:
      Yes
      Type:
      UInt16
      Aliases:
      None
      Position:
      Not a positioned parameter. Use by name only.
      Default Value:
      0

      -RangeBottom

      The RangeBottom parameter is only used with the UseDatesForRange switch parameter is missing or set to $false.
      The RangeBottom parameter is a non-negative number that defines the bottom of the date range. The current date, at the time of synchronization, is incremented by the number of days of this number and the resulting date is compared to the last modified date of the item. If the item’s last modified date is on or after the calculated date then the item is processed. If the item’s modified date is before the calculated date, the item is skipped.

      Required:
      Yes
      Type:
      UInt16
      Aliases:
      None
      Position:
      Not a positioned parameter. Use by name only.
      Default Value:
      0

      -DateTop

      The DateTop parameter is only used with the UseDatesForRange switch parameter is set.
      The DateTop parameter is a date value that defines the top of the date range. If the item’s last modified date is on or before this date then the item is processed. If the item’s modified date is after this date, the item is skipped.

      Required:
      Yes
      Type:
      DateTime
      Aliases:
      None
      Position:
      Not a positioned parameter. Use by name only.
      Default Value:
      DateTime.MinValue (0001-01-01T00:00:00)

      -DateBottom

      The DateBottom parameter is only used with the UseDatesForRange switch parameter is set.
      The DateBottom parameter is a date value that defines the bottom of the date range. If the item’s last modified date is on or after this date then the item is processed. If the item’s modified date is before this date, the item is skipped.

      Required:
      Yes
      Type:
      DateTime
      Aliases:
      None
      Position:
      Not a positioned parameter. Use by name only.
      Default Value:
      DateTime.MinValue (0001-01-01T00:00:00)

      Output

      This cmdlet places an instance of a DateRangeOption object on the pipeline. This object can be use with the New-SyncTask and Set-SyncTask cmdlets.

      How can we help?