Skip to main content

Workspace Automation

Overview

Workspace provides events that can be used to execute Powershell scripts on assignment or removal of a Workspace Item at both customer and user level.

Scripts

Scripts are managed through the Script Upload feature. Users must be granted explicit access to the script upload feature which is available to the Atria Service Provider Developer role by default. Visit the Script Upload page for information on accessing and managing scripts within Atria.

Workspace Item Events

Adding an event to a Workspace Type Workspace Item Event handlers can be defined and changed at multiple levels, allowing you to cater for the requirements of individual resellers or customers.

This means that through configuration, assignment of a Workspace item to different customers, could execute a different process.

The following events are available:

eventwhen event occursuse for
customer.provisionItem first assigned to a customersetup or configuration of applications
customer.deprovisionItem removed from a customerarchiving or deletion of data
user.assignItem first assigned to userconfiguration of user, add to external system
user.unassignItem removed from a userarchival, deletion of data related to user

The Powershell script will target the appropriate environment given the Item Type. For example, if the Item is an Azure item, then the script will automatically authenticate to the Customer in Azure, and execute the script within this context. If the Item's group type is an Active Directory group, then the script will target the Local AD environment.

Use Case : Preparation of application container

In a scenario where an ISV has a provisioning process for their application, this might involve publishing the application to a desktop, and also behind the scenes it may require a new containerised database to be created and then configured.

To solve this problem, a PowerShell script can be attached to a Workspace Item customer provision event to perform the creation of the new container, whenever a customer is assigned a specific Workspace Item, the automation will run ensuring that the application is automatically setup without needing manual configuration.

Use Case : Creating a user in an application database

The above scenario caters for setting up a new customer with a working application environment. When a user needs to be set up, they may also need to be added to the database and granted access.

By adding automation to the User Assignment event, a script can be executed, it automatically gains the context of the user, and the customer and can subsequently execute the desired process to create the user in the application.

Use case : Storage Management

An application that requires disk or cloud storage may also need to add storage on assignment to a customer. This could also increase limits based on how many users are assigned.

Use case : Archiving of data

Automated process to archive data can be applied when removing a Workspace Item from a user. By adding a script to copy data into an archival folder, data is not lost and process for specific customers is automatically executed.

Adding Events to Workspace Type

Workspace Item Types act as a template and grouping for Workspace Items. If every Workspace Item of that type will require the same automation script to execute, then you should define the event at the Workspace Item Type level. It will then be inherited by every workspace item of this type.

Example : Workspace Item Type "User Group Policy"

A Workspace Item type is defined that applies group policy based on a users membership of a group.

Automation added that will create the GPO when the Workspace Item is assigned to the Customer. In this case, the automation would be added at the Workspace Item Type level as each Workspace Item needs to run the automation.

Adding Events to Specific Workspace Items

If the automation is specific to a particular Workspace Item, Define the automation at the Workspace Item level.

You can also have automation applied at both the Workspace Type and the Workspace Item level - both automations will be executed sequentially when the event fires.

Context and Properties

Atria ensures that the context of the customer is available for customer.provision and customer.deprovision events. In addition the user context is provided for user events.

The actual properties may vary based on how your Customer and User entities are configured. The below tables show the baseline properties available for Customer and User events.

Env Key:

  • * - Both Windows and Azure environments
  • a - Azure only
  • w - Windows only

Customer Propertes available

EnvPropertyexamplePurpose
*CreatedByjamesp_adpUsername of user initiating change
*CreatedByCustomerId3821CustomerID of the user initiating the change
*CreatedByUserEmailjames@adpsol.comEmail address of user initiating change
*CreatedByUserID43433UserID of user initiating change
*CreatedByUserLabelJames PeachDisplay name of user initiating change
*CreatedByUserNameJamesp_adpUsername of user intitiating change
*CreatedByUserPrincipalNamejames@adpsol.comUPN of user initiating change
*CustomerContactEthan BracksPrimary contact name stored on customer record
*CustomerContactEmailEthan@avenues.co.ukEmail address of contact from customer record
*CustomerID2188Unique CustomerID of customer service is provisioned to
*CustomerKeyAttributeadminDescription,extensionAttribute15AD attributes that will be stamped with the CustomerID for User and OU objects
*CustomerLongNameAvenues Recruitment LtdFull name of customer, the servie is being provisioned to
*CustomerOUPatternAvenues Recruitment Ltd (ARL) *should be removed*Name of OU for customer
*CustomerPathCustomers *should be removed*Path to customers OU
*CustomerShortNameARLShort identifying name for customer
*ItemDescriptionMicrosoft Word is the worlds leading word processor for windowsFull description of the Workspace Item being assigned to the customer or user.
*ItemDisplayNameMicrosoft WordThe name of the Workspace Item
*RequestID239920Identifier for the request
*RequestedByJamesp_adpName of the user requesting the change
*RequestedByUserID43433Id of user requesting change
*ServiceID24999Service identifier for Workspace
*ServiceLabelWorkspaceDescriptive name of service
*ServiceNameWSName of Service
*ServiceObjectID288839Object Identifier, unique within Atria objects
*dirResNameresMsWordTypically the groupname, although in Azure the Displayname is used
*dirResNameUIDe9c41e95-71be-4214-b620-ac6aaaca7ea0The UniqueID of the group
wdirUserGroupNameARL resMsWordFor Group where users are made members when an item is shared
wdirUserGroupNameUID251fd013-fdfb-4bd9-b852-8745fef8f3f3The UniqueID of the UserGroup
*IDPTypeActiveDirectory | AzureADThe base group type (or Environment)
*IDPGroupType0x80000002The actual group type
*IsCreateGroupItemTrue | FalseSpecifies whether an actual group is created for the item
wIsSharedItemTrue | FalseIs the group shared among other customers or not
wUserIDPTypeActiveDirectorySame as IDPType, but for the User Group
wUserIDPGroupType0x80000002Same as IDPGroupType, but for the User Group
*SKUmsw12User Specified SKU for the item

User Properties available

EnvPropertyexamplePurpose
aAzureUserIDDBFE7060-A562-4D18-9C58-6684CD55E930The Azure UserID making it easier to find the user affected within Azure
*ListNameARL Private ListThe name of the list that the item is associated with
*ProvisioningStringws-ad-mswordUser defined Provisioning String associated with the item
*TypeDesktop ApplicationThe WorkSpace item type
*UserEmailethan@bracks.co.ukName of User the Workspace Item is being assigned to
*UserExternalEmailethan192@gmail.comExternal email of user
*UserfullnameEthan BracksFull name of user
*UserID213User Identifier
*Usernameethan_arlUser username (and unique identifier within customer)

Configuring

Event script properties retrieved or set through the Add|Remove|Set-AtriaWorkSpaceEventScriptProperties functions.

Add-AtriaWorkSpaceEventScriptProperties Syntax

Add-AtriaWorkSpaceEventScriptProperties [-ScriptEnvironment] <string> [-Target] <string> [-Name] <string[]> [<CommonParameters>]
ScriptEnvironment

The environment associated with the property. Available values are currently Windows or Azure

Target

Either User or Customer

Name

The name of the property to add to the list of properties for this particular event type. Note: The property must be a property that is available within the Provisioning Request.

Get-AtriaWorkSpaceEventScriptProperties Syntax

Get-AtriaWorkSpaceEventScriptProperties [-ScriptEnvironment] <string> [-Target] <string> [<CommonParameters>]

Remove-AtriaWorkSpaceEventScriptProperties Syntax

Remove-AtriaWorkSpaceEventScriptProperties [-ScriptEnvironment] <string> [-Target] <string> [-Name] <string[]> [<CommonParameters>]