Question

Employee Onboarding Manager field to Microsoft AD

  • 4 May 2023
  • 7 replies
  • 230 views

Userlevel 1
Badge +4

Hello,

My onboarding is working and creating a user in the correct OU in AD. It also fills in most of their information. However, for the “manager” field, if I use their John Doe name it won’t work and throws an error saying that it can’t find such a name. If I use JDoe it works fine, but this field pulls from Freshservice a list of all the managers and is a dropdown on the onboarding form. I’m not sure why it’s not working, because the full name is the distinguished name.

 

In other words, only the SAM account name will work in that field, not the actual name. What am I doing wrong?


7 replies

Userlevel 7
Badge +16

Hello @Gerald usually the distinguished name is more complex than just the full name. For example (pulled from Microsoft Docs) “CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM”.

So are you passing this in the app node for manager? I have found that using SAMAccountName is far easier, and you can use liquid filters to construct your SAMAccountName from the value that is available in your Manager Field from your onboarding request. Here is an example if you use “First Letter of first name and full Last Name” This takes the first letter only of the user’s first name and then appends the full last name.

{{ticket.onboarding_request.actor_1.cf_first_name | truncate: 1, ""}}{{ticket.onboarding_request.actor_1.cf_last_name}}

Hope that helps! :)

Userlevel 7
Badge +13

Hello,

My onboarding is working and creating a user in the correct OU in AD. It also fills in most of their information. However, for the “manager” field, if I use their John Doe name it won’t work and throws an error saying that it can’t find such a name. If I use JDoe it works fine, but this field pulls from Freshservice a list of all the managers and is a dropdown on the onboarding form. I’m not sure why it’s not working, because the full name is the distinguished name.

 

In other words, only the SAM account name will work in that field, not the actual name. What am I doing wrong?

What you could do is to use the AD node find user using e-mail. From the output you will get the SAMaccountName. You get the e-mail using the PH from the field. 

 

 

Userlevel 1
Badge +4

Hello @Gerald usually the distinguished name is more complex than just the full name. For example (pulled from Microsoft Docs) “CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM”.

So are you passing this in the app node for manager? I have found that using SAMAccountName is far easier, and you can use liquid filters to construct your SAMAccountName from the value that is available in your Manager Field from your onboarding request. Here is an example if you use “First Letter of first name and full Last Name” This takes the first letter only of the user’s first name and then appends the full last name.

{{ticket.onboarding_request.actor_1.cf_first_name | truncate: 1, ""}}{{ticket.onboarding_request.actor_1.cf_last_name}}

Hope that helps! :)

Hi Zachary,

The built in Manager field on the onboarding form has the name as John Doe. I use the SAMAccountName field for the actual onboard creation; the problem is that the built in Manager field apparently needs to be a SAMAccountName too. Oh I can put that in the Manager field just like I did for the email and onboarder name. That’s a good idea, thanks.

Userlevel 1
Badge +4

Hello,

My onboarding is working and creating a user in the correct OU in AD. It also fills in most of their information. However, for the “manager” field, if I use their John Doe name it won’t work and throws an error saying that it can’t find such a name. If I use JDoe it works fine, but this field pulls from Freshservice a list of all the managers and is a dropdown on the onboarding form. I’m not sure why it’s not working, because the full name is the distinguished name.

 

In other words, only the SAM account name will work in that field, not the actual name. What am I doing wrong?

What you could do is to use the AD node find user using e-mail. From the output you will get the SAMaccountName. You get the e-mail using the PH from the field. 

 

 

Hi Daniel, 

This is a great idea. I didn’t think of that at all. I will play around with this and see what I can do. Thanks for the response.

Userlevel 1
Badge +4

Hello @Gerald usually the distinguished name is more complex than just the full name. For example (pulled from Microsoft Docs) “CN=Jeff Smith,OU=Sales,DC=Fabrikam,DC=COM”.

 

{{ticket.onboarding_request.actor_1.cf_first_name | truncate: 1, ""}}{{ticket.onboarding_request.actor_1.cf_last_name}}

 

See the problem with this is that the onboarding Manager field is called {{ticket.onboarding_request.actor_1.actor_2}} There is no last name field. That technique above, except I used | first allowed me to create the SAM name for the account. I may need to just make a separate duplicate field on the form asking for the manager’s first initial and last name. It’s strange that the onboarding module wouldn’t nicely interact with the automation.

I’m using the App action with the MS AD-Orch installed.

 

Userlevel 7
Badge +16

Hello @Gerald, I’m confident we can find a solution that won’t require you to have your managers enter additional information. Can you give us a little more regarding what the current Manager Field is? Is it a data sourced drop down? or just a text field? Can you share a screenshot of maybe a mock value it gives?

Userlevel 1
Badge +4

Hello @Gerald, I’m confident we can find a solution that won’t require you to have your managers enter additional information. Can you give us a little more regarding what the current Manager Field is? Is it a data sourced drop down? or just a text field? Can you share a screenshot of maybe a mock value it gives?

Hi Zachary,

 

This is the Freshservice onboarding module. The HR form automatically adds a “Manager” field so that the manager can receive an email for the onboarding request. The way that field is outputted appears to be John Doe (Me) <jdoe@corp.com. I created a separate field on the onboarding form called User Name with it really being the SAMAccountName.

 

There was no way I could see to pull the SAM name from {{ticket.onboarding_request.actor_1.actor_2}} because it is just a full name. I even tried to add an extra step to get username from email address but that has the same issue. There’s no liquid code that I can find which will extract the correct info.

 

I get an error in Workflow Automator which says “No identity with the name John Doe found” and I get a 400 error or 401, can’t recall. If I use the SAM name, works fine, and adding that extra field let it work. I sort of gave up.

 

Reply