Orchestrator Runbook "Links"

Ronald Seow 206 Reputation points
2020-08-19T03:02:30.993+00:00

Good morning!

I'm very new to MS Orchestrator so please give me your utmost support whenever possible. Thank you in advance.

I have created a Runbook 18653-sco-image1.png

When the Check User script completed, There's a Published Data $CompareResult which is either "True" or "False". However, in the Link, regardless of how I apply a check, It will always proceed in all directions. Isn't the filter suppose to determine whether the action following the link gets executed?

Appreciate any advise.

Thank you once again and best regards.
Ronald

System Center Orchestrator
System Center Orchestrator
A family of System Center products that provide an automation platform for orchestrating and integrating both Microsoft and non-Microsoft IT tools.
217 questions
0 comments No comments
{count} votes

Accepted answer
  1. Stefan Horz 3,461 Reputation points
    2020-08-21T20:41:08.617+00:00

    Hi Ronald,

    you can download this sample Runbook from here https://1drv.ms/u/s!AkXRVOcQ_Bj_iLR_287BNf_tqL-2-Q?e=XuOhCi.

    19603-checkuserresult.jpg

    Since System Center 2019 Orchestrator the Windows PowerShell Version of the system exectuting the Runbook will be excuted in "Run. Net Script" Activity. For previous versions check https://sc-orchestrator.vasol.eu/run-the-powershell-version-of-windows-executing-the-orchestrator-runbook-service-in-run-net-script-activity/

    A checked-in Runbook will always be executed from the Account running Orchestrator Runbook Service. Only with Runbook Tester a checked-out Runbook will be executed from the user running Tester
    If you want to get Who started the Runbook from the Orchestration console take a look at: https://blog.ctglobalservices.com/automation/jgs/who-started-the-runbook-from-the-orchestration-console-use-this-runbook/.

    Regards
    Stefan

    0 comments No comments

16 additional answers

Sort by: Most helpful
  1. Ronald Seow 206 Reputation points
    2020-08-21T01:15:23.453+00:00

    Hi! Stefan,

    Earlier on in my testing, I was doing it without the "powershell {}" and my scripts was giving me errors. After some research online, someone mentioned that using powerscript in SCO has limitations and recommended that the "powershell{}" be used which I tried and the error went away. However, from that point onwards, I haven't been able to make any headway because the test conditions was having problem.

    I am new to scripting using Powershell and have just started to test SCO. Usually I would test my scripts in Powershell before I place them in SCO. I am getting the results I want in Powershell but not in SCO.

    I am currently making changes to the scripts and testing them, but none seems to be working.

    My current task in SCO involves a user's input and AD verifications of the followings;

    1. Check whether user's input of an AD SAMAccountName exist in AD
    2. Check whether User Account in AD is "Enabled/Disabled"
    3. Check whether User Account LockedOut status is "True/False"
    4. Check whether User Account is in the same User Group with the SCO Admin executing the Runbook
    5. Unlock Yser Account

    As such, at each stage, I try to implement a test and try passing a variable containing "True/False" to be used in the Smart Links to determine the next action and behavior of the Runbook in question.

    I really appreciate your reply and advise, as well as that of Andreas, without which, I would not have been able to move along at all.

    If you can advise further or require all the scripts I am using to understand better, do let me know and I can provide them for your evaluation and further comments.

    Thank you and best regards.
    Ronald

    0 comments No comments

  2. Ronald Seow 206 Reputation points
    2020-08-21T01:25:55.663+00:00

    Hi! Andreas,

    I have tried and am still trying to modify the scripts to physically get a "True/False" value that I can use in the Smart Links to control the flow of my project. The thing is, when I try out commands in a Powershell window, I may get a value displayed but when applied to SCO, the same script either generates an error or if no error the value could not be used in the Smart Links for checking.

    As mentioned in my reply to Stefan's advise, My current task in SCO involves a user's input and AD verifications of the followings;

    1. Check whether user's input of an AD SAMAccountName exist in AD
    2. Check whether User Account in AD is "Enabled/Disabled"
    3. Check whether User Account LockedOut status is "True/False"
    4. Check whether User Account is in the same User Group with the SCO Admin executing the Runbook
    5. Unlock Yser Account

    At each stage, I try to implement a test and try passing a variable containing "True/False" to be used in the Smart Links to determine the next action and behavior of the Runbook in question.

    I really appreciate your reply and advise, as well as that of Stefan, without which, I would not have been able to move along at all.

    If you can advise further or require all the scripts I am using to understand better, do let me know and I can provide them for your evaluation and further comments.

    Thank you and best regards.
    Ronald

    0 comments No comments

  3. Ronald Seow 206 Reputation points
    2020-08-21T02:04:21.69+00:00

    Hi! Andreas/Stefan,

    I just created a simple Run .Net Script choosing powershell and placing the below statement in details

    $CheckNULL = If (name -eq $NULL) {"False"} Else {"True"}

    When I test it in Powershell windows, it works fine but SCO will throw an error stating "-eq is not recognized as a cmdlet, function, script file or operable program". But the moment I added $output=powershell{}, the Powershell script completes except this time, there is no output as it will stop after execution ignoring the 2 routes I've created, 1 for "True" and the other for "False".

    This is so confusing.

    Ronald

    0 comments No comments

  4. Andreas Baumgarten 98,626 Reputation points MVP
    2020-08-21T19:42:41.053+00:00

    "name" is a variable?
    If so the $ is missing
    $CheckNULL = If ($name -eq $NULL) {"False"} Else {"True"}

    Maybe you could post the PowerShell script you are using to check the user here.
    Than I‘am pretty sure we will get it running.

    Regards
    Andreas Baumgarten

    0 comments No comments