Macros 编辑
Endpoint Management provides macros as a way to populate user or device property data within the text field of the following items:
- Policies
- Notifications
- Enrollment templates
- Device configuration XML file
- Automated actions
- Credential provider Certificate Signing Requests
Endpoint Management replaces a macro with the corresponding user or system values. For example, you can prepopulate the mailbox value for a user in a single Exchange profile across thousands of users.
Macro syntax
A macro can take the following form:
${type.PROPERTYNAME}
${type.PROPERTYNAME ['DEFAULT VALUE'] [ | FUNCTION [(ARGUMENT1, ARGUMENT2)]}
Enclose all syntax following the dollar sign ($) 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.")}
. - Property names are case-sensitive.
- A function can be a limited list or a link to a third-party reference that defines functions. This macro for a notification message includes the function
firstnotnull
:
Device ${firstnotnull(device.TEL_NUMBER,device.serialNumber)}
has been blocked…
- For custom macros (properties that you define), the prefix is
${custom}
. You can omit the prefix.
Here’s an example of a commonly used macro, ${user.username}
, that populates the user name value in the text field of a policy. This macro is useful for configuring Exchange ActiveSync profiles and other profiles used by multiple users. The following example shows how to use macros in an Exchange policy. The macro for User is ${user.username}
. The macro for Email address is ${user.mail}
.
The following example shows how to use macros for a certificate signing request. The macro for Subject name is CN=$user.username. The macro for the Value of a Subject alternative name is $user.userprincipalname.
The following example shows how to use macros in a notification template. The example template defines the message sent to a user when HDX applications are blocked because of a non-compliant device. The macro for the Message is:
Device ${firstnotnull(device.TEL_NUMBER,device.serialNumber)}
no longer complies with the device policy and HDX applications will be blocked.
For more examples of macros used in notifications, go to Settings > Notification Templates, select a pre-defined template, and click Edit.
The following example shows a macro in the Device Name device policy. You can type a macro, a combination of macros, or a combination of macros and text to name each device uniquely. For example, use ${device.serialnumber}
to set the device names to the serial number of each device. Use ${device.serialnumber} ${ user.username }
to include the user name in the device name. The Device Name device policy works on supervised iOS and macOS devices.
Macros for default notification templates
You can use the following macros in the default notification templates:
${account.SUPPORT_EMAIL}
${applicationName}
${enrollment.andriod.agent.download.url}
${enrollment.ios.agent.download.url}
${enrollment.pin}
${enrollment.url}
${enrollment.urls}
${enrollment.ios.url}
${enrollment.macos.url}
${enrollment.android.url}
${enrollment.ios.platform}
${enrollment.macos.platform}
${enrollment.android.platform}
${firstnotnull(device.TEL_NUMBER,device.serialNumber)}
${firstnotnull(device.TEL_NUMBER,user.mobile)}
${outofcompliance.reason(smg_block)}
${outofcompliance.reason(whitelist_blacklist_apps_name)}
${vpp.account}
${vpp.appname}
${vpp.url}
${zdmserver.hostPath}/enroll
Note:
The Endpoint Management console includes the terms “blacklist” and “whitelist”. We are changing those terms in an upcoming release to “block list” and “allow list”.
This example shows how to create a notification that includes enrollment URLs for multiple device platforms. The macro for the Message is:
${enrollment.urls}
These examples show how to create messages for notifications that prompt the users to click the enrollment URL for their device platforms:
Example 1:
To enroll, click the link below that applies to your device platform:
${enrollment.ios.platform} - ${enrollment.ios.url}
${enrollment.macos.platform} - ${enrollment.macos.url}
${enrollment.android.platform} - ${enrollment.android.url}
<!--NeedCopy-->
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论