Set alternate email address for 365 accounts

Within your 365 tenant you can use the ‘Alternate email address’ field for each user to identify where to send links should the account be locked/password forgotten. You could of course leave this for the user to add, but if you know what the alternate should be, or even want to update multiple users at the same time, it can all be done with PowerShell (use Connect-MsolService first of course).

To check if an individual user has an alternate, and what it is set to:
Get-MsolUser -UserPrincipalName user@domain.com | select-object UserPrincipalName,@{Name=”AlternateEmailAddresses”;Expression={$_.AlternateEmailAddresses}}, DisplayName

To set the alternate for an individual user:
Set-MsolUser -UserPrincipalName user@domain.com -AlternateEmailAddresses @(“otheraddress@somewhereelse.com”)

To get a list of all users for the tenant and their alternate addresses (if any):
Get-MsolUser | select-object UserPrincipalName,@{Name=”AlternateEmailAddresses”;Expression={$_.AlternateEmailAddresses}}, DisplayName | export-csv -path C:\temp\altaddresses.csv

Update defined users with the alternate address supplied (in the .csv with column headings of UserPrincipalName and AlternateEmailAddresses):
Import-CSV C:\temp\altaddressupdate.csv | % { Set-MsolUser -UserPrincipalName $_.UserPrincipalName -AlternateEmailAddresses @($_.AlternateEmailAddresses) }

Related Posts

Need IT Help?

If you need assistance please feel free to reach out to us.