Tuesday, June 9, 2015

Exchange Management Shell and Active Directory

Working in multi-domain / multi-site environments can sometime be tricky if we don’t know how the Exchange Management Shell (EMS) queries Active Directory (AD) in these scenarios.

In Exchange 2013 and 2010, we can use the Set-AdServerSettings cmdlet to manage the Active Directory Domain Services (ADDS) environment in the current EMS session. This cmdlet cmdlet replaces the AdminSessionADSettings session variable that was used in Exchange 2007 (which we will look at in a minute).

The following example specifies that all recipients in the entire forest can be viewed and managed (by default, only those in the local domain are used):
Set-AdServerSettings -ViewEntireForest $True

The following example sets the recipient scope to the IT Users OU in the nunomota.pt domain for the current session:
Set-AdServerSettings -RecipientViewRoot “nunomota.pt/IT Users”

The following example sets the scope of the current session to the entire forest and designates dc1.nunomota.pt as the preferred global catalog server.
Set-AdServerSettings -ViewEntireForest $True -PreferredGlobalCatalog dc1.nunomota.pt

The following are the most common parameters that administrators change:
PreferredGlobalCatalog: specifies the FQDN of the global catalog server to be used for reading recipient information in this session;
PreferredServer: specifies the FQDN of the domain controller to be used for this session;
RecipientViewRoot: specifies the OU to include in the recipient scope for this session. When we specify a recipient scope with this parameter, only the recipients included in the scope are returned;
ViewEntireForest: when we specify a value of $true, the value stored in the RecipientViewRoot parameter is removed and all of the recipients in the forest can be viewed and managed.

As already mentioned, in Exchange 2007 we had a variable named $AdminSessionADSettings for this purpose. To achieve the same as the examples above, all we have to do is update this variable as follows.

The following example specifies that all recipients in the entire forest can be viewed and managed (by default, only those in the local domain are used):
$AdminSessionADSettings.ViewEntireForest = $True

The following example sets the recipient scope to the IT Users OU in the nunomota.pt domain for the current session:
$AdminSessionADSettings.DefaultScope = “nunomota.pt/IT Users”

To set the recipient scope to the nunomota.pt domain and use dc1.nunomota.pt as the recipient domain controller, run the following commands:
$AdminSessionADSettings.DefaultScope = “nunomota.pt”
$AdminSessionADSettings.PreferredDomainControllers = “dc1.nunomota.pt”

Changing the recipient scope in the EMS changes the set of recipients that are returned for the Get- cmdlets of the recipient. The fields that are stored in the $AdminSessionADSettings variable are retained until the EMS is closed and is reset to its default settings the next time that the EMS is opened.

To make the changes permanent, we have to manually edit the Bin\Exchange.ps1 file in the Exchange Server installation folder and update lines such as:
$global:AdminSessionADSettings.ViewEntireForest = $false

Thursday, May 28, 2015

How to Convert a Distribution List into a Mailbox

Sometimes, an organization/administrator might have the need to convert a Distribution Group (DG) (or Distribution List) into a normal mailbox or a shared mailbox. Reasons for this vary, but the most common one is when an organization has the need to start sending emails as that DG.
Unfortunately, there is no native way of achieving this. But it is completely achievable and straightforward. The best way is to:
  1. Write down the DG’s LegacyExchangeDN. To do so, you can run the cmdlet: Get-DistributionGroup “DG_name” | Select LegacyExchangeDN;
  2. Delete the DG;
  3. Create a (shared) mailbox with the same SMTP address;
  4. Add the DG’s legacyExchangeDN as an X500 address to the new mailbox.

I am not going into detail of what the legacyExchangeDN is and how or why it is used as this is already well documented all over the Internet. As a quick overview, the auto-complete cache in Outlook and in OWA uses the value of the legacyExchangeDN attribute to route email messages internally. If the value changes, the delivery of email messages may fail with a 5.1.1 NDR.
If you already deleted the DG and have no way of retrieving its legacyExchangeDN, you have two options:
  1. Clear the auto-complete cache (straightforward but most of the times not the best approach);
  2. Manually create an X500 proxy address for the old legacyExchangeDN attribute for the DG.

To create an X500 proxy address, you need to use an NDR you have received when emailing the DG, which should contain the recipient’s address such as:

From here, make the following changes based on the recipient address in the NDR:
  • Replace any underscore character (_) with a slash character (/);
  • Replace “+20” with a blank space;
  • Replace “+28” with an opening parenthesis character;
  • Replace “+29" with a closing parenthesis character;
  • Delete the “IMCEAEX-“ string;
  • Delete the “@nunomota.pt” string;
  • Add “X500:” at the beginning.

After you make these changes, the proxy address will look similar to:
X500:/O=LetsExchange/OU=Exchange Administrative Group (FYDIBOHF23SPDLT)/CN=Recipients/CN=f6a32c0ab0e64f33b2a7b3f9a48c2da6

Friday, May 15, 2015

Create Folder on Users’ Mailboxes

One could think that the Exchange Online and Exchange 2013 New-MailboxFolder cmdlet would allow administrators to create folders on other users’ mailboxes. Unfortunately this is not the case...
Basically RBAC (Role Based Access Control) only allows the administrator to run this cmdlet on the mailbox it owns. As we can see below, RBAC has an implicit recipient read and write scope set to Self:
So can we create a new role based on MyBaseOptions and update the ImplicitRecipientReadScope to OrganizationConfig? Once again, unfortunately no... You see, if you read the Understanding management role scopes TechNet article, it states that:
You can't change the implicit scopes defined on management roles. You can, however, override the implicit write scope and configuration scope on a management role. When a predefined relative scope or custom scope is used on a role assignment, the implicit write scope of the role is overridden, and the new scope takes precedence. The implicit read scope of a role can't be overridden and always applies.
By the way, the exact same thing applies to the Get-MailboxFolder cmdlet... The good news for this cmdlet is that we can simply use the Get-MailboxFolderStatistics cmdlet to list all folders in any mailbox we want.
So, as far as I know, there is nothing we can do to make this cmdlet work for other mailboxes the administrator does not own. So is there a way to create folders for other users? Yes, using Exchange Web Services (EWS) script!    :)
I have written a few EWS scripts to perform certain actions on mailboxes that are not possible using the native Exchange cmdlets. To achieve this, I am not going to re-invent the wheel as there is already a great script by David Barrett to do exactly what we want. For more information on his script, please check his blog article PowerShell: Create folders in users' mailboxes.

Wednesday, May 6, 2015

Exchange 2013 EAC Performance Console

Almost 3 years ago, on my Exchange 2010 ECP Performance Console article on MSExchange.org, I explored the Performance Console of the Exchange Control Panel in Exchange 2010. Did you know that this console is still present in Exchange 2013?
This console, which is not visible by default, provides numerous counters regarding the performance of the EAC. We can use it to check how long it takes to authenticate a user, how many PowerShell cmdlets have been invoked and even how long the server took to process requests, and much more.
To enable it, we have to manually edit the web.config file located at:
Open the file with Notepad and look for the "appSettings" section, right in the first few lines. In there we will find the following key:
<!-- Set ShowPerformanceConsole to "true" to show ECP's Perf Console: -->
<add key="ShowPerformanceConsole" value="false" />
As the comment explains, all we have to do to enable the console is update the value of the ShowPerformanceConsole key from false to true. Save the file, run the usual IISRESET /NOFORCE to restart IIS and we are good to go!
If we now log in to the EAC, we will have a Performance console link:
Clicking on this link opens the console itself:
To learn more about this console, check my Exchange 2010 ECP Performance Console article at MSExchange.org.

Updating AADSync Scheduled Task

If you ever need to update AADSync’s scheduled task, it is likely that you will need to update the credentials it runs under. When you do that, and if you do not assign the correct permissions, you might get the following error message:
This is because the account used does not have the required permissions. Make sure you add it to the local Admins group and to the local ADSyncAdmins group.

Tuesday, April 28, 2015

Exchange 2013 Performance Health Checker Script

Microsoft has just published the Exchange 2013 Performance Health Checker script, which checks various configuration items on Exchange 2013 servers to make sure they match the recommendations published in the “Exchange 2013 Sizing and Configuration Recommendations” guidance on TechNet. It also reports on OS, system and hardware information. It can be ran remotely, against a single server or a group of servers.
The script takes some of the most common configuration causes of Exchange 2013 performance cases that Microsoft has encountered in support and allows administrators to rule them out quickly without having to check each server or read through the entire TechNet guidance.
The current list of items the script reports on is:
  • Operation System version
  • Exchange Build
  • Physical/Virtual Machine
  • Server Manufacturer and Model (physical hardware only)
  • VM host processor/memory configuration recommendations
  • Exchange server roles
  • Pagefile Size
  • Power Settings
  • .NET Framework version
  • Network card name and speed
  • Network card driver date and version (Windows 2012 and Windows 2012 R2 only)
  • RSS enabled (Windows 2012 and Windows 2012 R2 only)
  • Physical Memory amount
  • Processor Model
  • Number of processors, cores, and core speed
  • Hyper-threading enabled/disabled
  • Processor speed being throttled
  • Current list of active/passive databases and mailboxes (optional)
Let us look at some examples. First, we run the script without any parameters, meaning it will check the local server. We could use the –Server parameter to run it against a remote server.

By including the –MailboxReport parameter, the script presents some statistics around mailboxes and databases:

Another useful parameter is –LoadBalancingReport which looks at all CAS servers to determine how user connections are being load balanced across these servers. We can use the -CasServerList to specify which CAS servers we want to check.

Every time the script runs, it outputs the results to a log file as mentioned at the end of every output. In the next screenshot we can see the report from the cmdlet above:

Monday, April 20, 2015

Office 365 Compliance Center

The new Compliance Center contains the key compliance-related features for an Office 365 administrator to manage compliance across Office 365, Exchange Online and SharePoint Online.
Currently many of the compliance features are still accessible through service-specific management interfaces, such as the Exchange Admin Center. However, this will change in the future as more service independent compliance features are added to the Compliance Center.
Consolidating compliance functionality across services into this single area will make compliance features easier to access and enhance your end-to-end task-based experience.
To access the Compliance Center you can either go directly to its URL at https://compliance.protection.outlook.com/Ucc or, if you are an Office 365 administrator:

1. Sign in to Office 365;
2. Select the app launcher icon in the upper-left and choose Admin:
3. In the lower-left navigation, expand Admin and choose Compliance:
4. You are then taken into the new Compliance Center:
As mentioned, this is currently being rolled out so it is possible that you will not see all the features in here just yet. For example, there will be an Auditing section as well which is not yet present in my tenant.
Stay tuned for a full article on the new Office 365 Compliance Center!

Tuesday, April 14, 2015

AADSync Performance Counters Error

While working on a project recently, I came across the following error on my AADSync server:

Log Name:      Application
Source:        ADSync
Date:          1/12/2015 12:47:11 PM
Event ID:      6313
Task Category: Server
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      AADSync.contoso.com
Description: The server encountered an unexpected error creating performance counters for management agent “xxxxx.onmicrosoft.com – AAD”.

Performance counters will not be available for this management agent.

To fix this issue in AADSync, you can either perform a clean install (often out of the question) or run the following commands to reload the performance counters:

  1. Stop AADSync’s service;
  2. Delete the following registry key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSync\Performance];
  3. Recreate the Performance key;
  4. Run the following two commands from an elevated command prompt:
    • unlodctr.exe ADSync
    • lodctr.exe “C:\Program Files\Microsoft Azure AD Sync\Bin\mmsperf.ini”
  5. Start AADSync’s service.

Wednesday, April 1, 2015

Exchange Online Protection Quarantine

A decade ago, Bill Gates predicted a spam-free world by 2006. Although we are seeing a small decline in spam, this is unfortunately far from coming true... Exchange Online Protection (EOP) does a great job, in my opinion, at filtering out obvious spam. According to the latest figures from Microsoft, ten million spam messages are blocked every single minute on average by EOP, 10 million! That is an impressive number. However, every day attackers around the world come up with new techniques to fool spam detection engines. Threats take different forms, such as an unidentified spam campaign, unknown malware or a completely new virus. This means that a small percentage (around 3%) of email that is likely to be spam still comes through and are sent to users’ Junk E-mail folder. Users obviously do not want spam in their inboxes, but they often have to review this folder to make sure no good messages (false positives) are mixed in with the bad.
EOP provides two main methods of handling spam detected by its content filters. Administrators can configure it so that spam is sent to the Junk E-mail folder in Outlook and Outlook Web App (OWA), which is the default option, or to direct it into a web-based quarantine.
Sending spam to the Junk folder is the most common choice as that is what users have been using for many years. But from experience I also noticed that this is the case as not everyone is aware of the quarantine feature. On the other hand, some customers have non-Exchange email systems that do not support the Junk E-mail folder approach, have a 3rd party filtering system that sends spam reports to users, or simply prefer the spam quarantine.
Since EOP was launched it has supported spam quarantine, but initially administrators were the only ones who had access to this quarantine, through the Exchange Admin Center, and only they were able to release spam messages... But for some time now administrators can configure EOP to give users self-service management of spam-quarantined messages. So let us have a look at how this works and how we can configure it.
In this article, we will explore the Quarantine feature of EOP, including how to enable, configure and manage it both from the administrator and end user perspectives. To continue reading, please go to the Exchange Online Protection Quarantine article at MSExchange.org.

Friday, March 27, 2015

Speeding up the Exchange Hybrid wizard in global deployments

If you ever ran the Exchange Hybrid wizard in an environment with servers all over the world, it is likely that it took a few hours to run. But why?
If we look at the wizard’s logs ($exinstall\Logging\Update-HybridConfiguration), we will see that most of the changes are fairly quick. However, it eventually goes on to run a Get-WebServicesVirtualDirectory to analyse the EWS virtual directories (VDs) across all Exchange servers in the environment to determine if any need to be configured. If this comes back true, then the wizard runs the same cmdlet again followed by a Set-WebServicesVirtualDirectory to enable the MRS Proxy for VDs that currently have it disabled. After all the necessary EWS VDs are configured, the wizard runs a Get-WebServicesVirtualDirectory for a third time to validate the configuration/changes made.
The problem here is running the *et-WebServicesVirtualDirectory cmdlet between servers in different countries or even continents. How long does it take for you? Usually it should be a few minutes for each server, but I have seen cases where it takes 30 minutes or more. Now multiply that by the total number of Exchange servers and it can quickly turn into hours and hours...
If, for example, your environment also has Exchange 2007 servers, although these do not use or have the MRS Proxy service, because the wizard simply runs the Get-WebServicesVirtualDirectory cmdlet, this returns 2007 servers (instead of filtering them out...), which contributes to delaying the process.
So, to speed things up a bit, you can manually login to all the servers, enable the MRS Proxy and only then run the Hybrid Wizard. Typically I was only enabling it on the Hybrid servers or servers that I was planning to use for mailbox migration, but the wizard enables it across estate anyway...
To recap, the Mailbox Replication Service Proxy (MRS Proxy) facilitates cross-forest mailbox moves and remote move migrations between an on-premises Exchange organization and Exchange Online. During cross-forest and remote move migrations (aka hybrid migrations), a Client Access server acts as a proxy for incoming move requests for the Mailbox server. The ability of a Client Access server to accept these requests is disabled by default. To allow the Client Access server to accept incoming move requests, we have to enable the MRS Proxy endpoint.

Monday, March 23, 2015

Azure Active Directory Connect Public Preview

The latest version of the Azure AD Connect has been released – the March 2015 Public Preview update.

The Azure AD Connect wizard Public Preview provides a guided experience for integrating one or multiple AD forests with Microsoft Azure AD. Optionally you can configure Exchange Hybrid deployment, password change write-back, ADFS and Web Application Proxy.

Azure AD Connect encompasses functionality that was previously released as DirSync and AADSync. These tools will eventually stop being released individually and all future improvements will be included in updates to Azure AD Connect.

This latest version has been updated with new capabilities, support for additional sync options, Additional Tasks and “Pilot Mode”.

You can download it from the Connect website.

Friday, March 20, 2015

How to change AADSync credentials

When it comes to changing the credentials AADSync uses to connect to the on-premises Active Directory (AD) or to Azure AD, one might think that re-running the wizard and updating the credentials there would do the trick:

However, if you re-run the wizard again, you will see that the old credentials are still being used... So how can we change these credentials?! To do this, we need to use the miisclient.

First, navigate to "install dir"\Microsoft Azure AD Sync\UIShell and run missclient.exe. Then, click in Connectors. Here you will have two connectors, one is used to connect to the local AD and the other to connect to Azure AD:
To update the credentials used to connect to the local AD, double-click the respective connector and then go to Configure Directory Partitions. Here, select Alternate credentials for this directory partition, enter the new credentials and click OK:
To update the credentials used to connect to Azure AD, double-click the respective connector and then go to Connectivity. Here, enter the new credentials and click OK:
Job done!

Thursday, March 19, 2015

Dynamic Distribution Lists in a Hybrid Environment

In a hybrid deployment environment between Exchange Online and on-premises Exchange organizations, neither DirSync nor AADSync can be used to synchronize dynamic distribution lists (DDL) to Exchange Online. Therefore, mailboxes that have been migrated to Exchange Online cannot see DDLs in their GAL or email them.
To work around this issue, create a MailContact in Exchange Online for the DDL, and then grant permissions so that only authenticated senders can submit messages to the new contact. This object should have the following mappings:
On-Premises DDL
Cloud MailContact
You should also consider the scope of the DDL before mailboxes are moved to Exchange Online. If the scope included only mailboxes, the scope must be expanded to include mail users and mail contacts. To do this, open the properties of the DDL and on the membership tab (in Exchange 2013), also select Mail users with external email addresses. If using the Shell, add MailUsers to the IncludedRecipients property of the DDL.
Exchange Online users can now select the DDL from the GAL. When they do, messages will be delivered to the members of the group as defined by the settings for the group.

Friday, March 13, 2015

Exchange Online Protection Conditional Mail Routing

Simply put, Conditional Mail Routing, also known as Criteria Based Routing, is a way of configuring Exchange Online Protection [EOP] connectors in order to send or receive mail a certain way based on the condition of the individual email. For example, we can force TLS for a specific sender or route email based on recipients’ properties to different email server locations.
I was recently working on a global Exchange migration to Office 365. This particular client had an Office 365 tenant hosted in Europe with a Hybrid deployment in India. On top of that, there was a separate Exchange organization deployed across the United Kingdom and the United States of America.
For us to be able to update the MX records to point to the client’s Office 365 tenant, two requirements had to be met because of security and legal reasons:
  • Requirement 1: emails sent from partners to certain business application mailboxes (hosted on-premises in the UK) had to go directly from Office 365 to the Exchange servers in the UK, i.e., without being routed through India;
  • Requirement 2: emails addressed to US users had to go directly from Office 365 to the Exchange server on-premises in the US, i.e., without being routed through India.

To see how we can meet these 2 requirements using Conditional Mail Routing, please check my Exchange Online Protection Conditional Mail Routing article at MSExchange.org.

Sunday, February 22, 2015

Exchange Online Accept mail for all subdomains feature

In Exchange Online (not on-premises), under your Accepted Domains, you might have seen an option to accept mail for all subdomains:
When this feature is enabled for a domain, emails can be sent and received for subdomains of this domain. For example, if nunomota.pt is a provisioned domain and match subdomains support is enabled, users can send emails to or receive emails from a.nunomota.pt, b.nunomota.pt, a.b.nunomota.pt, and other subdomains.
This feature is usually for customers who have a hybrid environment with mailboxes that reside on-premises as it is only applicable for the Internal Relay domain type.
Following the example above, once the feature is enabled for the domain, Office 365 will be able to deliver emails that are sent to @a.b.nunomota.pt addresses by automatically forwarding them to my on-premises environment (assuming all connectors are in place).
But there is a small catch! Spam. Emails will not get blocked by EOP, meaning spammers can send millions of invalid emails to random addresses and their subdomains in order to try to overwhelm on-premises servers. Having said that, this is the case with most relay scenarios anyway.

Friday, January 23, 2015

Exchange Online Onboarding Message Size Limit Now 150 MB

Whenever administrators migrate mailboxes to Exchange Online, an onboarding limit in terms of message size always apply in order to avoid migrating huge messages and potentially impact service. Up until now this limit was 25MB (attachment size) plus overhead, so approximately 36MB in total. If a mailbox contained any emails over this size, they would simply be skipped and administrators had to find alternative ways to import them. To be honest, not many companied allow such big emails, but I have worked with a few that do, which would cause an issue if migrating to Office 365...

Now, this limit has been increased to 150MB (and is already available to all customers)! However, please have the following in mind:
  • This new limit only applies to onboarding moves using the native Mailbox Replication Service (MRS) and which target AD user objects with a RecipientType of MailUser (MEU) that do not have MaxReceiveSize stamped. For example, hybrid deployments;
  • All other data migration solutions, both using Microsoft tools and 3rd party tools target UserMailbox (MBX) AD users (i.e., rely on the mailbox already being created in Exchange Online). The increased onboarding message size limit does not apply to these solutions which will use the limit (MaxReceiveSize) configured on these MBX objects. The maximum-allowed onboarding message size limit for these solutions remains 36MB. This includes merges (staged and cutover migration), IMAP, EWS, MAPI, 3rd party tools, and PST Import.

The good news is that soon administrators will be able to customize the send/receive size limit, enabling them to modify the MaxSendSize and MaxReceiveSize limits on their MBXs and MEUs, effectively overcoming this limitations (hopefully).

The Exchange Online Service Description has now been updated to reflect this change.

Wednesday, January 21, 2015

Managing Exchange Online using Server 2012 R2 Essentials Experience Role

Windows Server 2012 Essentials and the Essentials Experience role build on the previous Office 365 Integration Module for Small Business Server 2011 Essentials. This option is now part of the core product (not a separate download) and provides a seamlessly integrated management experience on Essentials for customers who are using Exchange Online.

On top of the core feature set that was included in the Office 365 Integration Module for SBS 2011 Essentials, such as integrated user account management and automatic user password synchronization, Microsoft also made a few enhancements to make the experience better:
  • Support for multiple e-mail addresses. Having multiple domains and/or assigning multiple e-mail addresses to a single user are common scenarios even for small businesses. Now it is finally possible to easily do that from within the Essentials’ Dashboard;
  • Improved Office 365 domain configuration wizard. In the Office 365 Integration Module for SBS 2011 Essentials, administrators were required to configure Remote Web Access (RWA) when configuring a domain for Office 365, which caused a lot of confusion. For example, administrators had to provide an SSL certificate which was not actually needed by Office 365, but was required by RWA. Now these two have been de-coupled. Another improvement is the option to configure a different domain name for Office 365 and for RWA, allowing small businesses to continue to use the same free domain names like letsexchange.remotewebaccess.com for RWA on Essentials and a different domain name for e-mail in Office 365;
  • Display mailbox usage information. The Office 365 tab on the Essentials Dashboard now shows the mailbox usage information.

To read the full article, please check my Managing Exchange Online using Server 2012 R2 Essentials Experience Role article series on MSExchange.org.

Monday, December 15, 2014

Removing a Domain from Office 365 – What to check for

To remove a domain from Office 365, make sure that no settings are using the domain. You will not be able to remove the domain if one or more of the following conditions are true:
  1. User accounts or groups are associated with the domain;
  2. The proxies that correspond to the domain for all mail-licensed users and for all mail-enabled groups are not removed. Office 365 blocks the deletion of a domain until the proxies that correspond to the domain are removed;
  3. Lync Online Session Initiation Protocol addresses are used by the domain.
This is mostly common knowledge and what I usually check for when removing a domain. However, the last time I did this in one of my test tenants, I just wasn’t being able to remove it...
Initially I used the GUI:
But it always got stuck in this window no matter how long I waited for:
So I decided to do it from the Shell. After connecting to Office 365 I tried using the Remove-MsolDomain cmdlet with not much success:
So I checked for users associated with the domain I was trying to remove and there were none. By I forgot I had created contacts before, so I checked for any Exchange Online object that contained at least one email address that matched the domain, and voila!
Ok, certainly now it had to work, right? Not really...
Another inspiration and I remembered I had created an outbound connector for this domain to test Exchange Online Protection Conditional Mail Routing! And here it was:
So I removed it using the Shell and finally I was able to remove the domain!
Bottom line is, check everything! Including:
  • Whether user names contain the domain name: Get-MsolUser -DomainName “yourdomain.com”;
  • All recipients’ email addresses: Get-Recipient | Where {$_.EmailAddresses -match “yourdomain.com”};
  • Transport Rules;
  • Connectors;
  • Your public website hosted on Office 365.

Monday, December 8, 2014

Exchange 2013 Queue Velocity

When you use the Get-Queue cmdlet in Exchange 2013 you will see a Velocity property (not visible in the Queue Viewer tool):

So what exactly is this Velocity? Does zero means no emails is coming in or going out? Is zero a good thing?

The Velocity property is simply the drain rate of the queue. Exchange 2013 measures the rate of messages entering and leaving every queue and stores these values in queue properties. These rates can be used as an indicator of queue and transport server health. There are three properties: Velocity (which we have seen in the previous screenshot) and IncomingRate and OutgoingRate, both visible in the screenshot just below:

Their meaning is as follows:

This values is the rate at which messages are entering the queue. It is calculated from the number of messages entering the queue every 5 seconds averaged over the last 60 seconds. The formula can be expressed as (i1+i2+i3+i4+i5+i6)/6, where in is the number of incoming messages in 5 seconds.

Let us say that, as an example, we received 12 messages in the first 5 seconds and then 8 in the following 5 seconds. As such, our incoming rate is (12+8)/6 = 3.333

This value is the rate that messages are leaving the queue. It is calculated from the number of messages leaving the queue every 5 seconds averaged over the last 60 seconds. The formula can be expressed as (o1+o2+o3+o4+o5+o6)/6, where on is the number of outgoing messages in 5 seconds.

Continuing with our previous example, let us say that in the first 5 seconds 4 messages were sent, followed by 7 messages in the following 5 seconds and 9 messages in the next 5 seconds. As such, our outgoing rate is (4+7+9)/6 = 3.333

This property is the drain rate of the queue, and is calculated by subtracting the value of IncomingRate from the value of OutgoingRate.

In our example Velocity = OutgoingRate – IncomingRate = 3.333 – 3.333 = 0.
Although messages took slightly over to leave the queue (5 extra seconds), remember that what is considered is the average over the last 60 seconds, in which case, messages left the queue at the same time they entered in our example.

  • If the value of Velocity is greater than 0, messages are leaving the queue faster than they are entering the queue.
  • If the value of Velocity is equals 0, messages are leaving the queue as fast as they are entering the queue. This is also the value we see when the queue is inactive.
  • If the value of Velocity is less than 0, messages are entering the queue faster than they are leaving the queue, which is not ideal.

Bottom line: a positive value of Velocity indicates a healthy queue that is efficiently draining, and a negative value of Velocity indicates a queue that is not efficiently draining.

Does this mean I need to worry whenever this value is not zero? Well, not exactly. We also need to consider the values of the IncomingRate, OutgoingRate, and MessageCount properties, as well as the magnitude of the Velocity value for the queue. If someone all of the sudden sends a large email to everyone in your organization, it is possible that the Velocity will be negative for a short while.