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
  • Couple of things:

    1) Make sure you have spelled the name of the Find Activity correctly in your FoundObject parameter.
    2) Suggest double quotes around the attribute name.
    3) If it still doesn't work, change the attribute to something common like distinguishedname. I have a feeling that the search is not going to return your attribute as part of a found user object. You will probably have to make a subsequent Get-QADUser call using the returned found object's distinguishedname as the identity in order to get the actual attribute you want.
Reply
  • Couple of things:

    1) Make sure you have spelled the name of the Find Activity correctly in your FoundObject parameter.
    2) Suggest double quotes around the attribute name.
    3) If it still doesn't work, change the attribute to something common like distinguishedname. I have a feeling that the search is not going to return your attribute as part of a found user object. You will probably have to make a subsequent Get-QADUser call using the returned found object's distinguishedname as the identity in order to get the actual attribute you want.
Children
No Data