By David Wiseman (Administrator)published 01 Mar 2009
My Rating:
Vote
Rating:
Not Rated
Views:11708

Bulk Modify - XML PlaceHolders

What are XML Placeholders?

XML placeholders allow you to base a modification on another active directory attribute. For example [Firstname].[Surname] for user account names.  XML placeholders can also be used to do find and replace operations and other string manipulation functions.  You don't need to be an XML guru to use XML placeholders in Bulk Modify - a series of examples are provided below that you can modify to suite your requirements.  The Bulk Modify application also includes some hyperlinks that automatically insert XML placeholders.

Text outside the <attr></attr> tags will be used as is.  The text inside the tags will be replaced by the active directory attribute spacified.  Please see the Active Directory Schema Guide page for common Active Directory attribute names. 

Examples

FirstName.Surname:

 <attr>givenName</attr>.<attr>sn</attr>

Surname, FirstName:

<attr>sn</attr>, <attr>givenName</attr>

Convert company name to UPPERCASE:

<attr transform="UPPER">company</attr>

Convert display name to lowercase:

<attr transform="LOWER">displayName</attr>

Convert display name to Proper Case:

<attr transform="PROPERCASE">displayName</attr>

Replace "WiseSoft" with "WiseSoft Corporation":

<attr findtext="WiseSoft" replacewith="WiseSoft Corporation">company</attr>

Remove whitespace from description attribute:

From start and end:

<attr transform="TRIM">description</attr>

From end only:

<attr transform="RTRIM">description</attr>

From start only:

<attr transform="LTRIM">description</attr>

First Letter of FirstName + Surname:

<attr transform="LEFT(1)">givenName</attr><attr>sn</attr>

Last 4 characters of Telephone Number (Extension?):

<attr transform="RIGHT(4)">telephoneNumber</attr>

3rd and 4th character of EmployeeID

SUBSTIRNG(start,length)

<attr transform="SUBSTRING(3,2)">employeeID</attr>

Convert first letter of First Name to Uppercase

<attr transform="LEFT(1)" transform2="UPPER">givenName</attr><attr transform="SUBSTRING(1,*)">givenName</attr>

NULL attribute values

XML Placeholders will generate a validation error by default if the attribute specified does not have a value.  The application will not attempt to modify the value.  You can change this behaviour by specifying a "nullvalue" attribute in the XML Placeholder.  If the attribute does not have a value, the text specified for "nullvalue" will be used.

The following example will replace any null values for the surname (sn) attribute with a blank string.

<attr nullvalue="">sn</attr>, <attr>givenName</attr>

If the surname didn't have a value but the first name was set to "David", the placeholder above would produce ", David".  You might just want to use the value of the first name attribute where the surname attribute is null.  You can do this by specifying the ", " as a postfixtext attribute in the XML placeholder.  e.g.

<attr nullvalue="" postfixtext=", ">sn</attr><attr nullvalue="">givenName</attr>

The prefixtext and postfixtext attributes are ignored when the attribute has a null value.






Password Control