Home Orchestrator
Options

Runbook workflow "Assign to Support Group" best practices

T_R_Ash_McCan_1T_R_Ash_McCan_1 Member IT Monkey ✭

Hi all, I am trying to figure out the best way to tell my runbook to assign to the proper support team. For this case, it will all be based on the computer's placement by OU. I have the Initialize Data pulling from an upstream runbook, and I just can't figure out how to interogate that data by OU and pass that logic into the Update Object for the correct support group.

I am currently getting the data from Initialize Data, linking to a Run .Net Script which runs powershell to define OUs, and I'd like that to link down to an Update Object that will set the Support Group automatically.

I understand the logic well enough from a powershell perspective but am having a tough time tailoring that data for Orchestrator (I am new, and very green, with Orchestrator)

If anyone has any good articles or best practices, everything is appreciated.

Comments

  • Options
    Brian_WiestBrian_Wiest Customer Super IT Monkey ✭✭✭✭✭

    What you want to do is have the .Net Script determine the Support Group value and pass that value to the Update Object command.

    Here is an example of a .Net Script I use for computers moving them into the correct OU based on state and city. It can be its the same logic of support group, were you get you final value for support group and pass that to update object. HTH


    if ( !(Get-Module -Name activedirectory -ErrorAction SilentlyContinue) ) {Import-module activedirectory}

    $Computer = "ComputerName"

    $ADcomputer = Get-ADcomputer $Computer -property description,info,location,extensionAttribute1 

    $Stateouname = $ADcomputer.name.ToUpper().Substring(3) -replace ".{8}$"

    $subouCode =  $ADcomputer.name.ToUpper().Substring(4+$Stateouname.length).Substring(0,1)

    $StateOUDN = 'OU=Computers,OU='+$Stateouname+',DC=usa,DC=doj,DC=gov'

    $subOUs = Get-ADOrganizationalUnit -filter {(objectclass -eq "organizationalUnit")} -searchscope Onelevel -searchbase $StateOUDN -properties name,city

    Foreach ($subOU in $subOUs)

    {

        IF($subou.city -eq $subouCode)

        {

            $TargetOUDN = $subou.DistinguishedName

        }

    }

    IF(!$TargetOUDN){$TargetOUDN = $StateOUDN}

    $TargetOU = Get-ADOrganizationalUnit $TargetOUDN

    $TargetOUDN = $TargetOU.DistinguishedName

  • Options
    T_R_Ash_McCan_1T_R_Ash_McCan_1 Member IT Monkey ✭

    Thanks Brian! I'm going to play around with this. I'll let you know if I have any questions.

Sign In or Register to comment.