Connect to Exchange Online using remote PowerShell & message format for specific domain

https://technet.microsoft.com/en-us/library/jj984289(v=exchg.150).aspx

$UserCredential = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
{Do work}
When done:
Remove-PSSession $Session
**************************************
To set mail type for specific domain: 
New-RemoteDomain -Name <Name of External Domain> –DomainName
Set-RemoteDomain -Identity <Name of Domain> -TNEFEnabled $false
Get-RemoteDomain -Identity <Name of Domain>| Select TNEFEnabled
Back to Top