Applications Systems
Exchange Online Statistics using Powershell Script
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.
First published date
Last published date
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.
Product section
Resolution
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: