Unknown's avatar

About Michel de Rooij

Michel de Rooij, with over 25 years of mixed consulting and automation experience with Exchange and related technologies, is a consultant for Rapid Circle. He assists organizations in their journey to and using Microsoft 365, primarily focusing on Exchange and associated technologies and automating processes using PowerShell or Graph. Michel's authorship of several Exchange books and role in the Office 365 for IT Pros author team are a testament to his knowledge. Besides writing for Practical365.com, he maintains a blog on eightwone.com with supporting scripts on GitHub. Michel has been a Microsoft MVP since 2013.

Exchange Virtual Conference


Exchange 2010 LogoOn January 1st, 2013 The UC Architects felllow Paul Cunningham asked around to see who wanted to participate in a “virtual conference about Exchange Server, kind of a mini-MEC but purely online, 100% free, essentially a series of webinars/screencasts about Exchange Server 2010/2013”.

This Monday saw the start of the (inaugural) Exchange Virtual Conference. Paul gathered enough well-known people from the Exchange community to have a nice line-up of speakers and interesting sessions. Unfortunately, I couldn’t commit at that time nor find time after that to create a session, so I had to pass.

Here’s an overview of the sessions, which are pre-recorded and are 45-60 minutes (lunch break material):

Note: List will be updated with links to sessions as they become available.

 

Exchange 2010 Server Role Requirements Role Calculator 20.6


Exchange 2010 LogoIt’s almost a year since the last update, but today the Exchange Team released version 20.6 of the Exchange 2010 Mailbox Role Calculator. The new name is Server Role Requirements, since 20.6 can also dimension Hub Transport or Client Access roles.

Enhancements since version 19.9:

  • Calculator now supports defining server requirements for dedicated Hub Transport and Client Access servers; specifically CPU and memory sizing.
  • Calculator will state how many dedicated Hub Transport and Client Access servers should be deployed in a datacenter.
  • Calculator now includes Hub Transport and Client Access impact on server megacycles and utilization calculations for multi-role deployments.
  • Global catalog processor core calculations were optimized and simplified.
  • Calculator has been rebranded as Exchange 2010 Server Role Requirements Calculator.
  • Fixed column headers in results tables to match Site Resilience scenario

Bug Fixes since version 19.9:

  • Fixed conditional formatting bug when site resilience is not enabled, yet SDC instance input has greater than 0 copies specified.
  • Fixed logic error where calculator would calculate storage requirements when there were more database copies (HA+Lagged) than Mailbox servers.
  • Fixed logic error in calculating remaining active databases during first and second server failures in secondary datacenter for single DAG A/A scenario.
  • Fixed /environment formula for standalone number of database formula.

You can download the calculator here. For more information please consult the changeblog or usage instructions.

Exchange 2013 Server Role Requirements Calculator 5.6


Ex2013 LogoOnly 10 days after the release of the first public version of the Exchange 2013 Server Role Requirements Calculator, the calculator gets an update. The new version number is 5.6.

Changes since version 5.1:

  • Optimized Volume Design Architecture Formula
  • Fixed Recommended Min Number of GC Cores (Secondary Datacenter)” calculation to use SDC instead of PDC CAS count.
  • Fixed CPU comments and removed erroneous information.
  • Fixed multiple conditional formatting bugs.
  • Fixed problem where this workbook had to be the active workbook at all times.
  • Fixed problem with extra-wide Fail Server button on the distribution worksheet.
  • Enabled variable based tracing.
  • Resolved VBA Divide by Zero error caused by DiskGroup = 0.
  • Fixed problem with lagged copies in conjunction with multiple databases per volume.
  • Fixed missing “\” character in path names in MailboxDatabases.csv file.
  • Fixed problem with WAN failure simulation.
  • Fixed calcNumAMBXServersDC2 to ensure it cannot have more servers that primary site.
  • Fixed calculated IO Multiplication factor formulas to take into consideration IOPS override.
  • Added condition to validate that there are enough copies for multiple databases/volume scenario.
  • Fixed conditional formatting and JBOD storage results when JBOD evaluation is disabled.

You can download the calculator here. For more information please consult the release notes and read me.

The UC Architects Podcast Ep22


iTunes-Podcast-logo[1]The 22th episode of The UC Architects podcast is now online. The UC Architects is a bi-weekly community podcast by people with a passion for Unified Communications; our main focus is on Exchange, Lync or related subjects.

This episode is hosted by Steve Goodman, who’s joined by Johan Veldhuis, Serkan Varoglu, Dave Stork, Andrew J. Price, John Cook, Ståle Hansen and yours truly.

Amongst the topics discussed in this episode are:

  • Exchange 2013 Server Role Requirements Calculator
  • Exchange Virtual Conference
  • New mobile app for The UC Architects
  • AD FS on Azure guidance
  • Ask the Perf Guy: Sizing Exchange Server 2013
  • Script: Paul’s Test-ExchangeServerHealth.ps1
  • Script: Removing Exchange messages by message class
  • Exchange 2013 Management Pack
  • Lync 2013 Management Pack
  • Lync Hybrid Voice offers simplified
  • Lync Server root certificate updates for push notifications, federation with Microsoft.com
  • Lync 2013 client updates released
  • Custom Lync config.xml file for PortQryUI
  • Lync 2013 Jumpstart with Brian Ricks and Aaron Steele
  • Lync remote code execution vulnerability
  • Lync bandwidth calculator

More information on the podcast including references and a link to download the podcast directly here or you can subscribe to the podcasts using iTunes, Zune or use the RSS feed.

Removing Messages by Message Class


powershellLast version: 2.00, February 27th, 2021

Recently, I was asked if it is possible to remove stub items. The reason was they were going to transition to a newer version of Exchange and they wouldn’t be using the archiving solution in the new environment. When required, vendor tooling would be used to search through the existing archives.

In such cases it makes sense to remove the stubs from the mailbox, which are shortcut messages that points to a copy of the original message in the archive solution. The new environment won’t contain the required Outlook plugins or extensions to retrieve the original message from the archive using the stub, making the stub lead to a partial or empty message.

To identify stubs, one can filter on an attribute of each item, MessageClass. This attribute defines which kind of item it is (in fact, determines what form Outlook should use in order to present or process the information). Examples of MessageClass definitions are IPM.Note (regular e-mail messages), IPM.Note.EnterpriseVault.Shortcut (message archived by Enterprise Vault) or IPM.ixos-archive (message archived by Opentext/IXOS LiveLink E-Mail Archive).

To identify stubs from Outlook, add the Message Class field to your Outlook view, e.g.:

StubsOutlook

When you want to remove the stubs using Outlook, you can utilize the Advanced Find function of Outlook, but that is a very labor intensive, tedious and non-centralized per-mailbox procedure:

SearchFromOutlook

Requirements
Using the script requires Exchange Web Services (EWS) Managed API and for OAuth authentication the Microsoft Authentication Library (MSAL) libraries. You can install these packages from NuGet, or place their DLL’s in the same folder as the script. For an example of how to install EWS.Managed.Api from NuGet, see this article; for MSAL follow the same process but with the package titled ‘Microsoft.Identity.Client’.

Also take notice that since you’ll be processing user mailboxes, you’ll need to have full mailbox access or impersonation permissions when using Basic Authentication; the latter is preferred. For details on how to configure impersonation for Exchange On-Premises or Office 365, see this blog post. Using a registered app with OAuth is always through Impersonation.

Usage
The script Remove-MessagesClassItems.ps1 uses the following syntax:

Remove-MessageClassItems.ps1 [-Identity]  [-MessageClass] [-Type] [-Server ] [-Impersonation] [-DeleteMode ] [-Type] [-Before ] [-MailboxOnly] [-ArchiveOnly] [-IncludeFolders] -ExcludeFolders [-NoProgressBar] [-Force] [-WhatIf] [-Confirm] [-Secret] [-CertificateThumbprint] [-CertificateFile] [-CertificatePassword] [-TenantId] [-ClientId] [-TrustAll]

A quick walk-through on the parameters and switches:

  • Identity is the name or e-mail address of the mailbox.
  • MessageClass specifies the Message Class to remove, for example IPM.Note.EnterpriseVault.Shortcut (EnterpriseVault). You can use wildcards around or at the end to include folders containing or starting with this string, e.g. ‘IPM.ixos*’ or ‘*EnterpriseVault*’. Matching is always case-insensitive.
  • Server is the name of the Client Access Server to access for Exchange Web Services. When omitted, the script will attempt to use Autodiscover.
  • Type determines what folder class to process. Options are Mail, Calendar, Contacts, Tasks, Notes or All (Default).
  • Switch Impersonation specifies if impersonation will be used for mailbox access, otherwise the current user context will be used.
  • DeleteMode specifies how to remove messages. Possible values are HardDelete (permanently deleted), SoftDelete (use dumpster, default) or MoveToDeletedItems (move to Deleted Items folder). Note that the Deleted Items folder will be processed, unless MoveToDeletedItems is used.
  • Before can be used to only remove items received before specified date.
  • MailboxOnly specifies you only want to process the primary mailbox of specified users. You als need to use this parameter  when running against mailboxes on Exchange Server 2007.
  • ArchiveOnly specifies you only want to process personal archives of specified users.
  • IncludeFolders specifies one or more names of folder(s) to include, e.g. ‘Projects’. You can use wildcards around or at the end to include folders containing or starting with this string, e.g. ‘Projects*’ or ‘*Project*’. To match folders and subfolders, add a trailing \*, e.g. Projects\*. This will include folders named Projects and all subfolders. To match from the top of the structure, prepend using ‘\’. Matching is case-insensitive.
  • ExcludeFolders specifies one or more folder(s) to exclude. Usage of wildcards and well-known folders identical to IncludeFolders.
    Note that ExcludeFolders criteria overrule IncludeFolders when matching folders.
  • NoProgressBar prevents displaying a progress bar as folders and items are being processed.
  • ReplaceClass specifies that instead of removing the item, its PR_MESSAGE_CLASS class property will be modified to this value. For example, can be used in conjunction with MessageClass to modify any IPM.Note items pending Evault archival back to regular items, using: -MessageClass IPM.Note.EnterpriseVault.PendingArchive -ReplaceClass IPM.Note
  • Report reports individual items detected as duplicate. Can be used together with WhatIf to perform pre-analysis.
  • TrustAll can be used to accept all certificates, e.g. self-signed certificates or when accessing Exchange using endpoint with a different certificate.

For authentication, the following parameters are available:

  • Credentials specifies credentials to use for Basic Authentication.
  • TenantId specifies the identity of the Tenant (OAuth)
  • ClientId specifies the Id of the registered application (OAuth).
  • CertificateThumbprint specifies the thumbprint of the certificate from personal store to use for authentication (OAuth).
  • CertificateFile specifies the external certificate file (pfx) to use for authentication (OAuth). This certificate needs to contain a private key; the registered application needs to contain the certificate’s public key.
  • CertificatePassword optionally specifies the password to use with the certificate file (OAuth).
  • Secret specifies the secret to use with the application (OAuth).

Well-Known Folders
For IncludeFolders, ExcludeFolders, you can also use well-known folders using this format: #WellKnownFolderName#, e.g. #Inbox#. Supported are #Calendar#, #Contacts#, #Inbox#, #Notes#, #SentItems#, #Tasks#, #JunkEmail# and #DeletedItems#. The script uses the currently configured Well-Known Folder of the mailbox to be processed.

Patterns
Here are some examples of using pattern matching in IncludeFolders or ExcludeFolders, based on the following tree structure:

+ TopFolderA
  + FolderA
    + SubFolderA
    + SubFolderB
  + FolderB
+ TopFolderB

The following filters will match folders from the above structure:

Filter Matches
FolderA \TopFolderA\FolderA, \TopFolderB\FolderA
Folder* \TopFolderA\FolderA, \TopFolderA\FolderB, \TopFolderA\FolderA\SubFolderA, \TopFolderA\FolderA\SubFolderB
FolderA\*Folder* \TopFolderA\FolderA\SubFolderA, \TopFolderA\FolderA\SubFolderB
\*FolderA\* \TopFolderA, \TopFolderA\FolderA, \TopFolderA\FolderB, \TopFolderA\FolderA\SubFolderA, \TopFolderA\FolderA\SubFolderB, \TopFolderB\FolderA
\*\FolderA \TopFolderA\FolderA, \TopFolderB\FolderA

Example
Suppose you want to remove  IPM.Note.EnterpriseVault.Shortcut items from the mailbox of user1 and personal archive when enabled, moving the items to the DeletedItems by Impersonation. In such case, you could use the following cmdlet:

Remove-MessageClassItems.ps1 -Identity user1 -MessageClass IPM.Note.EnterpriseVault.Shortcut -DeleteMode MoveToDeletedItems -Impersonation –Verbose 

Note: Screenshot shows Mailbox parameter, which is per 1.52 renamed to Identity

SampleOutput

Note: By default, Remove-MessageClassItems will only search IPF.Note class folders (i.e. containing mail items), so you’ll only see those being processed. If you want all folders scanned (also classless), use the ScanAllFolders switch.

The script also supports Office 365. For example, to remove all items with ‘Enterprise’ in their message class text, received before 1/1/2014, only from the primary mailbox, excluding the folder Personal, using Basic Authentication, you can use:

$Credentials= Get-Credential
Remove-MessageClassItems.ps1 -Identity olrik@office365tenant.com -DeleteMode MoveToDeletedItems -MessageClass *EnterpriseVault* -Before 1/1/2014 -MailboxOnly -ExcludeFolder Personal -Credentials $Credentials

In case you want to process multiple mailboxes, you can use a CSV file which needs to contain the Identity field. An example of how the CSV could look:

Identity
francis
philip

The cmdlet could then be something like:

Import-CSV users.csv1 | Remove-MessageClassItems.ps1 -MessageClass IPM.Note.EnterpriseVault.Shortcut -DeleteMode HardDelete 

Feedback
You’re feedback is welcomed through the comments; if you got scripting suggestions, please use the contact form.

Download
You can download the script from the GitHub here.