Novell Home

Selectively Placing Users, from Flat to Hierarchical

Novell Cool Solutions: Tip
By Dan Denton

Digg This - Slashdot This

Posted: 27 Sep 2006
 

Problem

Here's an example of how to create a placement rule that places users from a flat structure, depending on whats in the user's attribute OU(Department), into a hierarchical structure in the Production Tree.

Solution

From Policy Builder:

If class name equal case insensitive User
and if source attribute department equal case insensitive "value of 
department attribute"
set operation destination DN " ou path structure you would like" + "\" + 
escape destination DN()operation attribute("CN")

With a series of these placement rules, you can get everyone in the proper ou, provided their department attribute is properly valued.

Here is the code excerpt taken from the exported driver. There are three cases: staff, xstaff and guest; the operative attr is lblempstat.

<rule name="PublisherPlacementRule">
	<policy>
		<rule>
			<description>guest</description>
			<conditions>
				<and>
					<if-class-name op="equal">User</if-class-name>
					<if-src-attr name="lblEmpStat" op="equal">guest</if-src-attr>
				</and>
			</conditions>
			<actions>
				<do-set-op-dest-dn>
					<arg-dn>
						<token-text xml:space="preserve">LBNL\People\Guest</token-text>
						<token-text xml:space="preserve">\</token-text>
						<token-escape-for-dest-dn>
							<token-op-attr name="CN"/>
						</token-escape-for-dest-dn>
					</arg-dn>
				</do-set-op-dest-dn>
			</actions>
		</rule>
		<rule>
			<description>Staff</description>
			<conditions>
				<and>
					<if-class-name op="equal">User</if-class-name>
					<if-src-attr name="lblEmpStat" op="equal">staff</if-src-attr>
				</and>
			</conditions>
			<actions>
				<do-set-op-dest-dn>
					<arg-dn>
						<token-text xml:space="preserve">LBNL\People\Staff</token-text>
						<token-text xml:space="preserve">\</token-text>
						<token-escape-for-dest-dn>
							<token-op-attr name="CN"/>
						</token-escape-for-dest-dn>
					</arg-dn>
				</do-set-op-dest-dn>
			</actions>
		</rule>
		<rule>
			<description>xstaff </description>
			<conditions>
				<and>
					<if-class-name op="equal">User</if-class-name>
					<if-src-attr name="lblEmpStat" op="equal">xstaff</if-src-attr>
				</and>
			</conditions>
			<actions>
				<do-set-op-dest-dn>
					<arg-dn>
						<token-text xml:space="preserve">LBNL\People\XStaff</token-text>
						<token-text xml:space="preserve">\</token-text>
						<token-escape-for-dest-dn>
							<token-op-attr name="CN"/>
						</token-escape-for-dest-dn>
					</arg-dn>
				</do-set-op-dest-dn>
			</actions>
		</rule>
	</policy>
</rule>


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell