Office 365 Powershell Task Add new smtp email address

In Knowledge Base Blog by CoryLeave a Comment

Run Powershell.exe as administrator
Set-ExecutionPolicy unrestricted Note: Allow Scripts

Paste Into Powershell Begin:
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Paste End:

get-mailbox Note: to get alias for object mailbox

Set-Mailbox janedoe -EmailAddresses @{add=”smtp:test@yourdomain.onmicrosoft.com”}

(Get-Recipient janedoe).emailaddresses Note: List email addresses