Recipe 5.18. Setting a Default Reply-to Address for a MailboxProblemYou need to change the default reply-to SMTP address for a mailbox. SolutionUsing a graphical user interface
Using a command-line interface
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 DiscussionThis 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 AlsoRecipe 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) |