Product Documentation

Configuring Macros

Oct 20, 2015

Device Manager 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 Automated Actions), among other usages. 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 pre-populate the mailbox value for a user in an Exchange profile across thousands of users.

This section provides an overview on the use of macros in Device Manager.

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 above)

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}

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 username 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.