Barwa
asked on
ADModify SMTP Variables
Hi,
I am trying to change the default SMTP address of all Windows server 2003/Exchange server 2003 users from the default value to firstname.lastname@domain. com using ADModify
The issue is that the "last name" field on AD contains more than a single word so how can we:
1- Eliminate the spaces in the "last name" field
or
2- Use only the last word in the "last name" field
An example follows
Our AD is populated as follows:
The first name field contains only the first name
The last name contains the (father name + family name)
Now we need the SMTP address to look like:
firstname.fathername.famil yname@comp any.com
or
firstname.familyname@compa ny.com
Regards
I am trying to change the default SMTP address of all Windows server 2003/Exchange server 2003 users from the default value to firstname.lastname@domain.
The issue is that the "last name" field on AD contains more than a single word so how can we:
1- Eliminate the spaces in the "last name" field
or
2- Use only the last word in the "last name" field
An example follows
Our AD is populated as follows:
The first name field contains only the first name
The last name contains the (father name + family name)
Now we need the SMTP address to look like:
firstname.fathername.famil
or
firstname.familyname@compa
Regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The spaces will be an issue and ideally you will need to either change the Last Name field to reflect the name you want, or manually change the addresses that don't get updated properly.
There is also a good reference here:
http://support.microsoft.com/kb/822447
This suggests that you might be able to use the following syntax:
%g.%r .%s@company.com
http://support.microsoft.com/kb/822447
This suggests that you might be able to use the following syntax:
%g.%r .%s@company.com
I have tested this on a live server (Exchange 2003) and can confirm that this works by producing the following:
Firstname.Fathername.Famil yname@comp any.com
Firstname.Fathername.Famil
ASKER
Thanks Alan, in fact I am using ADModify to do the bulk changes
So the spaces would remain an issue so that if a user is named as:
FirstName Fathername FamilyName@company.com
How would Exchange treat the spaces in that case?
Regards
So the spaces would remain an issue so that if a user is named as:
- First name is FirstName
- Last name is Fathername FamilyName
FirstName Fathername FamilyName@company.com
How would Exchange treat the spaces in that case?
Regards
In my last but one post - I have posted the solution that would provide you with firstname.fathername.famil yname@comp any.com.
If you setup a Recipient Poliy (not ADModify) and use
%g.%r .%s@company.com (there is a space after %r)
Then this will work.
%r is the replace command and the space gets replaced with a period from the Lastname Field. So if your lastname is Fathername Familyname it will end up as Fathername.Familyname.
If you setup a Recipient Poliy (not ADModify) and use
%g.%r .%s@company.com (there is a space after %r)
Then this will work.
%r is the replace command and the space gets replaced with a period from the Lastname Field. So if your lastname is Fathername Familyname it will end up as Fathername.Familyname.
ASKER
Sorry , I didn't notice that
I think firstname.fathername.famil yname would be too long , how can we simply make this as:
firstname.familyname@compa ny.com even if the father's name is part of the "last name" field in AD
Regards
I think firstname.fathername.famil
firstname.familyname@compa
Regards
I am not aware of a simple solution to achieve this. As everyone's name are going to be different and will no doubt have different length names, there is no elegant way to do this.
You can restrict the familyname part to a certain number of characters, but that is about it with Address Policies:
%g.%8s@company.com will produce firstname.1st 8 Characters of Familyname@company.com
You can restrict the familyname part to a certain number of characters, but that is about it with Address Policies:
%g.%8s@company.com will produce firstname.1st 8 Characters of Familyname@company.com
This is a good tool & its free to modify user attribute in AD..:-)
Download & try this.
http://www.wisesoft.co.uk/software/passwordcontrol/bulk_modify.aspx
Download & try this.
http://www.wisesoft.co.uk/software/passwordcontrol/bulk_modify.aspx
ASKER
Thanks , so the problem is in the "lastname" field itself or the %s variable
In fact and following alan's advice , I have added a new SMTP address to the existing recipient policy in the form:
%g.%s@company.com
the resultant email ID for all users was firstname.lastname@company .com without spaces but again if the last name field contains more than one word then it would appear in the SMTP address
The disadvantage to this method is that it gives a long email ID that is not so good-looking on a business card :)
In fact and following alan's advice , I have added a new SMTP address to the existing recipient policy in the form:
%g.%s@company.com
the resultant email ID for all users was firstname.lastname@company
The disadvantage to this method is that it gives a long email ID that is not so good-looking on a business card :)
Yes, the problem is because you have too many names in the lastname field.
If you didn't have fathersname and familyname there would not be a problem, but hopefully you have a solution now.
If you didn't have fathersname and familyname there would not be a problem, but hopefully you have a solution now.
ASKER
Thanks Alan
ASKER
Hi Alan , we have manually modified the "lastname" field of all user accounts to have a single word in it which is basically the family name
Now , I need to reverse the effect of the first.middle.last@company. com effect and remove all such SMTP addresses for all users
I have done the followings already:
smtp:%'givenName'%.%'sn'%@ company.co m
None of them worked for me , do I just need to wait for this to happen automatically after sometime?
Regards
Now , I need to reverse the effect of the first.middle.last@company.
I have done the followings already:
- Removed the %s.%g entry from the recepient policy
- Right-clicked the recepient policy with "apply this policy now" selected
- Right-clicked the two default "recepient update service" entries with "update now" selected
smtp:%'givenName'%.%'sn'%@
None of them worked for me , do I just need to wait for this to happen automatically after sometime?
Regards
The recipient policies only add smtp addresses, they don't take them away I am afraid. As far as I am aware, you will need to manually remove the email addresses that you no longer need and replace the recipient policy %g.%s@company.com which will put back the firstname.familyname@compa ny.com address in the new correct format.
ASKER
That is too much work to do
Can't we simply do that with tools like ADModify?
Regards
Can't we simply do that with tools like ADModify?
Regards
I think you can use Admodify to remove addresses based on the policy we applied earlier e.g., %g.%s@company.com
ASKER
Thanks Alan , I think when it comes to removing SMTP addresses with ADModify , it only understands the @domain.com part so what I think of doing is to run this tool with the option *@domain.com against all users so that it cleans out all first.middle.last@domain.c om addresses of all users including the defualt ones and then run the %g.%s using the recepient policy
Regards
Regards
No problems - obviously difficult to know about your environment without seeing it, but I would imagine stripping them all and then applying the recipient policy will be a good idea.