jeroen.frikken

Automate a process with the Automation Platform (AP)

Blog Post created by jeroen.frikken Employee on Jun 27, 2018

This blog will guide you through the different steps of creating a new Automated process with the Automation Platform. From adding the Activity and setting up the workflow to creating the service itself.

 

We start with the parameters and activity. To add an activity in the Automation Platform you can use a PowerShell script or an executable. As an example, I use a simple PowerShell script which will create the different parameters and uses these parameters to create a user account in the Active Directory.

 

This script will create the activity with the different parameters. You can save the script as a ps1 file. For example: Onboarding new employee.ps1. Before you use the script make sure you have changed it according your own environment.

 

param(

[Parameter(mandatory=$true)][string]$givenName,

[Parameter(mandatory=$true)][string]$surName,

[Parameter(mandatory=$false)][string]$samAccountName,

[Parameter(mandatory=$true)][string]$upn,

[Parameter(mandatory=$true)][string]$SecurityGroup,

[Parameter(mandatory=$true)][string]$password,

[Parameter(mandatory=$true)][string]$displayName

)

 

Write-Host "Starting to create AD user"

write-debug "Setting samaccountname to $givenName$surName"

$samAccountName="$givenName$surName"

$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force

New-ADUser -GivenName $givenName -Surname $surName -name $displayName -SamAccountName $samAccountName -UserPrincipalName $upn -Path "OU=DemoUsers,OU=Snow,DC=snowtrain,DC=local"

Add-ADGroupMember $SecurityGroup -Member $samAccountName

Write-Host User created

 

Adding a new activity to AP.

First, we start with creating an activity.

 

Action 1

Login to the Automation Platform with a user account with admin privileges and open the Activity Admin menu.

 

 

Action 2.

Click on +Add activity, upload the PowerShell script and click on Add activity.

 

 

Once the Activity is created you will see the Activity with all the Parameters.

 

 

Action 3.

On the General tab you can change some basic settings like:

1.   The Name of the activity.

2.   The Display name of the activity.

3.   The Description of the activity.

4.   You can add the Activity time savings.

(This setting will be used in the Automation Platform reports. Every time this activity is used in a service request you will save time because it is an automated process. So, let’s say, when you normally request a user it will take 1 hour. Once you implement this automated process you can request a new user in only 5 minutes. The time savings is 55 minutes.)

5.   Use the Category to categorize the different activities.

6.   The On error e-mail address is used to send an error notification in case something goes wrong.

7.   The Service account is used to execute the commands. So, in this case the service account need to have permissions to read and

      write in the Active Directory.

 

 

Action 4.

On the preview tab you can check the PowerShell script. If you want to change the PowerShell script you can only do so by editing it in the ps1 file on the server. See Activity path and file name on the General tab.

 

Add a new workflow to AP.

The second step is to create a workflow. We can attach different actions to one workflow but in this example, we will only attach the action created in the previous step.

 

Action 1.

Go to the Administrator menu and open the Workflow admin.

 


 

Action 2.

Click on +Add workflow, fill-in the form and add the workflow.

1.   Specify a name for the workflow.

2.   Select Order as the Type.

3.   Add a Description.

4.   Add a Notification e-mail address.

5.   You can use the Cope existing option to copy all settings and activities from an existing workflow.

 

 

Action 3.

Open the workflow and drag and drop the activity in the workflow. It is possible to add more activities to a workflow. For example, if you want to send an email after the new user is created in the Active Directory, you can add an Email notification activity to the workflow.

 

 

Action 4.

Save the workflow and check if the activity is available.

 

 

Add a new service to AP

After we’ve created the workflow we can start adding a new service. The service is what the end user will see in the Automation Platform website.

 

Action 1.

Go to the Administrator menu and open the Service admin.

 

 

Action 2.

Click on +Add service, fill-in the form and add the service.

1.   Add the Name of the service.

2.   Add the Display Name of the service. This is the name which is visible for the end user, requesting the service.

3.   Add a Manufacturer. In case you add a service which is delivered by a 3rd party you can add the name of this 3rd party in this field.

4.   Add the Description of the service.

5.   In the Order workflow, select the New AD user workflow

6.   Set the Status to Active.

7.   If you want, you can add a purchase Price for this service which is visible for the end user.

8.   If you want, you can add a rent Price for this service which is visible for the end user.

9.   Add the On error e-mail address.

10.   Instantiate is used to add the requested service to the My Task overview from the requester.

 

 

Configure the service in AP

 

Action 1.

Open the service New AD user and go to the Image tab. In the image uri you can provide the location and filename of an image stored on the Automation Platform web server. This image is then visible for the users, requesting the service.

 

 

Action 2.

Open the service New AD user and go to the Category tab. In the Category you can add the service to an existing category or create a new category.

Click on Edit categories to open the category editor and then add a child category. Add a category description and Save the changes.

 

 

Add the service to the new category and save the changes.

 

 

Action 3.

Open the service New AD user and in this service select the workflow New AD user on the Workflow tab.

 

 

Action 4.

Click on the View button to view the activity parameters.

 

 

Action 5.

We will now start with the configuration of each Parameter. We start with the technical part and will change the displayName, SecurityGroup, samAccountName, and the upn.

 

displayName.

-   Open the displayName and select the tab Value population. Change the What kind of input field to use? In a Readonly field.

 

-   Add a parameter in the What is the value for this parameter?. Combine the parameter givenName and surname in this field like

   this: Workflow parameter: givenName Workflow parameter surname

   (When you start typing in the field it will automatically provide some suggestions.)

 

 

-   Click on Save all to save the changes.

SecurityGroup.

-   Open the SecurityGroup and select the tab Value population. Change the What kind of input field to use? In a Dropdown field.

 

-   Select the Static value list tab and create a dropdown list.

   (This list is a static list with Active Directory security groups. It is also possible to setup this list as a dynamic list by using a    PowerShell web service via the PowerShell web service tab.)

 

   Click on the + sign after the dropdown list and add a name to the form. Choose a Display name and a Value. The display name is    what visible in the dropdown list. The value is used in the PowerShell script to select the right AD Security Group. By clicking on the +    you add the row to the dropdown list.

 

 

   Add more AD Security Groups to the dropdown list.

   (The value need to match the Security Groups in the Active Directory.)

 

 

-   Click on Save and select the AD Security Groups dropdown list in the Static value list.

-   Click on Save all to save the changes.

 

 

samAccountName

-   Open the samAccountName and select the tab Value population. Change the What kind of input field to use? In a Readonly    field.

 

-   Add a parameter in the What is the value for this parameter?. Combine the parameter givenName and surname in this field like    this:

   Workflow parameter: givenName.Workflow parameter surname

   (When you start typing in the field it will automatically provide some suggestions. To add the “.” between the 2 parameters first use a    space and replace this later with a “.”.)

 

 

-   Click on Save all to save the changes.

 

UPN

-   Open the upn and select the tab Value population.

 

-   Add a parameter in the What is the value for this parameter?. Combine the different parameters to generate an e-mail address.    Use the samAccountName parameter and add the domain name like this:

   Workflow parameter: samAccountName@snowtrain.local

   (When you start typing in the field it will automatically provide some suggestions. Just type the domain name after the parameter.)

 

 

-   Click on Save all to save the changes.

 

Action 6.

We can now start the first test of our new service.

 

-   Go to the Start menu and open the User Management.

 

 

-   Add the New domain user account service to the shopping card and click on Checkout.

 

 

As you can see the form is not very user friendly. We will change this after our test.

1.   Select the SecurityGroup.

2.   Add the givenName.

3.   Add a password.

4.   Add the surname.

5.   Submit the request.

 

 

You can follow the status under the My requests page.

 

 

You can check the result by validating the new user account in the Active Directory. You can see there is a new user which is a member of the Sales Security Group

 

 

Finetuning the new service:

As you can see the form is not very user friendly. Strange labels and data fields which are not in the right order. We can change this by changing the parameters from this service.

 

Action 1.

Go to the Administrator menu and open the Service admin.

 

 

Action 2.

Open the service New AD user and in this service select the workflow New AD user on the Workflow tab.

 

 

Action 3.

Click on the View button to view the activity parameters.

 

 

Action 4.

We will now start with the configuration of each Parameter.

 

SecurityGroup

-   Open the SecurityGroup and select the tab General. Change the Display name to 5. Department

-   Click on Save all to save the changes.

 

displayName

-   Open the displayName and select the tab General. Change the Display name to 3. Full name

-   Click on Save all to save the changes.

 

givenName

-   Open the givenName and select the tab General. Change the givenName to 1. First name

-   Click on Save all to save the changes.

 

password

-   Open the password and select the tab General. Change the password to 4. User password

-   Click on Save all to save the changes.

 

samAccountName

-   Open the samAccountName and select the tab Value population. Uncheck the Checkout view checkbox.

   (This will hide this parameter from the user request form.)

-   Click on Save all to save the changes.

 

surName

-   Open the surName and select the tab General. Change the surName to 2. Last name

-   Click on Save all to save the changes.

 

upn

-   Open the upn and select the tab Value population. Uncheck the Checkout view checkbox.

   (This will hide this parameter from the user request form.)

-   Click on Save all to save the changes.

 

 

Finetuning the new service:

The service is now ready, and you can request a new user account.

 

 

 

 

This configuration is very basic, but you can use this procedure to create more complex automated processes.

Hopes this helps you on your Automation Platform journey.

Outcomes