Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

AccountExpires AD Attribute populate through dynamic attribute

Shubhamjain27
Regular Contributor II
Regular Contributor II

We want to populate the value from endDate dynamic attribute to the AD Account under accountexpires attribute.

Note: We are not mapping that attribute with user.enddate. Instead need to pass endDate in the create account JSON.

"accountExpires": "${endDate!=null?(10000*(endDate.getTime()+11644473600000)):'0' }",

It gives an error saying attribute conversion not possible.

It works fine when using using dynamic attribute usercolumn as enddate and passing user.enddate.

Please confirm the syntax when we cant use user.enddate.

8 REPLIES 8

NM
Honored Contributor II
Honored Contributor II

@Shubhamjain27 what is the type for that dynamic attribute?

Shubhamjain27
Regular Contributor II
Regular Contributor II

Date Type

NM
Honored Contributor II
Honored Contributor II

@Shubhamjain27 , try this .. remove ! Null condition and just pass this

10000*(endDate.getTime()+11644473600000)

Shubhamjain27
Regular Contributor II
Regular Contributor II

Still the same error. tried using new Date() as well but no luck.

NM
Honored Contributor II
Honored Contributor II

ahh.. our dev is down can't test it..

can you share your DA config?

NM
Honored Contributor II
Honored Contributor II

Hi @Shubhamjain27 , is the issue resolved?

stalluri
Valued Contributor II
Valued Contributor II

@Shubhamjain27 

"accountExpires": "${(new SimpleDateFormat('yyyy-MM-dd').parse(user.enddate).getTime() + 11644473600000L) * 10000L}"

If you what the dynamic attribute replace the user.enddate with it.
OR 

This will set current time to accountExpires in AD.

"accountExpires": "${(Calendar.getInstance().getTimeInMillis() + 11644473600000L)* 10000L}"




Best Regards,
Sam Talluri
If you find this a helpful response, kindly consider selecting Accept As Solution and clicking on the kudos button.

Raghu
All-Star
All-Star

@Shubhamjain27  try below

"accountExpires": "${user.enddate!=null?(10000*(user.enddate.getTime()+11644473600000)):'0' }",

or

"accountExpires": "${user?.enddate!=null?(10000*(user?.enddate.getTime()+11644473600000)):'0' }",

or

"accountExpires": "${(user.enddate != null) ? (10000*(user.enddate.getTime() + 7776000000 + 11644473600000)) : '0'}"

or

"accountExpires": "${(Calendar.getInstance().getTimeInMillis() + 11644473600000L)* 10000L}"


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.