Cool Solutions

Using Special macros in ZCM 10



By:

December 21, 2007 3:25 pm

Reads: 8853

Comments:0

Score:0

In ZfD 7.x, we regularly used special built-in macros in our application objects. Some of our applications have many dependent apps, and we were looking for an easy way to log which apps were successfully deployed for troubleshooting purposes. Our solution was to have each ZEN app write to a single .INI file on the local hard drive, including the CN and distinguished name (DN) of the app and the date/time stamp. We were able to make use of the built-in special macro %*;DN%, which would resolve to the distinguished name of the app object.

01___INI_0_0.jpg

Click to view.

Figure 2 – Selecting the container with the driver

Unfortunately, the old method of enclosing eDir attributes in %*;% doesn’t appear to work in ZCM 10, and the documentation does not currently make any mention of these special macros.

Some of us in the Novell Support Forums have begun trying to figure these out on our own.

Generating a list of attributes for testing

To generate my list, I ran the old tool NDS Reports to look at a typical eDirectory user object. I then right-clicked on the user object details, selected “Export to Excel” and opened the file in Excel. The first column is the attribute, the second column is the corresponding value. In Excel 2007, I clicked on the “Data” ribbon, and then clicked on the “Filter” button. I then went to Column B, clicked on the little drop-down icon, and unchecked the option “(Blanks)”. This hides all of the attributes which do have blank values associated to them. I then copied the contents of Column A into notepad.

Creating a Bundle for testing

I created a Bundle called “Test Macros”. It is a Simple Windows Bundle with a single Launch action, which is “Prompt User”. I set “Seconds to be displayed” to 0 so it does not go away. I added a new English prompt, and pasted into the “Prompt” field the list of attributes I generated which had non-blank values. They were:

  • ACL
  • Allow Unlimited Credit
  • App:Associations
  • Back Link
  • CN
  • creatorsName
  • Description
  • Group Membership
  • GUID
  • Home Directory
  • Language
  • Last Login Time
  • Login Script
  • Login Time
  • modifiersName
  • Object Class
  • Password Allow Change
  • Password Minimum Length
  • Password Required
  • Password Unique Required
  • Public Key
  • Revision
  • SAS:Login Configuration
  • SAS:Login Configuration Key
  • Security Equals
  • Surname
  • uniqueID
  • Used By
  • zenwmLoggedInWorkstation
  • zenzfdVersion

In order to get anything useful out of this list, we need to convert it into ZCM’s macro format, which is to append ${ to the beginning of the name and } to the end. E.g. ${CN}. It also helps to have a reminder of what each macro is, instead of just seeing the output. So I modified each line so that it is in the following format:

<Attribute name>=${<Attribute name>}

i.e.

  • ACL=${ACL}
  • Allow Unlimited Credit=${Allow Unlimited Credit}
  • App:Associations=${App:Associations}
  • Back Link=${Back Link}
  • CN=${CN}
  • creatorsName=${creatorsName}
  • Description=${Description}
  • Group Membership=${Group Membership}
  • GUID=${GUID}
  • Home Directory=${Home Directory}
  • Language=${Language}
  • Last Login Time=${Last Login Time}
  • Login Script=${Login Script}
  • Login Time=${Login Time}
  • modifiersName=${modifiersName}
  • Object Class=${Object Class}
  • Password Allow Change=${Password Allow Change}
  • Password Minimum Length=${Password Minimum Length}
  • Password Required=${Password Required}
  • Password Unique Required=${Password Unique Required}
  • Public Key=${Public Key}
  • Revision=${Revision}
  • SAS:Login Configuration=${SAS:Login Configuration}
  • SAS:Login Configuration Key=${SAS:Login Configuration Key}
  • Security Equals=${Security Equals}
  • Surname=${Surname}
  • uniqueID=${uniqueID}
  • Used By=${Used By}
  • zenwmLoggedInWorkstation=${zenwmLoggedInWorkstation}
  • zenzfdVersion=${zenzfdVersion}

I then associated the Bundle to a user, and executed the Bundle. I get the following output:

02___Macros_guessed.jpg

As you can see, very few values were properly resolved.

I went into ConsoleOne and began looking at the fields for a user object. After some trial and error, I have found that the following macros resolve to something useful in ZCM 10 Bundles (at least using eDirectory):

  • CN
  • Home Directory
  • Full Name
  • Given Name
  • Surname
  • Title
  • Location
  • L
  • Postal Code
  • Department
  • Telephone Number
  • Facsimile Telephone Number
  • Description

03___Macros_working_so_far.jpg

I am sure that there are more which will work, but we do not use many of them so I didn’t try them all.

Jared Jennings was able to figure out how to access more Windows system variables. Read through the thread on Novell’s Support Forum for more details.

If you come across any more macros which can be used, please add it to the list!

I am especially interested in macros that are specific to the Bundle itself, e.g. the version number of the Bundle, the description of the Bundle, etc.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Tags: ,
Categories: Uncategorized

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS