Orchestration Active Directory - Create and update AD Object

justx
Mega Expert

Hello community,

I've managed to create the AD user through Workflow (Orchestration) - Create AD Object, need help - I have some questions

Vivek helped me in the old thread.

Now I want to ask if anybody there could help me with the following:

When the user is created by the workflow I do not know how to make the workflow create AD User Email and Logon name

find_real_file.png

The above is created by the workflow.

And here everything is empty

find_real_file.png

When I create the user without the workflow, manually:

find_real_file.png

find_real_file.png

I want the workflow to create the logon name @company.com and create DOMAINname\username.
Also to populate First Name + Display name.

find_real_file.png

The above is my Create AD object.


Another thing which I want to know, is there any list with all workflow.inputs ?
How can I check what is inside u_user table ?
I understood about u_user.first_name and .last_name is taking from the table u_user the names, but how can I see if there is an option for Email ?


The missing attributes in the LDAP Viewer software I can see that the user manually created in the AD is having userPrincipalName , givenName, sn + displayName
But the created by the workflow is not having those attributes in the LDAP.

Any help will be highly appreciated.


Regards,
Niki

1 ACCEPTED SOLUTION

Hi Niki,



I believe the update AD activity looks for Samaccountname field in the AD. Samaccountname is a unique field in the AD. So before using update AD activity, add the Samaccountname field to Create AD activity itself.



"sAMAccountName":"${workflow.inputs.u_user.user_name}"



Once your account has samaccountname you won't get this error like missing



Regards,


Vivek


View solution in original post

19 REPLIES 19

justx
Mega Expert

I've managed to add the First + Last Name in the General tab.
I am looking for displayName + User Logon name@companyname.com



Thanks in advance,
Niki


"userPrincipalName" : "${workflow.inputs.u_user.email}" did the thing for the mail and logon name.


Hi Nikolay,



You can create a user with multiple AD fields, In my create AD activity I have the below AD fields.



{company:"The Test Company",givenName:"snowtest",sAMAccountName:"stest1117",sn:"test1211",mail:"snowtest.test1211@example.com",department:"


Information Technology",physicaldeliveryofficename:"Arlington",userprincipalname:"snowtest.test1211@example.com",title:"consultant",displayName:"snowtest test1117",manager:"CN=Test User,OU=Users,DC=mydomain,DC=local"}



Seems your u_user is referring to the user table. So you can use the variables like below (Not properly formatted)


Department - ${workflow.inputs.u_user.department}, Email - ${workflow.inputs.u_user.email}, Samaccountname, - ${workflow.inputs.u_user.user_name}, Title - ${workflow.inputs.u_user.title}, physicaldeliveryofficename: ${workflow.inputs.u_user.location}



Regards,


Vivek


Hello again Vivek,



Thank you for helping me again with those riddles for me.



The above information is very helpful and I will use it for sure, but now I am stucked on the Update AD Object.



Here is the situation:



When I created user in the Service NOW everything is fine, the workflow is creating automatically the AD User and populating all the information I need.
The logon name now is presented with @domainname.com and all good so far.



But when I change the Last Name in the ServiceNOW the Update AD Object is failing with the following error:



(&(objectClass=User)(samaccountname=Nikolay Tileffff)) could not be foundStack Trace:



I am changing the Last Name from Nikolay Tileff to Nikolay Tileffff and running the workflow I want to be changed in the AD.


The whole idea of the Update AD Object is to check if there are any changes on the already existing accounts and if something is changed to correct it automatically.



find_real_file.png


If each of these above are changed, the Update AD Object to correct it.



Here is how my Update AD Object looks so far:



find_real_file.png



And I think the Object name could be replaced to search by sys_id or something like that ?
Or can I use (samaccountname=${workflow.inputs.u_user.user_name}) for object name ?



Regards,
Niki