This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

finding an attribute from within a scheduled workflow with powershell - msds-userpasswordexpirytimecomputed

Hi, 

I'm working on a password expiry notification, using ARS 7.0 workflow interface.

First, I use a find activity to scope certain users.

Then, I'd like to use an if-then branch, to evaluate the msds-userpasswordexpirytimecomputed property.

From what I've read, this value is a number that can't be evaluated by the "workflow computed" date and time.

I found this in the community that does essentially what I'm looking for in an even-driven workflow:

function onpremodify($Request)
{
$integerDate = $Request.Get('expires')
$convertedDate = [datetime]::fromfiletime($integerDate)
return $convertedDate
}

Except I'm trying to convert the msds-userpasswordexpirytimecomputed value.

That would (if it worked) convert the property to a text value, that can be evaluated by the workflow computed date.

However, I can't seem to find logic that actually returns meaningful data to the workflow. This code just returns an error: "Object reference not set to an instance of an object"

Though I've tried several iterations of function name, $Reference and $Dirobj, can't seem to return a usable value to the workflow.

Is this do-able?

Thanks so much for any thoughts.

 

Parents
  • Was just looking at including that expiry time attribute you cited in a workflow If-Else. The If-Else understands that this is a date-time and for the "Value to compare to" it offers "Fixed date and time", "Workflow date and time" etc. If you look at the option "Value generated by rule expression", there's an option in there to obtain a value from a script. So for example, you could calculate $(Get-Date.AddDays(30)) to compare your expiration with 30 days from today and have the workflow If-Else compare to that.
Reply
  • Was just looking at including that expiry time attribute you cited in a workflow If-Else. The If-Else understands that this is a date-time and for the "Value to compare to" it offers "Fixed date and time", "Workflow date and time" etc. If you look at the option "Value generated by rule expression", there's an option in there to obtain a value from a script. So for example, you could calculate $(Get-Date.AddDays(30)) to compare your expiration with 30 days from today and have the workflow If-Else compare to that.
Children
No Data