Add an SMTP Address in Powershell

Here’s a quick script for Powershell that can be used to add a secondary SMTP address in Microsoft Exchange 2007.

$username=Read-Host "Enter username to add email address too."<br /> $secondsmtp=Read-Host "Enter a secondary email address"

$usermbx = Get-Mailbox $username<br /> $usermbx.emailAddresses+=$secondsmtp<br /> Set-Mailbox $usermbx -emailAddresses $usermbx.emailAddresses