Pages

Thursday, 4 August 2016

Creating sessions to Exchange Online, Skype for Business Online and SharePoint Online

This blog post is based upon this one from Microsoft, except I have simplified it;


Although the link above, does open up sessions to all of the services from a single window, this allows you to pass commands around, which you cannot do if individual sessions are open.

Exchange Online

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

Import-PSSession $ExchangeSession

Skype for Business Online

Download and install the Skype for Business PowerShell modules;

https://www.microsoft.com/en-us/download/details.aspx?id=39366

$Creds = Get-Credential
Import-Module LyncOnlineConnector
$SFB = New-CsOnlineSession -Credential $Creds

Import-PSSession $SFB

SharePoint Online

$Creds = Get-Credential
Connect-SPOService -Url https://domain.sharepoint.com -credential $Creds