Forum Discussion
Add email alias to multiple O365 user accounts in bulk
VasilMichev
I need to do this exact thing (cloud)... can you tell me how to add a new domain as an alias email to all the users??
Our email address are firstname . Lastname @ olddomain Here is how I updated all of our email addresses.
get-aduser -Filter * | select samaccountname | Export-csv adusers.csv
Edit adusers.csv - Remove service accounts, etc and all accounts that should not be changed. Save.
Copy final list and put it in a text file - adusers.txt
Copy adusers.txt to Powershell folder
$adusers = get-contect adusers.txt
check $adusers - This should reflect the final list created in the csv file.
$adusers | Get-ADUser | ForEach-Object { Set-ADUser -EmailAddress ($_.givenName + '.' + $_.surna me + '@newdomain') -Identity $_ }
Get-ADUser -Properties * -Filter * | select name,samaccountname,emailaddress to check the results.