How to search Vault entities by date

How to use the powerVault get-* cmdlets to search entities by date properties

In order to search Vault entities by date properties a full timestamp in the UTC format must be used. In order to specify the correct timestamp you have to know how some things about Vault date properties.

  • All date properties in Vault contain a date and a time stamp
  • If no specific time is specified Vault will create a time stamp at 11am. For example ("01/31/2022 11:00:00")
  • Some properties like _CheckInDatedate contain a full time stamp. It is not possible to search for those properties just by date. For example ("01/31/2022 09:12:58")

It is not possible to search for the "(date only)" or "(time only)" properties

powerVault multilanguage properties can't be used to search for dates. For example if you want to search for _CheckInDate you have to use 'Checked In' instead.

Universal Time(UTC)

Universal time is a date format that will modify a date based on your local computer settings. For example if a file was checked in in the time zone GMT+2 at 13:00 and the date is converted to UTC in time zone GMT+1 it will be changed to 12:00

Example

Searching for all files that have a user defined property 'Date_UDP' with the value 2022-01-02

The following sample code creates a date with the Get-Date cmdlet, then converts it to universal time and formats it as text in a format that can be used by Vault. This string is then used to search all files that have a matching date in the property 'Date_UDP'

$searchDate = Get-Date -Year 2022 -Month 01 -Day 02 -Hour 11 -Minute 0 -Second 0
$searchDateString = $searchDate .ToUniversalTime().ToString("MM/dd/yyyy HH:mm:ss")
$files = Get-VaultFiles -Properties @{ 'Date_UDP' = $searchDateString }

See Also