Hi,

We have a placement rule which I've pasted below to generate an eight
character username based on:

1. First seven letters of surname followed by first initial.
2. If that's not unique, use six of surname and two from first name.
3. If that's not unique, use five of surname and three from first
name.
etc.

This works fine until I have a surname of something like O'Reilly. In
the case of Patrick O'Reilly, I'd end up with a seven character user
name of OReillP, when I'd expect OReillyP. That would be acceptable,
except if I add ANOTHER user, maybe Peter O'Reilly in the same
container, the account does not get created as it attempts to do so
with the same user name, so it's like the placement rule is testing
with the apostrophe but creating without.

From the point of view of the placement rule, ideally I need to strip
any apostrophes before attempting to generate a username. However,
I'd like surname field to be populated WITH the apostrophe.

How could I do this?

Many thanks,

PG

The rule we are using is below:
<rule>
<description>Token Unique Name</description>
<conditions/>
<actions>
<do-set-op-dest-dn>
<arg-dn>
<token-text xml:space="preserve">LEEDSTH\</token-text>
<token-local-variable name="cmt"/>
<token-text xml:space="preserve">\</token-text>
<token-attr name="OU"/>
<token-text xml:space="preserve">\</token-text>
<token-unique-name counter-digits="1" counter-pattern="last"
counter-use="fallback" name="CN" on-unavailable="error">
<arg-string>
<token-substring length="7">
<token-attr name="Surname"/>
</token-substring>
<token-substring length="1">
<token-attr name="Given Name"/>
</token-substring>
</arg-string>
<arg-string>
<token-substring length="6">
<token-attr name="Surname"/>
</token-substring>
<token-substring length="2">
<token-attr name="Given Name"/>
</token-substring>
</arg-string>
<arg-string>
<token-substring length="5">
<token-attr name="Surname"/>
</token-substring>
<token-substring length="3">
<token-attr name="Given Name"/>
</token-substring>
</arg-string>
<arg-string>
<token-substring length="4">
<token-attr name="Surname"/>
</token-substring>
<token-substring length="4">
<token-attr name="Given Name"/>
</token-substring>
</arg-string>
<arg-string>
<token-substring length="3">
<token-attr name="Surname"/>
</token-substring>
<token-substring length="5">
<token-attr name="Given Name"/>
</token-substring>
</arg-string>
<arg-string>
<token-substring length="2">
<token-attr name="Surname"/>
</token-substring>
<token-substring length="6">
<token-attr name="Given Name"/>
</token-substring>
</arg-string>
<arg-string>
<token-substring length="1">
<token-attr name="Surname"/>
</token-substring>
<token-substring length="7">
<token-attr name="Given Name"/>
</token-substring>
</arg-string>
<arg-string>
<token-substring length="7">
<token-attr name="Given Name"/>
</token-substring>
</arg-string>
</token-unique-name>
</arg-dn>
</do-set-op-dest-dn>
</actions>
</rule>