Office 365 User Statistics with PowerShell

This template tracks the statistics of Exchange mailboxes of Exchange Online server using PowerShell scripts.

Prerequisites

See Use PowerShell in SAM for prerequisites.

Credentials

  • An Orion account with SAM administrator permissions.
  • An Office 365 account with global administrator privileges.
    • The account must be a member of an Office 365 admin role.
    • The account should be an all-in-one, inclusive account to support the monitoring of all mailboxes.

Use UPN format (username@domain) — not domain\username format to enter credentials. Also, a service account for Exchange Web Services is recommended to avoid authentication issues when passwords are updated.

Component monitors

For details on monitors, see SAM component monitors.

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.

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.

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.

By default, this monitor is disabled.

Possible returned values:

  • 0 – Test failed. See message field for errors.
  • 1 – MAPI Test successfully finished.

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