Connecting to Office 365 PowerShell

Many time I find myself wanting to connect to Exchange, Skype for Business, and Azure AD all at the same time.  Maybe I have a sheet that has parts from each of those area and I need to connect it all in another sheet.  This post is derived from this page, but simplified, I hope

To do this, you need Windows 8 or later (or 2012 or later) and .net framework 3.5

And you need to set the PowerShell Execution Policy.  I generally set it to unrestricted, but the minimum is RemoteSigned.  To run this command it must be done in elevated permissions

Set-ExecutionPolicy -ExecutionPolicy Unrestricted

All of this is 64 bit (not sure why you would be using 32bit Windows)
1.Download and install the Microsoft Online Services Sign-in Assistant Module
2.Download and install the Azure Active Directory Module
3.Download and Install the Skype for Business Online Module  Though you don’t really need this all the time, but it helps

Reboot your computer

Open a PowerShell and import the modules you need

Import-Module SkypeOnlineConnector

Import-Module MSOnline

Import-Module MSOnlineExtened

Wait, no Exchange.  That is right, you connect to exchange by importing the module when connected.

Now I setup a dedicated user for online management, something like  This way I can always connect even if ADFS or DirSync is broken.

$cred = get-credentials or

Connect to office 365

Connect-MsolService -Credential $cred

Connect to Exchange Online

$exsession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $cred -Authentication Basic -AllowRedirection

Import-PSSession $exsession

Connect to Skype for Business Online

$sfbonline = New-CsOnlineSession -Credential $cred

Import-PSSession $sfbonline –AllowClobber

6 thoughts on “Connecting to Office 365 PowerShell

  1. Prix Du Amoxicillin En Suisse [url=]Buy Cialis[/url] How To Identify Amoxicillin From Mexico Find Macrobid 100mg Bacterial Infections Visa

  2. El Cialis Es Mejor Levitra How Long Does It Last Difference Between Augmentin And Amoxicillin [url=][/url] Amoxicillin Dairy Animation Du Clomid Buy Propecia Online From Canada

Leave a Reply

Your email address will not be published. Required fields are marked *