12.3 Novell eDirectory Attribute Special System Variables

The ZENworks Application Window supports system variables that pull information from the attributes of the currently logged-in user.

The following sections explain the system variable syntax and provide examples:

12.3.1 Syntax

eDirectory attribute system variables use the following syntax:

%eDirectory_attribute%

Table 12-3 Special System Variable Syntax

Element

Description

%

Flags the text as a system variable. The entire system variable must be enclosed in% characters.

eDirectory_attribute

Defines the attribute to be read.

You can use the ConsoleOne Schema Manager (available from the Tools menu) to view an eDirectory object’s available attributes.

NOTE:For compatibility with traditional ZENworks, the special system variables can also be specified in one of the following formats:

  • %system_variable%

    For example, %CN%

  • %*system_variable%

    For example, %*CN%

12.3.2 Examples

The following table provides examples of eDirectory attribute system variables.

Table 12-4 Special System Variable Examples

Macro

Description

%CN%

Returns the common name of the currently logged-in user.

%DN%

Returns the distinguished name of the currently logged-in user.

%Full Name%

Returns the full name of the currently logged-in user. This is the name defined in User object > General tab > Identification page > Full Name field.

%Given Name%

Returns the first name of the currently logged-in user. This is the name defined in User object > General tab > Identification page > Given Name field.

%Surname%

Returns the last name of the currently logged-in user. This is the name defined in the User object > General tab > Identification page > Last Name field.

The remaining system variables that are predefined by ZENworks are available in the following locations:

  • On Windows: ZENworks_Home/microfocus/zenworks/datamodel/authsource/edirectory-users.zls.xml

  • On Linux: /etc/opt/microfocus/zenworks/datamodel/authsource/edirectory-users.zls.xml

12.3.3 Configuring the eDirectory Attribute Special System Variables

To use eDirectory attributes as a reference in the bundle system variables, use the following procedures:

On the eDirectory Server

Define a name mapping between LDAP attribute types and eDirectory attribute definitions. You can log in to Novell iManager and click Attribute Map to do the mapping. For example, you can choose to map an eDirectory attribute named GWMailID, which stores the user e-mail id, to a Primary LDAP Attribute named Mail.

Only User attributes are supported.

For information on mapping the LDAP attribute types and eDirectory attribute, see Novell eDirectory Administration guide at the Documentation Website.

On the ZENworks Server

  1. Edit the sample file to create a file that contains the attribute that you want to use with ZENworks:

  2. Add an entry for the attribute that you want to use with ZENworks. For example:

    <attribute name="ZEN" ldapName="Mail" builder="com.novell.zenworks.datamodel.session.jndi.builder.StringAttributeBuilder" />

    Replace ZEN with the attribute that you want to use with ZENworks and replace Mail with the Primary LDAP Attribute that you mapped with the eDirectory attribute named GWMailID.

    You must use the right builder, depending on whether the syntax is a string, integer, or Boolean. The edirectory-users-additional.zls.xml.sample file lists the different type of builders.

  3. Save the sample file as edirectory-users-additional.zls.xml.

  4. Replace the edirectory-users-additional.zls.xml file on all the Primary Servers in the Management Zone.

  5. Restart the zenserver service.

Sample Scenario

Create a bundle with an action that references the macro and that runs in the user impersonation mode. For example:

  1. Create a bundle with a Run Script action that references the special system variable, ${ZEN} and has the executable security level set to Run as logged in user.

  2. Perform the bundle assignment.

    When the action is executed on the managed device, the value of the LDAP attribute is substituted for the special system variable.

In the example, the email id stored in the GWMailID attribute is substituted for the special system variable, ${ZEN}. Consequently, when the action is executed on the managed device, the e-mail ID stored in the GWMailID attribute is displayed on the device.