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
cancel
Showing results for 
Search instead for 
Did you mean: 

Account Name rule creation with backslash

AadhithyanS
New Contributor
New Contributor

Hi Team,

I have requirement. Below are the conditions

if users saviynt username starts with PR then the account name should be generated as domain\users.systemusername

if users saviynt username starts with pr then the account name should be generated as domain\users.systemusername.

Can someone help me with this? I dont have any example query at the moment. I am trying to handle this from account name rule in the endpoint

12 REPLIES 12

naveenss
All-Star
All-Star

Hi @AadhithyanS please use the below query as an advanced config under endpoints account name rule. modify the query accordingly if required. 

case when users.username LIKE 'PR%' then concat('domain\',users.systemusername) else users.systemusername end

naveenss_0-1727336561978.png

Let me know if this helps!

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

@naveenss @NM 

the above query is not working. here is what i get when i request from ARS.

AadhithyanS_0-1727338416174.png

Below is the screenshot from the endpoint

AadhithyanS_1-1727338457636.png

Also if you see my original question these are two different domains so write another concat? if so i tried it and it didn't work. below is the query

case when users.username LIKE 'PR%' then concat('domain1\',users.systemusername) else concat('domain2\',users.systemusername) end

Please can you help asap this is bit urgent 

NM
Esteemed Contributor
Esteemed Contributor

@AadhithyanS  try this

case when users.username LIKE 'PR%' then concat('domain1\\',users.systemusername) else concat('domain2\\',users.systemusername) end


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

AadhithyanS
New Contributor
New Contributor

Hi @naveenss @NM 

Tried your query and it's working for only the first condition. so if the condition fails it still takes the first domain name and not going into the else condition. So i tried the below but still it's not working can you please advise

case when users.username like 'XX%' then concat('domain1\\',users.systemusername)

          when users.username like 'xx%' then concat('domain2\\'users.systemusername) else end

Also is it possible to use startsWith?

NM
Esteemed Contributor
Esteemed Contributor

Hi @AadhithyanS what is the difference between XX and xx value just the case of actually the value is different?


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

AadhithyanS
New Contributor
New Contributor

@NM it's just the case sensitive some have captial and some have lower case so based on this the domains gets assigned for capital domain1 and for lower domain2

NM
Esteemed Contributor
Esteemed Contributor

@AadhithyanS i believe this is what is creating an issue .. can you try one thing .. instead of lower case use a entirely different and see what is shows.


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

AadhithyanS
New Contributor
New Contributor

@NM That would work but this is our scenario. for some users the saviynt username starts with XX and for some it starts with xx case sensitive again not different value. so based on this the domains are assigned like the above which i told.

@AadhithyanS in the else part it should be users.systemusername

there is a typo in your query.

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

NM
Esteemed Contributor
Esteemed Contributor

@AadhithyanS please add the symbol in special characters field


If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'

AadhithyanS
New Contributor
New Contributor

@NM any advice i have updated what i need above

CASE 
    WHEN ASCII(SUBSTRING(users.username, 1, 1)) BETWEEN 65 AND 90 THEN  
        CASE 
            WHEN users.username LIKE 'XX%' THEN CONCAT('domain1\\', users.systemusername)
            WHEN users.username LIKE 'PR%' THEN CONCAT('domain\\', users.systemusername)
            ELSE NULL 
        END
    WHEN ASCII(SUBSTRING(users.username, 1, 1)) BETWEEN 97 AND 122 THEN  
        CASE 
            WHEN users.username LIKE 'xx%' THEN CONCAT('domain2\\', users.systemusername)
            WHEN users.username LIKE 'pr%' THEN CONCAT('domain\\', users.systemusername)
            ELSE NULL 
        END
    ELSE NULL 
END

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.