Solved

Input of PowerShell commands in Microsoft Active Directory Orch

  • 15 February 2024
  • 6 replies
  • 99 views

Badge

Hello everyone,

For my internship at our company I am going to automate a lot of stuff for our helpdesk and as a starter I’m building an Employee Onboarding Automator using Microsoft Active Directory Orch.

I’ve built it very similarly to the sample use case delivered by Freshservice but unfortunately I’m not getting the results I hoped for so far using placeholders.

I am wondering if I can enter flat PowerShell cmdlets like the one below into fields, for example for the field user_principal_name in AD User Creation:

$UserPrincipalName = ($GivenName + "." + $Surname).ToLower() + $Domain

To get the result john.smith@company.local for example.

Does the app just accept the command as raw input? Or do I need to dress this up somehow?

icon

Best answer by zachary.king 21 February 2024, 03:46

View original

6 replies

Userlevel 3
Badge +2

That is the great thing about workflows.  Create the node in the workflow and Test. You will soon find your answer.

Userlevel 7
Badge +16

Hello @RMG.TDA you cannot pass powershell commands to those fields, but you can use the powershell orchestration application to run scripts and execute commands prior to using an AD Orch node. Then you can pass the value that is returned from your powershell command node to the AD node. You can also use the expression node to handle and string manipulation that you might need. Lastly placeholder values can be manipulated using Liquid Filters. Hope that helps!

Badge

@zachary.king Thanks for the reply! This does indeed seem very helpful. So if I understand correctly, I should simply add an PS Orch before the Create User in this chain and use the output as input for A1?

 

Userlevel 7
Badge +16

@zachary.king Thanks for the reply! This does indeed seem very helpful. So if I understand correctly, I should simply add an PS Orch before the Create User in this chain and use the output as input for A1?

 

Exactly, and in fact I would suggest just to use PowerShell to interact with AD. Removing the need to use the AD orchestration application all together.

Badge

Thanks again! I did manage to get it working as intended using Liquid Filters. So for now I’m going to keep the AD Orch since it is a bit more modular. But I have indeed been considering PowerShell could be more practical in the long run.

Userlevel 7
Badge +16

Thanks again! I did manage to get it working as intended using Liquid Filters. So for now I’m going to keep the AD Orch since it is a bit more modular. But I have indeed been considering PowerShell could be more practical in the long run.

Thats great to hear, if you feel your question has been adequately answered be sure to mark it “Solved”. It will help other community members when they search a similar question! Take care :)

Reply