Tuesday, June 28, 2016

Add external contacts to Office 365 - Add external contacts to O365

Add external contacts to Office 365 - Add external contacts to O365

With Powershell ISE

$UserCredential = Get-Credential

Set-executionpolicy unrestricted

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection



Import-PSSession $Session


Import-Csv pathfilename.csv|%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress}


Example:
Import-Csv C:\temp1\userlist.csv|%{New-MailContact -Name $_.Name -DisplayName $_.Name -ExternalEmailAddress $_.ExternalEmailAddress}


userlist.csv (has 2 columns)

Name ExternalEmailAddress

http://incoreporation.com       https://ca.incoreporation.com       http://wwebservices.ca 

No comments:

Post a Comment

Featured Posts

Exchange Online Limits - Office 365 Distribution group limits

Exchange Online Limits - Office 365 Distribution group limits What are Exchange Online Limits What are Office 365 Distribution group limi...