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
  • I'm not 100% sure what you mean but if you are talking about working with the results of a search activity, here's a trivial example.

    Suppose you made a search that finds users with physicaldeliveryofficename = "Chicago".

    You called the search "Find Chicago Users"

    Now you want to do something with the found users.

    Let's say you want to get their account expiration date and shove it in a file:

    In PoSh, you would implement something like this:

    Function GetFoundAccountExpires ($Request)
    {
    Add-Content "Expiration_Info.txt" -Value $($workflow.FoundObject("Find Chicago Users").get("accountexpires"))
    }

    That script containing the function would get called for each user found.

Reply
  • I'm not 100% sure what you mean but if you are talking about working with the results of a search activity, here's a trivial example.

    Suppose you made a search that finds users with physicaldeliveryofficename = "Chicago".

    You called the search "Find Chicago Users"

    Now you want to do something with the found users.

    Let's say you want to get their account expiration date and shove it in a file:

    In PoSh, you would implement something like this:

    Function GetFoundAccountExpires ($Request)
    {
    Add-Content "Expiration_Info.txt" -Value $($workflow.FoundObject("Find Chicago Users").get("accountexpires"))
    }

    That script containing the function would get called for each user found.

Children
No Data