Skip to main content
Solved

Input of PowerShell commands in Microsoft Active Directory Orch

  • February 15, 2024
  • 6 replies
  • 247 views

Forum|alt.badge.img+1

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?

Best answer by zachary.king

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!

View original
Did this topic help you find an answer to your question?

6 replies

ekrasner
Community Debut
Forum|alt.badge.img+2
  • Community Debut
  • 24 replies
  • February 19, 2024

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


zachary.king
Skilled Expert
Forum|alt.badge.img+16
  • Skilled Expert
  • 951 replies
  • Answer
  • February 21, 2024

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!


Forum|alt.badge.img+1
  • Author
  • Top Contributor
  • 4 replies
  • February 21, 2024

@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?

 


zachary.king
Skilled Expert
Forum|alt.badge.img+16
  • Skilled Expert
  • 951 replies
  • February 21, 2024
RMG.TDA wrote:

@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.


Forum|alt.badge.img+1
  • Author
  • Top Contributor
  • 4 replies
  • February 22, 2024

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.


zachary.king
Skilled Expert
Forum|alt.badge.img+16
  • Skilled Expert
  • 951 replies
  • February 22, 2024
RMG.TDA wrote:

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