Connecting PowerShell to your Outlook Live tenant

So, my first podcast on R3… and I thought I would start at the beginning… where else?

Double-click to view in full screen

http://silverlight.services.live.com/invoke/71782/basicpssessionmanagement/iframe.html

Download

To interact with Outlook Live through PowerShell, you will need to authenticate using your administrator LiveID and create a remote PowerShell session (in R2, these were called RunSpaces). The first account that you created on your Outlook Live tenant is an admin account. This account has the ability to do everything on your tenant, including using PowerShell. If you want to create additional admin accounts, please see http://help.outlook.com/.

You can authenticate in a number of ways… 1 simple example follows… but if you are a developer, you may have some other ideas.

Open Powershell, and enter:

$Cred = Get-Credential

This will present a dialog box into which you will store your LiveID admin username (e.g. admin@contoso.edu) and your password. $Cred is the name of the variable that will contain your credentials for use in other commands. If you don’t like $cred, feel free to call the variable something else.

You will then need to create a PowerShell Session (from here on in, I will just refer to this as a session). Enter:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic –AllowRedirection

$Session is the session object… again you can call this variable whatever you like… $Jeremy, for example 🙂 . Note that in creating this session you are loading up the Exchange Shell (cmdlets that you will be using), connecting to our service securely over SSL, and pumping in your credentials from the first step.

Finally, you need to import this session into your local client so that you can start using it. Enter:

Import-PSSession $Session

All being well, you will now be able to run basic commands. I usually run:

get-mailbox admin

Don’t forget to remove your session once complete:

remove-PSSession $session

Enjoy!

Jonny

Technorati Tags: ,

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: