Powered by Ed Buford and Coffee

Office 365 PowerShell

So you’ve setup Office 365 in the Cloud – Let me be the first to congratulate you!
Kudos!   Now that that’s over you need to connect your workstation to it using PowerShell, so let’s get started.
You need to download and install a couple of files the first one is the Microsoft Online Services Sign-In Assistant for IT Professionals, download it here.

Once that is installed you need to install the Windows Azure AD Module. Go here and choose your OS (32 or 64 bit). Download and install the Module and you’re ready to get started.

Now all you have to do is connect your workstation to Office 365. Open PowerShell and type these commands:

Import-module MSOnline

This will import the Module you’ll need to make a connection to the Office 365

$Cred = Get-Credential

This will pop up a credentials box for you to put your Administrator UPN for Office 365 in.


Next create a new session based on your credentials:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $Cred -Authentication Basic –AllowRedirection

You’ll get a warning to tell you that you’re being redirected


Now Import a new PSSession based on the session you just created in the cloud.

connect-msolservice -credential $cred

And finally connect to the MS Online Service:

connect-msolservice -credential $cred

So to see the commands available now type:

Get-Command -Module msonline

Leave a Reply

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