Dynamic tokens

You can use dynamic tokens in any Workspace Environment Management actions to make them more powerful.

String operations

Sometimes you need to manipulate strings within a script to map drives or launch applications. The following string operations are accepted by the Workspace Environment Management agent:

#Left(string,length)#
#Right(string,length)#
#Truncate(string,length)#

&Trim(string)&
&RemoveSpaces(string)&
&Expand(string)&

$Split(string,[splitter],index)$

#Mid(string,startindex)#
!Mid(string,startindex,length)!

Note:

All Operators are case sensitive. String operations are also supported with hashtags and Active Directory attributes. In cases where your string operations are nested, Mid operations are always performed last.

Hashtags

Hash-tags are a replacement feature widely in Workspace Environment Management item processing. The following example illustrates how you use hash-tags:

To write to an .ini file, you can use %UserName% in the .ini file’s path and Workspace Environment Management processes it and expands the final directory. However, assessing the value which Workspace Environment Management writes in the .ini itself is more complicated: you may want to write %UserName% literally, or write the expanded value.

To increase flexibility, ##UserName## exists as a hash-tag, so that using %UserName% for a value writes it literally and ##UserName## writes the expanded value.

The following hash-tags have been implemented for general use:

##UserName##
##UserProfile##
##FullUserName##
##UserInitials##
##UserAppData##
##UserPersonal##
##UserDocuments##
##UserDesktop##
##UserFavorites##
##UserTemplates##
##UserStartMenu##
##UserStartMenuPrograms##
##ComputerName##
##ClientName##
##ClientIPAddress##
##ADSite##
##DefaultRegValue##
##UserLDAPPath##
##VUEMAgentFolder##
##RDSSessionID##
##RDSSessionName##
##ClientRemoteOS##
##ClientOSInfos##

Hash-tag ##UserScreenCaptureComment## is implemented for use in specific parts of the product. This tag can be included in the Email Template under Advanced Settings > UI Agent Personalization > Helpdesk Options. When included, users are presented with a comment field located below the screen capture in the agent screen capture utility. The comment is included in the support email at the location at which you placed the tag in the email template.

Note:

All Hashtags are case sensitive.

Active Directory attributes

To work with Active Directory attributes, WEM replaces the [ADAttribute:attrName] value with the related Active Directory attribute. [ADAttribute:attrName] is the dynamic token for any Active Directory attributes. There is a related filter that checks the value of the specified attributes.

For user organizatioanl unit (OU) structures, WEM replaces the [UserParentOU:level] value with the related Active Directory OU name. The Active Directory path is the complete user path (LDAP) in Active Directory and [UserParentOU:level] is a subset of it.

For example, suppose you want to build a network drive for an OU to which the users belong. You can use the dynamic token [UserParentOU:level] in the network drive path to resolve the users’ OU dynamically. There are two ways to use the dynamic token:

  • Use the [UserParentOU:level] dynamic token directly in the network drive path. For example, you can use the following path: \\Server\Share\[UserParentOU:0]\.
  • Set an environment variable called OU, and then set its value to [UserParentOU:0]. You can then map the drive as \\Server\Share\%OU%\.

Note:

  • All AD attributes are case sensitive.
  • You can substitute the digit “0” with the number that corresponds to the level you want to reach in the OU structure.
  • You can append variables to the path. To do this, ensure that you have an exact folder structure that matches your OU layout.

You can also use Active Directory attributes for filtering purposes. On the Administration > Filters > Conditions > Filter Condition List tab, you can open the New Filter Condition window after you click Add. In the New Filter Condition window, you can see the following four filter condition types associated with Active Directory attributes:

  • Active Directory Attribute Match
  • Active Directory Group Match
  • Active Directory Path Match
  • Active Directory Site Match

For Active Directory Attribute Match, the dynamic token is [ADAttribute:attrName]. There is no dynamic token available for Active Directory Group Match because that condition type is used to check a group membership. For Active Directory Path Match, the dynamic token for the full LDAP path is ##UserLDAPPath##. For Active Directory Site Match, the dynamic token is ##ADSite##.