Recipe5.18.Setting a Default Reply-to Address for a Mailbox


Recipe 5.18. Setting a Default Reply-to Address for a Mailbox

Problem

You need to change the default reply-to SMTP address for a mailbox.

Solution

Using a graphical user interface

  1. Log on to any machine in your domain that has the Exchange management tools installed.

  2. Open the ADUC snap-in (Users and Computers.msc).

  3. Locate the container that holds the mailbox whose reply-to address you want to modify.

  4. Select the mailbox you want to modify, then right-click it and choose Properties.

  5. Select the E-mail Addresses tab in the Properties dialog box.

  6. Click New. Select a type of address, typically this will be SMTP Address.

  7. Type the new email address and click OK.

  8. Click on the new address and click Set As Primary.

  9. Remove the check from the Automatically update email addresses based on recipient policy box.

Using a command-line interface

  1. Use your favorite text editor to create an LDIF file. The file should appear as the sample below; you'll obviously need to change the DNs and proxy addresses to match your requirements:

    # ------------------ import-proxy.ldf --------------------- dn: CN=alex,OU=TestUsers,DC=3sharpaustin,DC=com changetype: modify replace: proxyAddresses proxyAddresses: smtp:alex.secondary@foo.3sharpaustin.com proxyAddresses: smtp:alex@3sharpaustin.com proxyAddresses: smtp:alex.ldif.something@3sharpaustin.com proxyAddresses: SMTP:alex.default.ldif@3sharpaustin.com proxyAddresses: X400:c=us;a= ;p=First Organization;o=Exchange;s=alex; - dn: CN=alex,OU=TestUsers,DC=3sharpaustin,DC=com changetype: modify replace: mail mail: alex.default.ldif@3sharpaustin.com - dn: CN=alex,OU=TestUsers,DC=3sharpaustin,DC=com changetype: modify replace: msExchPoliciesExcluded msExchPoliciesExcluded:  {26491CFC-9E50-4857-861B-0CB8DF22B5D7} -

  2. Save the file with a .ldf extension.

  3. Next, run the following command:

    > ldifde -i -f yourFile.ldf -s DCname

Using VBScript
' This code forcibly sets the default reply address for a mailbox  ' and then excludes it from recipient policy processing so that the RUS ' doesn't replace the changed reply address.  ' ------ SCRIPT CONFIGURATION ------  CONST ADS_PROPERTY_UPDATE = 2 strDCName= "<server>"  ' e.g., "BATMAN" strContainer= ", CN=Users, <ForestRootDN>" strUser= "<userName>"                 ' e.g., "Paul Robichaux"  strDefaultAddr= "<defaultSMTPaddr>"         ' e.g., paulr@domain.com strProxyAddr1= "<additionalSMTPaddr>"        ' e.g., paul.robichaux@domain.com strX400addr="<X400addr>"     'e.g., c=us;a= ;p=First Organization;o=Exchange;s=paulr; ' ------ END CONFIGURATION --------- ' get the target mailbox Set objMailbox = GetObject("LDAP://" & strDCName & _                            "/CN=" & strUser & strContainer) objMailbox.Put "mail", strDefaultAddr objMailbox.PutEx ADS_PROPERTY_UPDATE, "proxyAddresses", Array(_               "SMTP:" & strDefaultAddr, _               "smtp:" & strProxyAddr1, _               "X400:" & strX400Addr) objMailbox.PutEx ADS_PROPERTY_UPDATE, "msExchPoliciesExcluded", _                  Array("{26491CFC-9E50-4857-861B-0CB8DF22B5D7}") objMailbox.SetInfo WScript.Echo "Reset proxy addresses on " & strDefaultAddr

Discussion

This recipe shows how to add a new reply-to address to a mailbox and set it as default. To set the default reply-to address across a larger number of objects, it is wiser to create a new recipient policy that is based on an LDAP query that applies to that group. Keep in mind that by default the highest-priority recipient policy that applies to the object will stamp the mailbox with an SMTP address (assuming that the policy contains an SMTP address specifier!). If you wish to manually set the default SMTP address, you should clear this property; otherwise, if the recipient policy and the addresses you've just entered are of the same type, the manually entered addresses will be overwritten the next time the RUS runs. The GUI has a checkbox labeled Automatically update email addresses based on recipient policy, which you will clear so that the information is not overwritten. When adding a new recipient policy programmatically, automatic updating is disabled by adding a value to the msExchPoliciesExcluded property. Changing this property to the value {26491CFC-9E50-4857-861B-0CB8DF22B5D7} achieves the same result as deselecting the automatic update checkbox in the GUI; if you want to reset it programmatically, you simply reset it to a null value by deleting that string.

See Also

Recipe 5.19 for creating recipient policies, which is the preferred way to update many addresses in the organization at once, and MS KB 318072 (Update E-Mail Addresses Based on Recipient Policy)



Exchange Server Cookbook
Exchange Server Cookbook: For Exchange Server 2003 and Exchange 2000 Server
ISBN: 0596007175
EAN: 2147483647
Year: 2006
Pages: 235

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net