Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

auto increment accountnamerule in AD connection object

varunpuri
Regular Contributor
Regular Contributor

Hi,

How can we auto increment the distinguishedName in AD generated through the accountNameRule defined at AD connection object level in Saviynt. As per the documentation, I am trying the following :

${"CN=" + user.lastname.toUpperCase() + "(" + user.departmentname.toUpperCase() + ")" + "\\, " + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + "(Priv Account)" + ",OU=Users,DC=abc,DC=pqr,DC=xyz"}###${"CN=" + user.lastname.toUpperCase() + "(" + user.departmentname.toUpperCase() + "1)" + "\\, " + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + "(Priv Account)" + ",OU=Users,DC=abc,DC=pqr,DC=xyz"}###${"CN=" + user.lastname.toUpperCase() + "(" + user.departmentname.toUpperCase() + "2)" + "\\, " + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + "(Priv Account)" + ",OU=Users,DC=abc,DC=pqr,DC=xyz"}###${"CN=" + user.lastname.toUpperCase() + "(" + user.departmentname.toUpperCase() + "3)" + "\\, " + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + "(Priv Account)" + ",OU=Users,DC=abc,DC=pqr,DC=xyz"}###${"CN=" + user.lastname.toUpperCase() + "(" + user.departmentname.toUpperCase() + "4)" + "\\, " + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + "(Priv Account)" + ",OU=Users,DC=abc,DC=pqr,DC=xyz"}###${"CN=" + user.lastname.toUpperCase() + "(" + user.departmentname.toUpperCase() + "5)" + "\\, " + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + "(Priv Account)" + ",OU=Users,DC=abc,DC=pqr,DC=xyz"}

But it is not working. While the rule is not throwing any error, in the case of duplicity also it generates the distinguishedName according to the first statement in above rule. So, essentially a duplicate distinguishedName gets generated every time for the same first and last name.

Kindly assist.

Best Regards,
Varun

2 REPLIES 2

nimitdave
Saviynt Employee
Saviynt Employee

Please try below:

${'CN=' + user.lastname.toUpperCase() + '(' + user.departmentname.toUpperCase() + ')' + '\\, ' + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + '(Priv Account)' + ',OU=Users,DC=abc,DC=pqr,DC=xyz'}###${'CN=' + user.lastname.toUpperCase() + '(' + user.departmentname.toUpperCase() + '1)' + '\\, ' + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + '(Priv Account)' + ',OU=Users,DC=abc,DC=pqr,DC=xyz'}###${'CN=' + user.lastname.toUpperCase() + '(' + user.departmentname.toUpperCase() + '2)' + '\\, ' + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + '(Priv Account)' + ',OU=Users,DC=abc,DC=pqr,DC=xyz'}###${'CN=' + user.lastname.toUpperCase() + '(' + user.departmentname.toUpperCase() + '3)' + '\\, ' + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + '(Priv Account)' + ',OU=Users,DC=abc,DC=pqr,DC=xyz'}###${'CN=' + user.lastname.toUpperCase() + '(' + user.departmentname.toUpperCase() + '4)' + '\\, ' + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + '(Priv Account)' + ',OU=Users,DC=abc,DC=pqr,DC=xyz'}###${'CN=' + user.lastname.toUpperCase() + '(' + user.departmentname.toUpperCase() + '5)' + '\\, ' + user.firstname.substring(0, 1).toUpperCase() + user.firstname.substring(1) + '(Priv Account)' + ',OU=Users,DC=abc,DC=pqr,DC=xyz'}

varunpuri
Regular Contributor
Regular Contributor

@nimitdave  - tried this already but it did not work. I was able to make it working by :

1. Changing the accountnamerule to the following :

 CN=${user.lastname.toUpperCase()}(${user.departmentname.toUpperCase()})\\, ${user.firstname.substring(0,1).toUpperCase()}${user.firstname.substring(1)}(Priv Account),OU=Users,DC=abc,DC=pqr,DC=xyz###CN=${user.lastname.toUpperCase()}(${user.departmentname.toUpperCase()}1)\\, ${user.firstname.substring(0,1).toUpperCase()}${user.firstname.substring(1)}(Priv Account),OU=Users,DC=abc,DC=pqr,DC=xyz###CN=${user.lastname.toUpperCase()}(${user.departmentname.toUpperCase()}2)\\, ${user.firstname.substring(0,1).toUpperCase()}${user.firstname.substring(1)}(Priv Account),OU=Users,DC=abc,DC=pqr,DC=xyz

2. Setting the REUSEINACTIVEACCOUNT to FALSE.

But I think, the catch here was REUSEINACTIVEACCOUNT, the JSON which I used earlier as well as the one shared by you, both should work fine too.

Best Regards,
Varun