Connecting Power Shell to Office 365 for Enterprises


Before connecting to any Office 365 PowerShell interface, the following must be installed:

  • Power Shell V2.0
  • Windows Remote Management
  • BITS 4.0
  • Organization IDCRL*
  • Windows 7 or Windows 2008*

Note: Requirements that are marked with an asterisk (*) are only for the Microsoft Online Services Module for Windows PowerShell cmdlets.

The core prerequisites can be installed by downloading and installing Windows Management Framework.


Supported operating systems

The supported operating systems are as follows:

  • Windows Server 2008 R2*
  • Windows 7*
  • Windows Vista Service Pack 1 SP1 or SP2
  • Windows Server 2008 SP1 or SP2
  • Windows Server 2003 SP2
  • Windows XP SP3

Note; Requirements that are marked with an asterisk (*) are only for the Microsoft Online Services Module for Windows PowerShell cmdlets.

Connect to Exchange Online by using Remote Shell PowerShell

The following steps assume that you have met all the installation requirements. To connect to Exchange Online by using Remote PowerShell, follow these steps:

  1. Open PowerShell 2.0. (Run as Administrator)
  2. At the prompt, type $cred = Get-Credential. The user is prompted to enter their administrative credentials.
  3. Create a Remote PowerShell object. To do this, type the following:

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

  1. Before you can run remote scripts, you must run set-executionpolicy remotesigned
  2. Download all the available cmdlets from the server. To do this, type Import-PSSession $session. After this command is run successfully, the available cmdlets are downloaded.

To obtain a complete list of cmdlets that are available in this interface, after you are connected, run the Get-Command command at the PowerShell prompt.

Should My Computer Run All The Time?

I am often asked whether I recommend leaving a computer on all the time or turning it off. The computers in your office are low hanging fruit when it comes to saving energy, whether you’re in it for the monetary benefits or just because you’re trying to be kinder to the environment. Some are surprised to hear me recommend shutting down all workstations at the end of the workday.

I recently hooked a Kill-A-Watt (Amazon Affiliate Link) meter up to a modest computer typical of what I might find at my clients’ offices and found that it uses 1.7kW in an eight hour workday. This was at an idle – I did no work on it at all on it. So here is a little math on the cost of leaving the system on outside of working hours:

Assuming 10 cents per kWh we burned 17 cents worth of electricity. (Roanoke area residential cost in January 2011)
If I leave it on all night (5pm-8am) we burn an extra 32 cents outside of “working hours.”
For 20 work days we have $6.40 of excess cost.
For 8 weekend days we have $3.92 of excess cost.
That gives us $10.32 every 28 day period, of which we have 13 in a year, for a total of $134.16 per year in excess costs.

So on this computer’s fourth birthday, it will have used $536.64 if I had a habit of leaving it on all night. As a small business owner, will that $134/yr for each computer help your budget?

Let’s turn them off!