Remote Access to Office 365 Via Powershell

In an on-premise Exchange environment, your PowerShell connection to the server is essentially a remote session (even though it occurs within your Kerberos-enclosed domain).  In an Exchange 2010 environment the EMC (when installed on a Windows desktop) obscures this relationship but it’s there nonetheless.

It’s no different when you connect to Office 365 for PowerShell administration (which is, as I’ve stated before, the best and most powerful way to manage your Exchange tenant).

The how-to is basic and covered well by Microsoft here and at Tom’s IT Pro here.

Briefly, the syntax is very simple:

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection
Set-ExecutionPolicy RemoteSigned
Import-PSSession $Session

In which, an object named $UserCredential is created that employs the get-credential cmdlet to gather your, well, credentials and passes that to Office365’s web service (for PowerShell).

The session data is imported so the cmdlet set appropriate for Office365 is imported.  This includes familiar tools such as get-mailbox.

When finished, you end your session by invoking Remove-session $Session which cleans up your PowerShell threads of execution (preventing orphaned sessions).


Cogmotive: An O365 Business Intelligence Tool

Bogart, Humphrey (Maltese Falcon, The)_02

Cogmotive is a London, UK-based firm focused on providing what is, as far as I know, the only business intelligence tool for managing both the technical and financial (i.e., licensing) aspects of Office 365.

Cogmotive has two advantages over the built-in tools Microsoft offers for Office 365 management:

1.) Cogmotive is built around license management – an area in which Microsoft under-serves its O365 customers.  So, each function, regardless of ostensible technical objective, provides detailed information about the license impact and by extension, cost.

2.) Cogmotive is not a technical resource alone but also (and this is unique for O365) a business intelligence  platform designed to help O365 customers understand how their investment is actually used by employing both exec-friendly visual displays and engineer-friendly, comprehensive reports (downloadable as CSV files).

This is a very basic guide to the Cogmotive product offering.

Let’s start with the main dashboard:


The dashboard provides easy to understand pie-charts showing active vs. inactive mailboxes and devices – a handy display of the tenant’s current state from a licensing point of view.

On the left-hand side of the screen, you see the reporting sections which are as follows:

Find Recipient
General User Reports
• Tenant Reports
Mail Traffic Reports
• Exchange Reports
Lync Reports
Distribution Group Reports
Mobile Device Reports
• Security Reports
License Reports
• SharePoint Reports
• Custom Report
• Saved Reports
• Request Help
• User Management
• Profile and Settings

Skipping around a bit, we can see that the General User Reports, Lync Reports , Exchange Reports and License Reports sections provide high-level information about how user accounts are utilized within the O365 tenant, such as users logged in per day:

general user reports - users logged in per day

Mobile Devices by OS:

mobile devices by OS

Lync session information:

Lync Reports - Lync Sessions Per Day

Subscription usage overview:

subscription overview
Cogmotive offers a powerful and feature-rich toolset – built on PowerShell – for obtaining command and control of the Office 365 environment (key to controlling costs).

Oh and here’s another quite good review of Cogmotive by  And the Cogmotive Reports Blog can be quite informative too.