Lab 13: Automating workflows

Objectives and tasks

  1. Create a Freestyle workflow in Workspace ONE UEM.
  2. Create a Frrestyle workflow in Omnissa Intelligence.

Task 1: Create a Freestyle workflow in Workspace ONE UEM

You create a Freestyle Orchestrator workflow in the Workspace ONE UEM console.

The example workflow you create will manage an application update and provide end users with the option to defer the update. If a device is newly enrolled, the workflow will deploy the application without providing deferral options. 

As part of this exercise, you will create a sensor and two scripts required for the workflow. You will use the Internal App (VLC Player) you uploaded in an earlier lab (Lab 8: Applications).

It is important to remember that any resources used for a workflow must exist in Workspace ONE UEM prior to creating the workflow.

  1. Log in to the ControlCenter desktop VM.
    • User name: administrator
    • Password: Pa$$w0rd
  2. Open Chrome and log in to Workspace ONE UEM.
    • User name: studentadmin{labid}
    • Password: Pa$$w0rd
  3. In the upper-right corner of the console, click the drop-down menu with your administrator name and verify that Student{labid} organization group is selected from the Organization Group drop-down menu.
  4. In the navigation pane at the top, select Resources. In the navigation menu on the left, expand Scripting, and then select Sensors.
  5. Click Add and select Windows from the drop-down menu.
  6. Enter new_enrolled for the sensor name. Click Next.
  7. For Language, select Powershell.
  8. Select System for Execution Context.
  9. For Response Data Type, select Boolean.
  10. Enter the following into the Code textbox:
$Event = Get-WinEvent -LogName Microsoft-Windows-DeviceManagement-Enterprise-Diagnostics-Provider/Admin | Where-Object {$_.ID -eq "72"} | select -Last 1
if($Event)
{
    $currentdate = Get-Date
   
    if($currentdate.AddDays(-7) -le $Event.TimeCreated)
    {
        $NewEnrollment = $true
    }
    else{$NewEnrollment = $false}
   
}
else{$NewEnrollment = $false}
 
return $NewEnrollment
Click to copy
  1. Click Next.
  2. Click Save.
  3. In the navigation pane at the top, select Resources. In the navigation menu on the left, expand Scripting, and then select Scripts.
  4. Click Add and select Windows from the drop-down menu.
  5. Enter create_deferral_screen for the script name. Click Next.
  6. For Language, select Powershell.
  7. Select User Context without Admin Privileges for Execution Context & Privileges.
  8. Activate End-User Interaction.
  9. Set the Execution Architecture to Auto.
  10. Configure the Timeout to use 3600.
  11. Enter the following into the Code textbox:
Add-Type -AssemblyName PresentationFramework
$DeferralPath = "C:\ProgramData\Airwatch\Deferral"
 
if((Test-Path "$($DeferralPath)\workflow.txt") -eq $true)
{
     Get-Date -Format s | Out-File -FilePath "$($DeferralPath)\workflow.txt" -Append
}
else
{
     New-Item -Path $DeferralPath -Name "workflow.txt" -ItemType File -Force
     Get-Date -Format s | Out-File -FilePath "$($DeferralPath)\workflow.txt" -Append
}
 
 
[xml]$XAML = @"
<Window     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Workflow deferral" Height="600" Width="600" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None">
     <Grid Background="#FFEEEEEE">
     <TextBlock FontSize="24" HorizontalAlignment="center" TextWrapping="Wrap" Text="Hi $($env:text)" VerticalAlignment="Top"  Height="80" Width="460" Margin="20,10,0,0"/>
        <TextBlock FontSize="24" HorizontalAlignment="center" TextWrapping="Wrap" Text="There is a pending workflow for your device." VerticalAlignment="Top"  Height="80" Width="460" Margin="20,100,0,0"/>
        <TextBlock FontSize="24" HorizontalAlignment="Center" TextWrapping="Wrap" Text="During this time your work is might affected." VerticalAlignment="Top" Height="64" Width="460" Margin="20,180,0,0"/>
        <TextBlock FontSize="24" HorizontalAlignment="Center" TextWrapping="Wrap" Text="You have the option to defer the workflow for 3 times. After that, the workflow will be forced to run." VerticalAlignment="Top" Height="100" Width="460" Margin="20,260,0,0"/>
       
        <Button x:Name="StartButton" Foreground="White" Content="Start the workflow" FontWeight="Bold" HorizontalAlignment="Left" Margin="20,435,0,0" VerticalAlignment="Top" Width="232" Height="49" AutomationProperties.Name="Start" Background="#FF0F912C"/>
        <Button x:Name="StopButton" Foreground="White" Content="Defer the workflow" FontWeight="Bold" HorizontalAlignment="Right" Margin="20,435,20,20" VerticalAlignment="Top" Width="232" Height="49" Background="#FFD60909"/>
    </Grid>
</Window>
 
"@
 
 
    $LineCount = (Get-Content "$($DeferralPath)\workflow.txt").count
 
 
    if($LineCount -eq 4)
    {
       
        [xml]$XAML = @"
<Window     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Workflow deferral" Height="600" Width="600" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" WindowStyle="None">
     <Grid Background="#FFEEEEEE">
         <TextBlock FontSize="24" HorizontalAlignment="center" TextWrapping="Wrap" Text="Hi $($env:text)" VerticalAlignment="Top"  Height="80" Width="460" Margin="20,10,0,0"/>
        <TextBlock FontSize="24" HorizontalAlignment="center" TextWrapping="Wrap" Text="There is a pending workflow for your device." VerticalAlignment="Top"  Height="80" Width="460" Margin="20,100,0,0"/>
        <TextBlock FontSize="24" HorizontalAlignment="Center" TextWrapping="Wrap" Text="During this time your work is might affected." VerticalAlignment="Top" Height="64" Width="460" Margin="20,180,0,0"/>
        <TextBlock FontSize="24" HorizontalAlignment="Center" TextWrapping="Wrap" Text="The workflow will be started now!" VerticalAlignment="Top" Height="100" Width="460" Margin="20,260,0,0"/>
       
        <Button x:Name="StartButton" Foreground="White" Content="Start the workflow" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,435,0,0" VerticalAlignment="Top" Width="232" Height="49" AutomationProperties.Name="Start" Background="#FF0F912C"/>
    </Grid>
</Window>
 
"@
      Remove-Item -Path "$($DeferralPath)\workflow.txt" -Force
      New-Item -Path $DeferralPath -Name "start.txt" -ItemType File -Force
   New-Item -Path $DeferralPath -Name "installed.txt" -ItemType File -Force
     
      Start-Sleep -Seconds 5
    }
 
 
$reader=(New-Object System.Xml.XmlNodeReader $xaml)
$d=[Windows.Markup.XamlReader]::Load( $reader )
 
#Connect to Control
$d.FindName("StopButton").add_click({
    
    $d.Close()
})
 
$d.FindName("StartButton").add_click({
   
     if($LineCount)
     {
        Remove-Item -Path "$($DeferralPath)\workflow.txt" -Force
     }
 
     New-Item -Path $DeferralPath -Name "start.txt" -ItemType File -Force
 
     Start-Sleep -Seconds 5
 
     $d.Close()
})
 
 
$d.ShowDialog() | out-null
Click to copy
  1. Click Next.
  2. Click Save.
  3. In the navigation pane at the top, select Resources. In the navigation menu on the left, expand Scripting, and then select Scripts.
  4. Click Add and select Windows from the drop-down menu.
  5. Enter deferral_cleanup for the script name. Click Next.
  6. For Language, select Powershell.
  7. Select System Context for Execution Context & Privileges.
  8. Set the Execution Architecture to Auto.
  9. Configure the Timeout to use 60.
  10. Enter the following into the Code textbox:
Remove-Item -Path "C:\ProgramData\Airwatch\Deferral\start.txt" -Force
New-Item -Path "C:\ProgramData\Airwatch\Deferral" -Name "installed.txt" -ItemType File -Force
Click to copy
  1. Click Next.
  2. Click Save.
  3. In the Workspace ONE UEM console, select Orchestration from the top navigation menu and click Freestyle Orchestrator from the left naviagtion menu. 

If this is the first time you are using Freestyle Orchestrator, you will click Get Started on the Getting Started with Workflows screen.

  1. Click New.
  2. Name the new workflow VLC Player Update.
  3. Select Windows as the platform.
  4. Next to Smart Groups, click in the search box. From the list of Assignment Groups that appear, select select Windows Desktop Devices.
  5. In the workflow UI, click the plus sign (+) and select Condition. Name the condition check_enrollment_status.
  6. From the Select drop-down menu, choose Sensor. Search for the sensor you created earlier called new_enrolled. Select Equals and enter TRUE. Click Then.
  7. Click Add. Select Action.
  8. From the Action drop-down menu, choose Install Application. Search for the application called VLC. Click Select to add the application to the workflow.
  9. Select the Then operator for the condition you created earlier called check_enrollment_status.
  10. In the Admin Panel, click Else.
  11. Click Add. Select Action and then click Script.
  12. Search for the script you created earlier called create_deferral_screen. Click Select.
  13. Click Add. Select Condition and name the condition check_deferral_status.
  14. From the Select drop-down menu, choose File and then File exists. For File Path, select Equals and enter the following file path: C:\ProgramData\Airwatch\Deferral\start.txt.
  15. Click Then.
  16. Click Add. Select Action.
  17. From the Action drop-down menu, choose Install Application. Search for the application called VLC. Click Select to add the application to the workflow.
  18. Click Add. Select Action and then click Script.
  19. Search for the script you created earlier called deferral_cleanup. Click Select.
  20. With your workflow complete, click Publish.

Task 2: Create a Freestyle workflow in Omnissa Intelligence

You create a workflow in Omnissa Intelligence.

An Omnissa Intelligence tenant is not provisioned in the lab environment. Therefore, you will use a clickthrough demonstration to simulate the process described in the lab manual. The demonstration has been configured to respond to the specific steps listed below. It will not allow you to explore Omnissa Intelligence beyond the configured lab.

  1. Open a new browser window in Google Chrome. Copy the URL listed below into the browser window to access the clickthrough demonstration. You will want to keep this lab manual open to follow the process steps.

Create a Freestyle workflow in Omnissa Intelligence

  1. Read the introduction, and click the Begin button when you are ready to start the lab.
  2. In the navigation menu on the left, select General from Freestyle Workflows.
  3. Select the Add Workflow button. The workflow workspace opens.

Normally, you would enter a name for the workflow in the upper right corner. For this demonstration, the name has been prepopulated for you.

  1. First, you need to add a data source from which the workflow will be based. This data source will provide the necessary data points required for the workflow to make conditional decisions. Under Select a Data Source, scroll through the list of sources on the left and select Workspace ONE UEM.
  2. In the column on the right, select Devices.
  3. You will now configure the trigger that determines when this workflow executes. On the Trigger Settings screen, click Schedule.
  4. Leave the options at their default settings.
  5. Select the next to Trigger Settings to collapse the screen.
  6. Configure the rules that will use data points from the data source you configured earlier to determine if the workflow needs to execute. Click Trigger Rules to expand the window.
  7. Scroll down the list of attributes and select Platform.
  8. Select Apple iOS from the list of platforms.
  9. Select the + to add another filter.
  10. In the Select Attribute field, enter Available Update.
  11. Select Available Update Version from the list.
  12. Click Is Not NULL from the dropdown menu.
  13. Select the + to add another filter.
  14. In the Select Attribute field, enter Install Status.
  15. Scroll down the search results and select Install Status beneath Workspace ONE UEM → iSO Updates.
  16. Click Available from the Enter value dropdown.
  17. Select the next to Trigger Rules to collapse the screen.
  18. Now, you will configure the execution steps within the workflow, starting with a condition. Click Add Step to create the first condition in the workflow.
  19. Select Condition from the dropdown menu that appears.

Normally, you would enter a name for the condition in the upper left corner. For this demonstration, the name has been prepopulated for you.

  1. In the Select attribute field, enter Shared.
  2. Select Shared from the search results.
  3. Select true from the dropdown menu.
  4. In the decision tree, click the + beneath Then to add a second condition to the workflow.
  5. Select Condition from the dropdown menu that appears.

Normally, you would enter a name for the condition in the upper left corner. For this demonstration, the name has been prepopulated for you.

  1. In the Select attribute field, enter Checkout Status.
  2. Select Checkout Status from the search results.
  3. Click true from the Enter value dropdown menu.
  4. Click the + beneath Then under the check_out_status condition you just created.
  5. Click Stop Workflow from the dropdown menu that appears.
  6. Click the + beneath Else under the check_out_status condition you just created.
  7. Now, you will add an action. Select Action from the dropdown menu that appears.
  8. From the list of Available Connectors, select Workspace ONE UEM.
  9. Enter Schedule in the search field.
  10. Select Schedule OS Update (Apple) from the search results.
  11. Click the Add Action button.
  12. Click the + beneath Else under the check_shared_status condition.
  13. Select Action from the dropdown menu that appears.
  14. From the list of Available Connectors, select Workspace ONE Hub Services.
  15. Select Send Notifications from the list of available actions.

Normally, you would configure the parameters of your notification. For this demonstration, the fields have been prepopulated for you.

  1. Select the to collapse the notification screen.
  2. Hover your mouse below the Send Notifications action, and select the + that appears.
  3. Select Action.
  4. From the list of Available Connectors, select Workspace ONE UEM.
  5. Enter Schedule in the search field.
  6. Select Schedule OS Update (Apple) from the search results.
  7. Click the Add Action button.
  8. Click the Save button.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.