Update 03 Feb 2016 : Added code to allow changing the domain name only without having to connect to Active directory and code for narrowing down the processing to the default profile/account/store or just the default ones.
Usage: ProfileAccountUpdateTool [-?] [-ad] [-dc dcname] [-pm <1, 2 or 3>]
[-am <0, 1 or 2] [-sm 1 or 2] [-od olddomainfqdn] [-nd newdomainfqdn]
-ad: Retrieve the new SMTP address from active directory.
-dc: Name of the Domain Controller to connect to. RootDSE used by default.
-t: AD timeout in seconds. Default value is 120 seconds.
-od: The FQDN of the old domain. For example: contoso.com.
-nd: The FQDN of the new domain. For example: northwindtraders.com.
-pm: Profile mode: 1 = default, 2 = all, 3 = specific.
-pn: Name of the profile to process. For example “Outlook”.
The default profile will be used if no profile name is specified.
-am: Account mode: 1 = default, 2 = all.
-sm: Store mode: 1 = default, 2 = all.
-? Displays this usage information.
1) Use AD to retrieve the primary SMTP address. Connect to CONTOSO_DC_01:
ProfileAccountUpdateTool -ad -dc CONTOSO_DC_01 -t 180
2) Specify the old and new SMTP domains and skip AD lookup
ProfileAccountUpdateTool -od contoso.com -nd talespintoys.com
2) Specify the old and new SMTP domains and skip AD lookup. Update all
profiles, stores and accounts
ProfileAccountUpdateTool -od contoso.com -nd talespintoys.com -pm 2
-sm 2 -am 2
This is a follow up post for Outlook Code: Change the name of the root folder in Outlook 2010 after an SMTP address change. Whilst the sample add-in that I’ve published at that time renamed the root folder in a simple and efficient way, it wasn’t possible to change the Account name, for which reason Outlook users were seeing their old SMTP address in the Mail From field in Outlook which seemed to cause a lot of confusion. To address that, I have written a sample application that updates both the Account name and the root folder display name.
The sample uses Extended MAPI for logging on to the default profile and updating the default store display name (root folder), the Account Management API to access the default account and update the name and the Active Directory Service Interfaces to connect to Active Directory and retrieve the Primary SMTP address corresponding to the SMTP address set as the default account name.
I’m attaching both the code and the compiled executable below.