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

Print GID value in with incremented value in Active Directory

ShyamSrisailam
Regular Contributor
Regular Contributor

Hi All,

We have a requirement to create AD Groups through Saviynt. Once the request is submitted in Saviynt a group has to create in target (AD) which is working fine but while creating group it has to create with a unique GID value and it has to generate a new unique value for every AD Group creation happens from Saviynt.

Below is random group and the place where GID number has to populate in AD.

ShyamSrisailam_0-1698057177718.png

Connector Type: AD

Is there a way where we have to increment a number in createUpdateMappings ?

We tried using a random number which is working but we have a doubt that it might generate same number again. So, we are going with any other options where we can print a unique number.

"gidNumber": "${(int)(java.lang.Math.random()*(10000-1000+1)+100)}"

 

Thanks,

Shyam

Regards
SrisailamShyamSundarGoud
4 REPLIES 4

nimitdave
Saviynt Employee
Saviynt Employee

@ShyamSrisailam , your approach is correct here. Further see if UUID.randomUUID().toString() helps to reuse the redundancy.

ShyamSrisailam
Regular Contributor
Regular Contributor

Hi @nimitdave ,

do you want me to use the mentioned condition in createUpdateMappings in below format?

"gidNumber": "${UUID.randomUUID().toString()}"

 

Regards
SrisailamShyamSundarGoud

ShyamSrisailam
Regular Contributor
Regular Contributor

Hi @nimitdave 

I have tried with the below syntax but didn't work. Please let us know if this is the way I need to use this condition in createUpdateMapping OR let me know if there is any other syntax.

"gidNumber": "${UUID.randomUUID().toString()}"

 

Regards
SrisailamShyamSundarGoud

ShyamSrisailam
Regular Contributor
Regular Contributor

Since we don't have any option to auto increment. We have used rolekey and a random number to send a unique value in GID attribute when the group is created. and it is working fine.

"gidNumber": "${role.id}${(int)(java.lang.Math.random()*(10000-1000+1)+100)}",

 

Why to use both rolekey and random number?

          Role key is generating only 2 digits so we have appended with a random No so that at least it will push 4 - 5 digits of number in GID atrribute.

 

Regards
SrisailamShyamSundarGoud