workflow trigger not an Active Roles operation

Hi,

I'm using Active Roles 7.5 and I'm looking for assistance on creating a workflow (on demand or automated) where the trigger isn't initiated within an Active Roles operation.  We have our computers sorted into Operating system and type (desktops, laptops, tablets) and I'd like to automate a process where if one is updated from Windows 10 to Windows 11 the move will be done for us.  I have a series of if-else operations to do the sorting that seem to work perfectly when we test with something like changing the description field but the operating System isn't one that can be altered, so the trigger won't work.  Changing the description in our Active Directory didn't trigger the workflow so I know using a Modify to operatingSystem attribute won't work either, which is what I'd originally intended but I assume because the change to OS won't be a manual change through Active Roles, the same would happen where the workflow would never be triggered.  I'm thinking of using an automated workflow to run a couple of times a day instead but I'm not sure how to get it to check the Windows 10 OU and identify the computers on Windows 11 to know it has to move those ones.  Has anyone done something like this before that may be able to offer advice please?  Will I maybe need to use a Powershell script to spit out a csv of the computers that need to be moved and then feed it back into the if-else bit I already have set up, or do the if-else within the powershell and just have a workflow that runs the script?

I hope I've explained that well enough! Any ideas will be great.

Thanks


Charlene

Parents
  • I often use Managed Units to dynamically group together objects into sort of a "queue" to be acted upon by scheduled Automation Workflows.

    Try creating a Managed Unit (MU) to collect together the objects meeting your required criteria - the membership rule of the MU is where you will define your criteria - e.g. Operating System contains Windows 11.  Then from a script-based enumeration point of view, you just treat the Managed Unit as a "-SearchRoot" just as you would an OU.

    Here's a snippet to give you an idea of how this might work

    Get-QADComputer -proxy -SearchRoot <DN of Managed Unit> | foreach {

    # Do something with each of the computers returned from the Managed unit enumeration

    # Optionally clear your "queueing" attribute (see below)

    }

    If your script already alters one of your criteria attributes then the processed objects should just "fall out" of your Managed Unit.  If not, then I often use a Virtual attribute to "queue" objects and then clear it at the end of my script to drop the processed objects out of my "queue" Managed Unit.

    'Hope this helps.

  • Hi,

    Thanks very much, I didn't think of using Managed Units, I've only used those for basic reporting and delegating Access templates.  I'm new to using automated workflows so please forgive my potentially daft question; how do I get them to run?  I've created an automated workflow with the same if-else makeup as before, and a managed unit.  I tested your powershell line on the server's management shell and it works fine so I put it in as the parameter script with the function premove but the Run Workflow button doesn't become clickable so I must've set up the starting conditions wrong. I tried putting it in the initialization script bit as well but that didn't help.  Is there an idiot's guide to setting up automated workflows anywhere?

    I've got the MU set up in a way that looks in the Windows 10 OU so as you say, once the workflow has run the machine will be moved into the Windows 11 OU and therefore drop out of the MU.  

    Thanks again for your help so far.

    C

      

Reply
  • Hi,

    Thanks very much, I didn't think of using Managed Units, I've only used those for basic reporting and delegating Access templates.  I'm new to using automated workflows so please forgive my potentially daft question; how do I get them to run?  I've created an automated workflow with the same if-else makeup as before, and a managed unit.  I tested your powershell line on the server's management shell and it works fine so I put it in as the parameter script with the function premove but the Run Workflow button doesn't become clickable so I must've set up the starting conditions wrong. I tried putting it in the initialization script bit as well but that didn't help.  Is there an idiot's guide to setting up automated workflows anywhere?

    I've got the MU set up in a way that looks in the Windows 10 OU so as you say, once the workflow has run the machine will be moved into the Windows 11 OU and therefore drop out of the MU.  

    Thanks again for your help so far.

    C

      

Children
  • Four ways to start them:

    1) Go to the workflow in the Active Roles MMC and run it

    2) Go to the workflow in the Active Roles Web UI and run it (you can delegate this too if you want using Access Templates)

    3) In the properties of the workflow, setup a schedule for the workflow to run however often you like

    4) To launch it programmatically on demand, stamp the virtual attribute edsvaStartWorkflow of the Workflow to TRUE using PoSh (Set-QADObject -proxy -identity <Workflow DN>) -ObjectAttributes @{edsvaStartWorkflow=TRUE}

    The code I provided you should be added into a Policy Script and then that should be added to your workflow included in a script Activity.

  • To elaborate on my Policy Script point above...here's how the actual policy script might look:

    Function MoveMyComputersAround ($Request)

    {

    Get-QADComputer -proxy -SearchRoot <DN of Managed Unit> | foreach {

    # Do something with each of the computers returned from the Managed unit enumeration

    # Optionally clear your "queueing" attribute (see below)

    }

    } # End of function

    When configuring your Script Activity within the workflow to launch your script, you would specify MoveMyComputersAround as the name of the function to run in the selected script.