This is something I've had similar issues with before, but I think I've got
it worked out. It's ugly, but hopefully it will be helpful to someone out
there. This is also on IDM 2.

HR wanted to rename all of their user accounts to a new standard. They did
not have a groupwise driver in place for provisioning, nor do they want
that to be handled at this time. The result of this is that none of their
users have names that match any attribute in edirectory that is not
explicitly groupwise related.

This is what I had to include for the rename to keep the GW object
associated with the correct user account.

Any suggestions on how to clean this up? (Not a big deal, but I'd like to
avoid doing a query.)

It essentially grabs an already associated users first portion of the
association which is something like..
pridom.po1.username{106}asdsadjkjk-dsaiwoe and extracts the username and to
make sure its preserved, passes it in as the name its changing to.

I could have put some of the java commands toether but wasn't sure how that
was handled.

<xsl:template match="rename">
<xsl:variable name="foo" select="association/."/>
<xsl:variable name="allMatch" select="jstring:new($foo)"/>
<xsl:variable name="pre" select="jstring:indexOf($allMatch,'{')"/>
<xsl:variable name="smallMatch" select="jstring:substring($allMatch,0 ,
<xsl:variable name="post" select="jstring:lastIndexOf($smallMatch,'.')"/>
<xsl:variable name="almost" select="jstring:substring($smallMatch,$post)"/>
<xsl:variable name="finally" select="jstring:substring($almost,1)"/>
<xsl:apply-templates select="@*"/>
<xsl:value-of select="$finally"/>