Submit a ticketCall us

Get a crash course on Network Monitoring delivered right to your inbox
This free 7-day email course provides a primer to the philosophy, theory, and fundamental concepts involved in IT monitoring. Lessons will explain not only how to perform various monitoring tasks, but why and when you should use them. Sign up now.

Home > Success Center > Server & Application Monitor (SAM) > Exchange Online Statistics using Powershell Script

Exchange Online Statistics using Powershell Script

Table of contents
Created by John Wallace, last modified by MindTouch on Jun 23, 2016

Views: 239 Votes: 0 Revisions: 5

Overview

This article provides information on how to setup a monitor that keeps track of the number of pending messages in the Exchange Online service.

This is done via PowerShell by connecting to Exchange Online as this template tracks the statistics of Exchange mailboxes of Exchange Online server using PowerShell scripts.

 

Environment

All versions of SAM

Detail

Prerequisites: 

Check the following article for prerequisites: http://technet.microsoft.com/en-us/library/jj984289(v=exchg.150).aspx (Connect to Exchange Online Using Remote PowerShell).
Note:

The PowerShell script mentioned in the Microsoft article above should be run on the Orion server, not the target node.

Credentials: 

Should be Administrator credentials for Microsoft Office 365 (https://portal.microsoftonline.com). For example: user@domain.onmicrosoft.com

 

Monitored Components

The recipient Statistics Report

This component monitor returns recipient statistics report which include the following:

  • Total Number Of Mailboxes
  • Total Number Of Active Mailboxes
  • Number Of Contacts
  • Number Of Distribution Lists

 

Total Items Count

This component monitor returns the total number of emails on the server.

 

Total Items Size (MB) 

This component monitor returns the total mail size on the server in MB.

Specific User Items Count

This component monitor returns the number of emails for the specified user.

Note: You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. This monitor requires the following  argument: 

user_name 

where:
user_name – target username;

Example: john

Specific User Items Size (MB)

This component monitor returns the mailbox size for the specified user in MB.

Note: You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. This monitor requires the following argument:

  user_name

  where:
  user_name – target username;

Example: john

 

Test User MAPI Connectivity

This component verifies that a specified mailbox can connect by using the MAPI protocol, which is used by Microsoft Office Outlook.

Note: By default, this monitor is disabled.

Possible returned values:
0 – Test failed. See message field for errors.
1 – MAPI Test successfully finished.

Note: You must specify the correct arguments in the Script Arguments field of the corresponding PowerShell Monitor. This monitor requires the following argument:

  user_name

  where:
  user_name – target username;

Example: john

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

and running

 

(Get-MessageTrace - Status Pending).count.

 

Office 365 User Statistics with PowerShell.apm-template:

https://thwack.solarwinds.com/servle...l.apm-template

 

 

Last modified
02:52, 23 Jun 2016

Tags

Classifications

Public