Explore technical insights and updates for Office 365 and Exchange Server. Priasoft empowers IT professionals with reliable solutions and expertise.

Priasoft Migration Suite for Exchange (PMSE)

Once again, I found myself coding. A common occurrence since I am always assisting customers and partners whom hit a technological roadblock that can ultimately be solved with IT.  A similar roadblock was reached when I uncovered a frustrating issue with AutoDiscover while working on some updates to our own tools in order to support mapiHTTP connections.

In making updates to Priasoft Migrator so it would   support mapiHTTP it became necessary to retrieve data about mailboxes and public folders from AutoDiscover.  Since the most common connection to this service is conducted over a secure route (SSL/TLS), we wrote our code to do the same, essentially connecting to https://server/autodiscover/autodiscover.xml.

However, the computer where I do a bulk of the development tasks is not a domain-joined PC.  I do this by choice as it assures that if I hit any issues, they are worked through and make it into the product.

Once the new code was written and our team was initiating testing and production readiness, I began to test these updates on a domain-joined host.  Initially I found that the connections to the AutoDiscover service began timing out…from a domain joined machine!  One would not normally expect two machines that sit on the same LAN to timeout accessing a website or webservice.

Fiddler and Wireshark were brought in to scope to troubleshoot, and to our surprise we discovered that the SSL/TLS handshake between the client code and the IIS instance on the Exchange server was taking way too long.  As the code was written, the conversation with the webserver was handled synchronously such that further processing could not continue until the secure handshake complete.  By the time the handshake completed and the client code resumed, the internal timeout had expired and the whole thing unwound.

Searching the web proved to be a waste of time.  There was far too many variables that could give similar results, and all of the common topics that bubbled up didn’t match the experience I had.

To be clear, this did NOT occur from a non-domain-joined host.  At first glance I thought it was some difference between the OSes (dev is Win8, test host is Server2008) or some difference between .NET or a difference between updates or something…none of which presented an issue.

I also considered that maybe the issue was a factor of the authentication routine, since   AutoDiscover requires authentication before it can return information.  However, after much trial and error, we found that the authentication was not a variable either since the code was never reaching the authentication point; it was timing out before that could occur.

Raising the timeouts on the client code DID work.  However, there was such a stark contrast in the responsiveness between my dev host and the test host that increasing the timeouts just didn’t seem like the right answer.  So, as engineering led techies further investigation ensued.

Once it was determined that the issue lied solely in the SSL/TLS handshake, the focus move to that.  ILSpy was used to investigate some of the Microsoft code to see what it does and to see if there were flags or options to control how it worked.  We then encountered an anomaly from the Wireshark traces that became a focal point.  In those traces in became clear that before any TLS handshaking would occur, initial  attempts at a Kerberos/RPC connection to IIS would occur, , then finally a TLS handshake would take place.

In contrast, a non-domain-joined host never even attempted the Kerberos/RPC connections.  It would go immediately for the TLS handshake.  This seemed to be the key difference.  The question was how and why was my client code doing that?  We certainly didn’t write any code to try to make an RPC connection to the webserver!

So, as it is typical with such troubleshooting, many hours were consumed trying to control the connection to prevent the RPC connection attempt.  Basic authentication was looked at, and as mentioned before, had no bearing on the issue since that action comes AFTER the secure handshake.  But, intuitively it seems that such would possibly side-step this other connection action.

Wireshark would clearly show every time that “windows authentication” was being attempted first before the TLS handshaking.  One of the recurring trace elements from Wireshark was also several “SMB” logon attempts, but those were initially discarded as related because there were other communications outside of this client application that could connect with the same server.  Eventually the patterned showed that these SMB logons only occurred when the client code was running.

Upon looking at the details of these events, it was seen that the windows host where this client code was running was attempting to validate and authenticate to the Exchange server using “Windows Networking”, meaning a secure “integrated” connection that can occur between windows hosts in the same domain.  This ultimately is a part of LSA and SSPI and THIS IS ALWAYS DONE!  One cannot bypass this because the lower level code that handles the secure connection from one host to another detects that the computer is domain-joined.

So, the question then became, why is this connection failing?  Why is it taking so long to figure out that the “domain authentication” won’t work?  In the end it was because of a bad credential.  The critical variable that was never considered was a cached credential in the windows “Credential Manager”.  The long delay, due to many retries, before the TLS handshake was due to windows having to retry for each installed authentication provider (Kerberos, NTLM, Digest, etc.).  Windows will exhaust all of those before dropping to the TLS handshake.

In the windows credential manager, there as a “domain” credential for the target Exchange server, but with a bad password.  To be clear, this was not stored for use by web browsers and generally such credentials are stored i the “Web Credentials” or “Generic Credentials” areas, so this credential didn’t immediately come to mind.  However, since Windows was trying to establish a computer-to-computer connection between domain-joined hosts, that action occurs (or is attempted) before any other.  It is this same feature that allows for single-sign-on to an internal webservice/website, provided that the webserver can handle “Windows Integrated Authentication”.  But, don’t get the wrong idea here.  Even if you turn off Windows Integrated Authentication on the target webserver, this lower level handshaking still occurs.  The option in IIS for Windows Integrated Authentication comes into action AFTER the computer-to-computer connection is made.

In the end, removing the bad credential changed experience immediately.  Once the two computers could validate each other at a domain level, the TLS connection could then be started.

Effortless Exchange Migration and eDiscovery Solutions

RPC over HTTP (known as Outlook Anywhere) is being deprecated in Office 365 and you need to make sure that your Outlook clients and 3rd party MAPI based applications are updated or patched to use the new MAPI over HTTP protocol prior to the October 31st deadline.

Customers need to have the following clients and service packs on or before Oct 31st or will lose connectivity to Office 365.

Office versionUpdateBuild number
Office 2016The December 8, 2015 updateSubscription: 16.0.6568.20xx
MSI: 16.0.4312.1001
Office 2013Office 2013 Service Pack 1 (SP1) and the December 8, 2015 update15.0.4779.1002
Office 2010Office 2010 Service Pack 2 (SP2) and the December 8, 2015 update14.0.7164.5002

Want to learn more?

Read the announcement from Microsoft

Priasoft Public Folder Migration Manager for Exchange and Office 365
Exchange Public FoldersIt’s hard to believe that it has been almost 2 years since we first architected the Public Folder sync as an ancillary offering to our Priasoft Migration Suite.  Back then, it was an urgent issue that a customer encountered, which we quickly committed to resolve.  As an ever-present, 20 year veteran in the world of how complex migrating Microsoft Exchange can be – we never imagined that our new solution would redefine a facet the migration world.  More importantly, this feature would take the laborious process of migrating public folders to migration simplicity. Since then, we’ve continued to refine the solution based on customer experience and feedback and by taking a forward-looking approach to how the challenges can be solved.  This evolutionary process was recently experienced when we decided to support one of the more complex preparatory aspects of Public Folder synchronization during the migration. When Microsoft first changed the storage architecture of Public Folders, it seemed to be a well-timed and necessary change to a system that had been virtually the same for almost 15 years.  They first introduced an immediate change in architecture which was the use of mailbox objects for the storage of Public Folder data instead of a single database, which allowed IT administrators to plan for resiliency and recovery in the same manner they would plan for normal mailboxes.  And while this change may seem inconsequential to the IT novice, seemingly overnight, this shift enabled backups of Public Folder data to be efficiently segmented, making the days of the “2 terabyte data file” a thing of the past. For earlier on-premises deployments of Microsoft Exchange this  change in architecture had an immediately positive impact, but for those customers migrating to later versions of Microsoft Exchange or Office 365 this presented a whole new set of migration considerations and factors that needed addressing before their expedient shift to the Microsoft Cloud. Now, let’s review why. The new architecture found in Microsoft Exchange 2013 or later, including Office 365, requires the creation of one or more special mailbox objects – Public Folder Mailboxes – to contain the Public Folder information.  In an on-premises deployment, this is a fairly easy task since an administrator or Microsoft Exchange architect could choose to set very high size limits on these special mailboxes, or none at all.  If you had a Public Folder Database in your source environment that was 400 gigabytes in size, you could have a single Public Folder Mailbox of that size, or two 200 gigabyte mailboxes, or four 100 gigabyte mailboxes and so on.  Again, a fairly easy issue to solve and as the administrator you would just do what felt natural or necessary. However, with Office 365 (Cloud computing anyone?) and the many limits and restrictions it imposes, a scenario like the previous on-premises setup becomes much more arduous.  In its early roll-out, Microsoft Office 365 was based on Exchange 2010 which used the Public Folder database architecture.  Then, when the service transitioned to Exchange 2013 and 2016 as a base platform, different limits were required, some of which were simply the inherited structural limits of a mailbox. One of the biggest headaches with the use of Public Folder Mailboxes in relation to a migration, was how to plan and distribute a large monolithic database of Public Folders data across several smaller mailbox objects.  We would often be the first to introduce this headache to our customers and would provide the recipe as to how a customer *should* tackle the issue, but it was not until very recently that we actually addressed the issue with technology.  Resolving the dilemma seemed simple and we defined three steps for customers to consider at kick start: 1.    Analyze the source folders and gather statistics 2.    Find the larger folders and assign them to a specific mailbox 3.    Add more mailboxes as necessary These recommendations were well received, as the feedback was always positive and grateful for exposing something that, on their own, the customer would not have known.  Yet, we knew this was going be just part of a recurring issue that would continue to come up with customers choosing to move to the Microsoft Cloud. The First Sync In time and after many customer support calls that were not product specific in nature, but were set-up and preparation related, we came to the realization that not only had our support burden skyrocketed, but most of the calls were education of deep technical topics.  Most customers didn’t even know of the challenge in front of them and the complexity behind it.  As such our support conversations became more about the broader task of migrating to Office 365 and educating customers about issues that they would likely run into and how they, the customer, could tackle those challenges. Realizing that this could be a substantial burden on customers, what would any good Expert in Microsoft Migrations do…? I know, I know, there’s a ton of “so called” experts, but after 20 years in the game, we tackle such issues by writing code and creating tools and solutions. However, before you can throw code at it, you must take yourself down the rabbit hole, flush out the anomalies and define a recipe for success that will work for all, if not most. As the primary architect of this new build, I was immediately faced with taking myself through the process that our many partners and customers were facing. Specifically, how to choose which folders go to which mailbox, and what percentage of a mailbox should be filled up before moving on to another one.  What seemed like a simple discussion point, at least conceptually, turned out to be very complicated when it came time to actually figure it out. Initially, the idea was to treat this like a card dealer, where an even amount of data would be distributed across one or more Public Folder mailboxes.  The distribution of the folders was actually easy, but was horribly inefficient.  When assigning a folders to a mailbox, you don’t have to assign every folder individually, and really shouldn’t.  You only need to assign the parent folder to the mailbox.  Any action to create child folders under that parent would automatically assign those children to the same mailbox as the parent folder.  While the card analogy works, it doesn’t quite represent the issue completely.  A better analogy to the issue is with farming and watering of crops. Here in the southwest, much of the crop irrigation is done by flooding, not sprinklers.   Farmers dig small canals and channels to direct water to plots of land that have been planted.  In this method, one does not have to water every plant individually – as the card analogy would be – but one only needs to define where the water should begin its flow.  Once the canals are dug, the water will then flood and fill up each field. This is where the first level of complication came in…how to collapse as many child assignments to as few “primer” folder assignments as possible.  It was figured out, but took a few tries to get right.  The next set of complication came from doing several “limit checks” to make sure that no rules were broken with regards to max size, or max item/folder count, etc. and to also not exceed any support limits imposed by Microsoft. Needless to say and an update later, we figured it out and can rest assured that we can continue to follow our Priasoft moniker with the Experts in Microsoft Migrations more than metaphorically.  Today, not only do we provide the simplest way to migrate and synchronize Public Folders, but we can stake the claim that we are the only ones doing it properly and most importantly, intuitively to Microsoft Office 365 or Microsoft Exchange.

Ready to get started?

Register now for a free evaluation of Priasoft’s Public Folder Migration and Synchronization Manager for Exchange. (Part of the Priasoft Migration Suite for Exchange)

[dt_button url=”https://www.priasoft.com/get-started/pmse-trial-download/” style=”color-primary” size=”btn-lg” skin=”dark” target=”_self”]Download free trial[/dt_button]

Priasoft Migration Suite for Exchange (PMSE)
The other day while working on a new feature of the Priasoft Public Folder Toolbox a need arose to capture the available space on each Public Folder mailbox in Microsoft Office 365.  Naturally the immediate idea was to use the results from Get-MailboxStatistics to get such information. Get-MailboxStatistics returns many valuable bits of information about a mailbox, including Public Folder Mailboxes.  There are the obvious values like TotalItemSize and ItemCount.   There’s also the values for the established limits such as DatabaseProhibitSendReceiveQuota, which, if present, is the maximium amount of data the mailbox can contain before it will reject creating or saving new content.  There’s a few other values as well…some dates, GUIDs, and the legacyExchangeDN (aka x500). However, missing from the list of values are any percentage values like %FreeSpace or %Utilized.  Some other missing values are the total free space available as compared to the quota, if a limit exists.  Granted, such values are easily calculated but would have been easy for Microsoft to have provided along with all the other values.  Furthermore, Microsoft does this calculation for you in the web admin console for Exchange and Office 365. So, this new feature is to help customers with the headache of distributing a large amount of Public Folder data across two or more Public Folder Mailboxes.  In Office 365 a Public Folder mailbox has either a limit of 50GB or 100GB (depending upon the version of the back-end tenant; Microsoft is slowly updating tenants for the newer limit of 100GB).  If a customer has 500GB of Public Folder data, it has to be distributed across several mailboxes.  However, Exchange will not automatically start pushing data to a new mailbox just because the first one fills up.  Office 365 does have an “auto split” function that will split a Public Folder mailbox when it reaches its capacity, but such is not immediate nor quick.  Reports from customers are that the auto-split process can take many hours, several days, or even a couple of weeks to complete.  It is likely that the total item and folder count has much to do with the duration since there is a need to actually move items and folders from one Public Folder mailbox to another. The above reality leads to a situation of needing to understand the data at hand and determining how to distribute that data across multiple mailboxes but without filling up any single mailbox.  In order to do that, an analysis of each Public Folder mailbox is needed to understand its limit and how much data already exists in it (in the case of using pre-existing mailboxes). The frustration presented by Microsoft in the Get-MailboxStatistics output is that nearly all of the apparent numeric values are, in fact, not numeric at all and are an object that, when converted to a string for showing in a typical powershell text console, is formatted with a human readable value such as: 22.34 GB (22,339,443,193 bytes).  At first, those who are familiar with powershell will likely imagine that there must be some property of the value that allows one to get to the actual numeric value…and while technically true, access to this property is only available when powershell is running on the Exchange server.  When running remote powershell, as is the case with Office 365, the results from Get-MailboxStatistics are a simplified version of the original object so that it can be transmitted to the powershell console.  The value object, when on the Exchange server, has some functions to convert the value to GB, MB, KB, and bytes…but the simplified version of the object doesn’t have the functions to make these conversions – because the object is a data-only copy…none of the function code is sent from the server to the powershell console. Luckily the string representation of the value (as seen by .ToString()) does contain the “bytes” value in the text.  The string must be parsed and the numeric value extracted and converted to a number.  In .NET code, this is accomplished most completely by the following, where ‘prop’ is one of the numeric values from Get-MailboxStatistics:
System.Int64.Parse(System.Text.RegularExpressions.Regex.Match(prop.Value.ToString(), "([0-9" & Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator & "]+) bytes", RegexOptions.IgnoreCase), Globalization.NumberStyles.Number)
The above uses .NET powerful Regular Expression pattern matching engine to ensure that, regardless of number formats around the world, the digits are found and extracted properly.  Of key importance is the use of Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberGroupSeparator so that regions that use a “.” as a thousands separator are properly picked up. In pure powershell the same can be done as follows:
[Int64]::Parse([System.Text.RegularExpressions.Regex]::Match(prop.Value.ToString(), "([0-9" & [Globalization.CultureInfo.CurrentCulture.NumberFormat]::NumberGroupSeparator & "]+) bytes", [System.Text.RegularExpressions.RegexOptions]::IgnoreCase), [Globalization.NumberStyles]::Number)
If you are searching for this issue, you’ll find other sites using string.Split() to handle this, but there’s no guarantee that the “(” will always be there (Microsoft can change the formatting at any time) and also the handling of the thousands separator is not being done.  The above versions should work in any case where there are numbers-and-separators followed by a space and the text ‘bytes’. It is a frustrating issue that Microsoft could have solved by simply adding an Int64 property to the numeric value object…but such wisdom seems to escape them sometimes :).    
exchange-server-2007

Customers who are using Exchange Server 2007 for any of their email and calendar services should begin planning to move the associated mailbox data and resources to Office 365 or update their infrastructure to a newer version of Exchange, such as Exchange Server 2016.

Read more

Priasoft Migration Suite for Exchange (PMSE)
Exchnage_Powershell_Errors