Product Documentation

Macros in XenMobile

Nov 06, 2015

XenMobile provides powerful macros as a way to populate user or device property data within the text field of a profile, policy, notification, or enrollment template (for some Actions), among other uses. With macros, you can configure a single policy and deploy it to a large user base and have user-specific values appear for each targeted user. For example, you can prepopulate the mailbox value for a user in an Exchange profile across thousands of users.

This feature is currently only available in the context of configurations and templates for iOS and Android devices.

Defining user macros

The following user macros are always available:

  • loginname (username plus domainname)
  • username (loginname minus the domain, if any)
  • domainname (domain name, or the default domain)

The following administrator-defined properties may be available:

  • c
  • cn
  • company
  • companyname
  • department
  • description
  • displayname
  • distinguishedname
  • facsimiletelephonenumber
  • givenname
  • homecity
  • homecountry
  • homefax
  • homephone
  • homestate
  • homestreetaddress
  • homezip
  • ipphone
  • l
  • mail
  • middleinitial
  • mobile
  • officestreetaddress
  • pager
  • physicaldeliveryofficename
  • postalcode
  • postofficebox
  • telephonenumber
  • samaccountname
  • sn
  • st
  • streetaddress
  • title
  • userprincipalname
  • domainname (overrides property described previously)

Additionally, if the user is authenticated by using an authentication server, such as LDAP, all the properties associated with the user in that store are available.

Macro syntax

A macro can take the following form:

  • ${type.PROPERTYNAME}
  • ${type.PROPERTYNAME ['DEFAULT VALUE'] [ | FUNCTION [(ARGUMENT1, ARGUMENT2)]}

As a general rule, all syntax following the dollar sign ($) must be enclosed in curly brackets ({ }).

  • Qualified property names reference either a user property, a device property, or a custom property.
  • Qualified property names consist of a prefix, followed by the actual property name.
  • User properties take the form ${user.[PROPERTYNAME] (prefix="user.")}.
  • Device properties take the form ${device.[PROPERTYNAME] (prefix="device.")}.

For example, ${user.username} populates the user name value in the text field of a policy. This is useful for configuring Exchange ActiveSync profiles and other profiles used by multiple users.

For custom macros (properties that you define), the prefix is ${custom}. You can omit the prefix.

Note: Property names are case-sensitive.