Runbook Tester vs Run in Runbook Designer vs Run in Orchestrator Console

Ronald Seow 206 Reputation points
2020-08-25T03:49:57.04+00:00

Hi! Everyone,

I have hit another brick wall, but as usually, I'm clueless and hope I can get some knowledge here.

I have completed the creation of a Runbook to unlock AD User accounts following the workflow attached. The steps includes;

  1. Initialize Data - Get user input for AD User login ID
  2. Run .Net Script (Powershell) - Check Input for null value in entry
  3. Run .Net Script (Powershell) - Check whether Inputted user login ID user object exist in AD
  4. Run .Net Script (Powershell) - Check whether Inputted user login ID user object is enabled and lockout status is true
  5. Run .Net Script (Powershell) - Check whether Inputted user login ID user object is in the same AD Group as the Runbook user
  6. Run .Net Script (Powershell) - Unlock Inputted user login ID

I test run this Runbook in 3 ways;

  1. Runbook Tester - Completed successfully
  2. Using Run in Runbook Designer - Failed, no pop-up screen to request for input
  3. Using Run in Orchestrator Console - Failed, while executing the below script less the quotes

"$CurrentUserGroupObj = Get-ADUser -Identity $CurrentUser -Properties MemberOf"

19959-sco-runbook-full-flow-for-unlock-ad-user.jpgCan someone shed some light what is going on?

Thank you 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
{count} votes

17 additional answers

Sort by: Most helpful
  1. Ronald Seow 206 Reputation points
    2020-08-26T00:59:50.41+00:00

    Hi! Leon/Stefan/Andreas,

    After reading XinGuo-MSFT post, I did try loading up Powershell Version 2 on the 32bits Powershell and indeed I encountered the error. I then followed by redo modification of the registry key "hklm\software\wow6432node\microsoft.netframework\OnlyUseLatestCLR" and it worked thereafter. However, the Runbook is still failing at the "Check Group" with the below error.

    Name : Check Group
    Type : Run .Net Script
    Status : Failed
    Publish Data : Error Summary Text
    Value : Cannot find an object with identity: '2016SVR3$' under: 'DC=test,DC=com'.

    I do not know why it is looking for the SCO server object name. Do you have any clue?

    Appreciate your kind advise.

    Thank you and best regards.
    Ronald

    20371-sco-console-error-check-group.jpg

    0 comments No comments

  2. Andreas Baumgarten 98,626 Reputation points MVP
    2020-08-26T05:33:13.647+00:00

    Maybe you can post your script here?

    Regards
    Andreas Baumgarten

    0 comments No comments

  3. Ronald Seow 206 Reputation points
    2020-08-26T05:40:02.62+00:00

    Good afternoon! Andreas,

    20408-check-group.txt

    Here's the script attached for all.

    Thank you.
    Ronald

    0 comments No comments

  4. Andreas Baumgarten 98,626 Reputation points MVP
    2020-08-26T14:38:20.333+00:00

    As XinGuo already mentioned:

    $ENV:Username doesn't work here if the Runbook is executed by the Orchestrator Runbook Service.
    A better way is to use an "existing user" to compare with the $InputUser details.
    $currentuser = "<SamAccountName of User>"

    Maybe this is helpful.

    Regards

    Andreas Baumgarten

    (Please don't forget to Accept as answer if the reply is helpful)

    0 comments No comments