Checking the value of accountExpires in a Workflow
说明
It is possible in a Workflow to filter or check for explicit values of the accountExpires attribute, like 0 or 9223372036854775807, using the equals or does not equal operators. However, all attempts to check a date range in a Workflow using the greater or equal or less or equal operators fails. For example, a Workflow filter which is attempting to compare the changed value of accountExpires to the value of the Workflow time plus some number of days will always fail.
原因
This comparison must be performed against a scripted value.
解决办法
In order to compare the changed value of the accountExpires attribute to a date which is 365 days from today's date, create a script module which contains the following:
function convertTodaysDateAdd365($Request)
{
([datetime]::Today.AddDays(365)).tofiletime()
}
Perform the comparison against the value returned by this script module.