On 7/31/2012 5:06 AM, ayeungied wrote:
> the sAMAccountName = xxxx_yyy
> I need to create a proxyAddress as
> ProxyAddresses = SMTP:xxxxyyy@abc.com.
> How to acheive it?
> Thanks & Regards,

So are you mail enabling the user with the Exchange powershells and
service built into the driver? If so you will get an SMTP: entry already.

Upper case SMTP vs lower case smtp: means primary in these fields.

So you would want to loop over the values in AD and remove any existing
SMTP: values, since they are very Highlander'ish in AD and there can be
only one.

<token-query class-name="User">
xml:space="preserve">Cn=user,ou=users,dc=doman,dc= com</token-text>
<token-text xml:space="preserve">proxyAddresses</token-text>
<if-local-variable mode="regex" name="current-node"
<do-remove-dest-attr-value class-name="User" name="proxyAddresses">
<arg-value type="string">
<token-local-variable name="current-node"/>

Then I am not sure if your issue is just removing underscores? If so,
it could be as simple as:

<do-add-dest-attr-value class-name="User" name="proxyAddresses">
<arg-value type="string">
<token-replace-all regex="_" replace-with="">
<token-dest-attr class-name="User" name="sAMAccountName"/>