Our legacy email format is the first initial followed by the surname at domain.net—for example, Bob Morton uses [email protected]. New accounts use [email protected], such as [email protected]. I need to add the newer address as an additional alias for several hundred existing users. What is the safest way to generate and apply these aliases with PowerShell, while checking for duplicate names or addresses first?
4 Answers
The basic update is fairly simple, but the risky part is assuming names are unique. People can share the same first and last name, and some accounts may already have conflicting aliases. Build in validation, produce an exception report, and don’t automatically update rows that fail those checks.
The right command depends on the environment. With on-premises Exchange, an email address policy may be able to apply the format automatically. In a hybrid or cloud-managed setup, the authoritative attribute and update command can be different, so confirm where mailbox addresses are managed before modifying Active Directory directly.
Make a couple of test users or a small pilot group first, then verify that the new address appears correctly and that mail delivery still works. Once the output is confirmed, run the bulk update with logging so you have a record of every successful change and every skipped account.
I’d start by exporting the target users to CSV, generate the proposed alias in a separate column, and review the results before changing anything. Check both duplicate generated addresses and aliases that already exist elsewhere. Once the file looks correct, use it as the input for the update script and test with a small group first.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures