Leveraging Intelligent Recommendations for Operational Transformation. AMS Partners click HERE | EMEA/APJ Partners click HERE |
04/12/2022 01:03 PM
Hi,
Can we calculate current year and date in Disable AccountJSON and also format it in ddmmyyyy format to GMT timezone?
Thanks and Regards,
Rituparna Das
Solved! Go to Solution.
04/12/2022 02:14 PM
Hi Rituparna,
Greetings!!
In which attribute in AD, you are trying to push such value. Are you planning to push this Value in any attribute in AD with datatype string?
Because, generally we push such values in accountExpires attribute at AD and it doesn't except such value. It is of Interval data type and expects time in nano Second interval.This value represents the number of 100-nanosecond intervals since January 1, 1601 (UTC).
A sample example Here:
"accountExpires": "${ Date today = new Date();(10000*(today.getTime() + 15552000000 + 11644473600000))}"
Thanks & Regards,
Anand Kumar Jha
04/12/2022 02:14 PM
Hi Anand,
Yes we have two use cases
1. Update the description field of AD with date in dd/mm/yyyy format of GMT timezone
2. Need to put an if else logic on moveusertoOU to check if it is in Jan-Apr put in A OU and for others in B OU.
Thanks and Regards,
Rituparna Das
04/12/2022 02:14 PM
Hi Rituparna,
Greetings!!
You could do both things.
Thanks & Regards,
Anand Kumar Jha
04/12/2022 02:14 PM
Hi Anand,
Can you help me with sample codes for these two please?
Appreciate your quick response.
Thanks and Regards,
Rituparna Das
04/12/2022 02:14 PM
Hi Rituparna,
Greetings!!
I could help you with sample below:
"Description": "${ Date today = new Date();}"
You could write similar java in value section to return a value as per your requirement.
"moveUserToOU": "${if(user?.street.equals('US') && user?.customproperty29.equals('saviyntlabs.org'))'OU=TestContainer,DC=saviyntlabs,DC=org' else if (user?.street.equals('US') && user?.customproperty29.equals('child.saviyntlabs.org')) 'OU=TestContainer,DC=child,DC=saviyntlabs,DC=org' else if (!user?.street.equals('US') && user?.customproperty29.equals('child.saviyntlabs.org')) 'CN=Users,DC=child,DC=saviyntlabs,DC=org' else 'CN=Users,DC=saviyntlabs,DC=org'}"
Thanks & Regards,
Anand Kumar Jha
04/12/2022 02:14 PM
Hi Anand,
I have put the below config for the same use case in Disable JSON but encountering error in saviynt.
Disable Account JSON:
{
"moveUsertoOU":"(new Date().format('MM')=='01'||new Date().format('MM')=='02'||new Date().format('MM')=='03')?'OU=Q1,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com':((new Date().format('MM')=='04'||new Date().format('MM')=='05'||new Date().format('MM')=='06')?'OU=Q2,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com':((new Date().format('MM')=='07'||new Date().format('MM')=='08'||new Date().format('MM')=='09')?'OU=Q3,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com':'OU=Q4,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com'))",
"deleteAllGroups":"No",
"userAccountControl":"514",
"description":"${user.customproperty55=='ST'?'Account Status set to Disable Term '+new Date().format('MM/dd/yyyy'):'Account Status set to Remove Term '+new Date().format('MM/dd/yyyy')}"
}
Error:
Error Disablng the Account from AD -
javax.naming.InvalidNameException: CN=Sav0108\, Pwc (pwcsav08),(new Date().format('MM')=='01'||new Date().format('MM')=='02'||new Date().format('MM')=='03')?'OU=Q1,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com':((new Date().format('MM')=='04'||new Date().format('MM')=='05'||new Date().format('MM')=='06')?'OU=Q2,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com':((new Date().format('MM')=='07'||new Date().format('MM')=='08'||new Date().format('MM')=='09')?'OU=Q3,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com':'OU=Q4,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com')): [LDAP: error code 34 - 0000208F: LdapErr: DSID-0C090808, comment: Error processing name, data 0, v2580 ]; remaining name 'CN=Sav0108\, Pwc (pwcsav08),(new Date().format('MM')=='01'||new Date().format('MM')=='02'||new Date().format('MM')=='03')?'OU=Q1,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com':((new Date().format('MM')=='04'||new Date().format('MM')=='05'||new Date().format('MM')=='06')?'OU=Q2,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com':((new Date().format('MM')=='07'||new Date().format('MM')=='08'||new Date().format('MM')=='09')?'OU=Q3,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com':'OU=Q4,OU='+(new Date().format('yyyy'))+',OU=Disable Users,OU=Region-Saviynt,DC=dev,DC=company,DC=com'))'
Thanks and Regards,
Rituparna Das
04/12/2022 02:14 PM
Hi Rituparna,
Greetings!!
The conditional evaluation for moveUserToOU is not correct.
You should have conditions defined to determine a container/OU in AD for this control.
Thanks & Regards,
Anand Kumar Jha