microsoft AD V2 Spoke

bandlaa
Tera Expert

HI all,

I’ve started working on updating the user-based Microsoft AD v2 spoke action. This is new to me, so I began by creating a workflow to handle the process.

I can see a few out-of-the-box (OOTB) actions available for user-based MS AD v2. In our setup, we have a field in Active Directory called employeeid, and a corresponding form variable called contact_number. This form is connected to the workflow.

The requirement is that whenever a user submits the form, the values entered (such as contact_number) should be used to update the corresponding fields (like employeeid) in Active Directory.

4 REPLIES 4

DylanBlumenberg
Tera Guru

Hi @bandlaa, if I'm understanding you correctly, you're looking to update fields in AD that aren't supported by the OOB AD v2 spoke, correct?

I ran into similar limitations regarding looking up information in AD. It came down to me having to clone the existing Look Up User AD v2 action, then modify it for my purposes. 

For example, I needed to be able to look up users in AD by employee number, which was not supported by the OOB Look Up User action. 

Since the AD spoke tells Powershell scripts to run on the mid server, creating a custom action also requires copying an existing mid server Powershell script and modifying it for your needs. In my experience, this was the most difficult part, mostly because my Powershell experience is quite limited. These mid server script files are stored in the ecc_agent_script_file table. 

Your understanding is correct. Is there a way to fix this in Flow, or do I need to write a script somewhere? If it is somewhere, where can I write this script

I'm not aware of a way to fix it directly in the flow or via a standalone script. 

 

I was able to build around the limitation by creating an entirely new flow action. My situation was a little unique so I can't provide the exact steps you would need, but I'll include what I remember of the high-level steps below:

 

1. In Flow Designer, clone the existing AD v2 flow action (Update User)

2. Open the cloned action and under the Powershell step, identify the MID Server Script file it's using. 

3. Open the ecc_agent_script_file table and locate the MID Server Script file from step 2. 

4. Create a copy of that file and modify it to fit your needs.

5. Open the cloned flow action and enter the new script in the Powershell MID Server Script file field. 

6. If necessary, edit the cloned flow action to include parameters you need to push to the script/AD. 

7. Test, test, test.

 

Two things to keep in mind if doing this also:

  • Is if there may be other potential that you may need to update other additional AD fields in the future? If so, create the flow/script to support those now, not later. 
  • I think there's a limit to the number of output variables you can declare on the flow action. 

Tanushree Maiti
Tera Patron

Hi @bandlaa 

 

Refer this Servicenow Documentation: Microsoft Active Directory v2 Spoke 

 

The Microsoft Active Directory v2 spoke provides actions to automate the tasks when events occur in your ServiceNow instance. Available actions include:

 

User ManagementDelete UserDeletes the user from Active Directory (AD).
Create UserCreates a user account in the Active Directory (AD) and sets a password.
Note:
From Microsoft Active Directory v2 spoke v2.1.1 onwards, these changes are applicable:
  • Sam Account Name is available in the Additional Fields drop-down.
  • When a user is created, the User Principal Name (UPN) is generated in this format: <username>@<DNS-domain-name>.
Disable User (Conversational -ready)Disables a user account in Active Directory (AD).
Does User ExistsChecks whether the user account exists in Active Directory (AD).
Update UserUpdates a user account in the Active Directory (AD).
Enable User (Conversational -ready)Enables a user account in Active Directory (AD).
Look up User (Conversational -ready)Retrieves a user account from the Active Directory (AD).
Note:
Now Assist for Conversational Spokes plugin is required to use the conversational ability of the action.
Is User DisabledChecks if the user account is inactive in Active Directory (AD).
Get User Additional Fields (Metadata)Retrieves information from the additional fields in a user account from the Active Directory (AD).
 
Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti