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

AccountNameRUle issue in AD

RCreddy
New Contributor
New Contributor

Hello Team,

We have a requirement where if users employee type is IWT Contractor or IWT Full Time Employee and location is Remote then  OU should be ( OU=IWT,OU=Remote,OU=Standard Users,OU=EUC_Test,DC=test,DC=com) otherwise OU should be (OU=Remote,OU=Standard Users,OU=EUC_Test,DC=test,DC=com)

THis is the logic used in AccountNameRule 

CN=${if (user?.displayname != null && user?.displayname == '') {user?.displayname} else {user?.firstname + ' ' + user?.lastname}},OU=${if (user?.employeeType == 'IWT Contractor' || user?.employeeType == 'IWT Full Time Employee' || user?.location=='Remote') {'IWT,OU=Remote'} else if (user.customproperty44=='_Error'){'_Error'} else {user?.location + '_' + user?.locationnumber}},OU=Standard Users,OU=EUC_Test,DC=test,DC=com

Getting this error while trying with above logic 

Checking DN for CN=Test usertw, OU=IWT,OU=Remote,OU=Standard Users,OU=EUC_Test,DC=ads-pipe,DC=com.Not FOund DN for CN=Test usertw, OU=IWT,OU=Remote,OU=Standard Users,OU=EUC_Test,DC=ads-pipe,DC=com. Error while creating account in AD - Invalid name: CN=Test usertw, OU=IWT,OU=Remote,OU=Standard Users,OU=EUC_Test,DC=test,DC=com

Please let us know if anything missing, Thanks in Advance

7 REPLIES 7

rushikeshvartak
All-Star
All-Star

Does generated DN is correct?


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Hi @rushikeshvartak ,

Yes the generated DN is correct

pmahalle
All-Star
All-Star

Hi @RCreddy 

Issue might be because of the space coming in display name,  can you try with one user without space in display name? If that's the issue, you can try to escape the space using replace function like below and check once.

{user?.displayname.replace(' ', '\\')}

 


Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept As Solution to help other who may have a same problem. Give Kudos 🙂

Hi @pmahalle ,

Thanks for the reply

The space is not display name it is first name space last name.

SumathiSomala
All-Star
All-Star

@RCreddy What is the purpose of below condition?

as it's always executes the else part

(user?.displayname != null && user?.displayname == '') 

 

Regards,
Sumathi Somala
If this reply answered your question, please Accept As Solution and give Kudos.

Hi @SumathiSomala 

Thanks for the reply, tried by removing the condition but failed with same error.

RCreddy
New Contributor
New Contributor

@rushikeshvartak 

Any idea on this

Thanks in advance