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.

TechNet Subscriptions Retirement

Image


Only 3 days ago, the (Microsoft) IT Pro community was surprised and shocked by an e-mail they received from Microsoft regarding retirement of TechNet Subscriptions after its introduction 15 years ago:

Microsoft is retiring the TechNet Subscription service.
As IT trends and business dynamics have evolved, so has Microsoft’s set of offerings for IT professionals who are looking to learn, evaluate and deploy Microsoft technologies and services. In recent years, we have seen a usage shift from paid to free evaluation experiences and resources.  As a result, Microsoft has decided to retire the TechNet Subscriptions service and will discontinue sales on August 31, 2013.

This means that after August 31, you won’t be able to purchase a subscription for downloading software for test and evaluation purposes. When you buy a subscription, you also need to activate it before September 30, 2013. Microsoft will honor current subscriptions, meaning its TechNet Subscriptions end of life date will be August 31, 2014. More information in the TechNet Subscriptions FAQ.

As part of the announcement, Microsoft suggests using time bombed evaluation software from the TechNet Evaluation Center, TechNet Virtual Labs or buying an MSDN subscription amongst other things. Not surprisingly, the majority of the IT Pro world cried foul:

TechNet Evaluation Center
Time bombed evaluation software is no replacement. For example, I have various environments set up in my lab which I use for research, blogging or articles, develop and test scripts, test (customer) scenarios, try to reproduce issues, evaluate 3rd party software, etc. I also use it to deploy environments for demonstration purposes. I don’t consider redeploying and reconfiguring all those environments on a frequent basis an option, apart from the fact that Evaluation Center only offers the recent generation of products.

TechNet Virtual Labs
TechNet Virtual Labs are very limited and aimed at exploring products and exams.

MSDN subscriptions
MSDN subscriptions are way more expensive and are primarily aimed at developers.TechNet Standard entry subscription with all non-developer software (e.g. OS, Exchange, Sharepoint, Lync) costs $199 ($149 renewal) while Professional with Enterprise software and Dynamics costs $349 ($249 renewal). Compared with MSDN‘s entry Subscription which costs $699 ($499 renewal, only getting you Operating Systems and some dev kits .. which IT Pro needs those?) MSDN is inferior. If you’re looking for a matching MSDN replacement which includes server software like Exchange, you’re looking at a $6.119 ($2.569 renewal) Subscription!

Microsoft Virtual Academy
Very limited and not representative of hands-on experience.

As for myself, my subscription expires July 26th, 2013. I’m curious, how does this decision affect you? Let me know in the comments section below.

Meanwhile, if you disagree with Microsoft’s decision, let your voice be heard by signing this petition for an affordable, TechNet comparable MSDN Subscription as an alternative. Microsoft also reversed Xbox One online check and used game policies and will reintroduce the “Start” button in Windows 8.1, so who knows.

Removing Duplicate Items from a Mailbox


powershellLatest version: 2.41, April 18th, 2023

For those involved with Exchange migration projects or managing Exchange environments, at some point you probably have experienced the situation where people ended up with duplicate items in their mailbox. Duplicate items can be caused by many things, but most common are:

  • Synchronization tools or plug-in. Entries from the mailbox are treated as new entries and as a consequence are added to the mailbox when synchronizing information back to the mailbox, creating duplicates. In the past, I’ve seen this happening with Nokia PC Suite and Google Apps Sync for example;
  • Importing existing data. Accidental import from – for example – a PST file to a mailbox  can lead to duplicate entries.

image

When looking for a solution, you’ll probably encounter MSKB299349, “How to remove duplicate imported items in Outlook”. This article describes a manual procedure to remove duplicates entries from your calendar, contacts, inbox or other folders. Not a very helpful and labor intensive.

When continuing your search, you’ll find lots (I mean lots!) of tools and Outlook add-ins, like Vaita’s DIR or MAPILab’s Duplicate Remover. Not all this software is free (some even require payment per duplicate removal of appointments, contacts or e-mail) and some might not even work (MAPI-based tools may not work against Exchange 2013).

When you finally have selected a tool, in most cases they require installation of a piece of software and someone to perform the removal process using the tool or Outlook with add-in. When you’re an Apple shop you’ll require different tools, unless you’re running a Windows desktop somewhere (I’ll just pretend I didn’t hear you saying ‘Why don’t you install the tool on the Exchange server’).

Wouldn’t it be nice if you’d have a PowerShell script you can conveniently run from any workstation (or server) with PowerShell installed, removing those duplicate items from a user’s mailbox remotely? If the answer is yes, the Remove-DuplicateItems.ps1 script may be something for you.

Requirements
Using the Remove-DuplicateItems.p1 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-DuplicateItems.ps1 uses the following syntax:

Remove-DuplicateItems.ps1 [[-Identity] ] [[-Type] ] [-Retain ] [-Server ] [-Impersonation] [-DeleteMode ] [-Credentials ] [-Mode ] [-MailboxOnly] [-ArchiveOnly] [-IncludeFolders <String[]>] [-ExcludeFolders <String[]>] [-PriorityFolders <String[]>] [-NoSize] [-CleanupMode] [-NoProgressBar] [-Force] [-WhatIf] [-Confirm] [-Secret] [-CertificateThumbprint] [-CertificateFile] [-CertificatePassword] [-TenantId] [-ClientId] [-TrustAll] [-ExchangeSchema <String>] [-NoSCP]

A quick walk-through on the parameters and switches:

  • Identity is the e-mail address or name of the mailbox to process. If name is used, it is matched against cn/SAMAccountname/email address of local AD.
  • Type determines what folders are checked for duplicates. Valid options are Mail, Calendar, Contacts, Tasks, Notes or All (Default).
  • Retain determines which item to retain by comparing last modification times. Valid options are Newest (default) or Oldest.
  • Server is the name of the Client Access Server to access for Exchange Web Services. When omitted, the script will attempt to use Autodiscover.
  • When the Impersonation switch is specified, 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).
  • Mode determines how items are matched. Options are Quick, which uses PidTagSearchKey and is the default mode, or Full which uses a predefined set of attributes to match items, depending on the item class:
ItemClass Criteria
Contacts File As, First Name, Last Name, Company Name, Business Phone, Mobile Phone, Home Phone, Size
Distribution List FileAs, Number of Members, Size
Calendar Subject, Location, Start & End Date, Size
Task Subject, Start Date, Due Date, Status, Size
Note Contents, Color, Size
Mail Subject, Internet Message ID, DateTimeSent, DateTimeReceived, Sender, Size
Other Subject, DateTimeReceived
  • 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.
  • CleanupMode specifies to cleanup duplicates per folder (Folder, default), the whole mailbox (Mailbox), or multiple mailboxes (MultiMailbox, identities specified using Identity). The first unique item encountered will be retained. For Mailbox-level cleanup, PriorityFolders can be used to give priority to retaining items in specified folders before those found in other folders.
  • PriorityFolders specifies which folders have priority over other folders, identifying items in these folders first when using MailboxWide mode. Usage of wildcards and well-known folders is identical to IncludeFolders.
  • NoSize tells script to not use size to match items in Full mode.
  • NoProgressBar prevents displaying a progress bar as folders and items are being processed.
  • 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.
  • ExchangeSchema can be used to specify the Exchange schema to use when connecting to Exchange server or Exchange Online. Defaults to Exchange2013_SP1 or Exchange2016 when -Server is specified and is ‘outlook.office365.com’ (Exchange Online endpoint).
  • NoSCP to skip SCP lookups in Active Directory for Autodiscover.

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).

Few notes:

  • When MoveToDeletedItems is specified, the Deleted Items folder will be skipped;
  • When Type is omitted or set to All, all folders are scanned, including folders like Conversation History, RSS Feeds, etc.;
  • When Quick mode is used and PidTagSearchKey is missing or inaccessible, search will fall back to Full mode;
  • For more info on PidTagSearchKey, see http://msdn.microsoft.com/en-us/library/cc815908.aspx. Note that PidTagSearchKey will have duplicate values for copied objects.
  • You need to specify MailboxOnly when running against mailboxes on Exchange Server 2007 as the Exchange 2010 personal archive options in EWSare not support in Exchange 2007 mode.

Well-Known Folders
For IncludeFolders, ExcludeFolders and PriorityFolders, 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, ExcludeFolders or PriorityFolders, 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

Usage
So, suppose you want to remove  duplicate Appointments from the calendar of mailbox migtester1 using attribute matching, moving duplicate items to the DeletedItems, using Impersonation and you want to generate extra output using Verbose. In such case, you could use the following cmdlet:

Remove-DuplicateItems.ps1 -Identity migtester1 -Type Calendar -Impersonation -DeleteMode MoveToDeletedItems -Mode Full -Verbose

image

Alternative, you can use an e-mail address and specify credentials.  This allows the script to run against mailboxes in Office 365, for example:

Remove-DuplicateItems.ps1 -Identity olrik@office365tenant.com -Type Mail -DeleteMode MoveToDeletedItems -Mode Full -Credentials (Get-Credential) -Retain Oldest

A more complex example using IncludeFolders, ExcludeFolders and PriorityFolders:

$Credentials= Get-Credential
 .\Remove-DuplicateItems.ps1 -Mailbox olrik@office365tenant.com -Server outlook.office365.com -Credentials $Credentials -IncludeFolders '#Inbox#\*','\Projects\*' -ExcludeFolders 'Keep Out' -PriorityFolders '*Important*' -CleanupMode Mailbox

This will remove duplicate items from the specified mailbox in Office365, using the following options:

  • Fixed Server FQDN – bypassing AutoDiscover.
  • Limits operation against the Well-Known Inbox folder, top Projects folder, and all of their subfolders.
  • Excluding any folder named Keep Out.
  • Duplicates are checked over the whole mailbox.
  • Priority is given to folders containing the word Important, causing items in
    those folders to be kept over items in other folders when duplicates are found.

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-DuplicateItems.ps1 ..

Download
The script is available on GitHub here.

Feedback
Feedback is welcomed through the comments. If you got scripting suggestions or questions, do not hesitate using the contact form.

Exchange 2013 Unattended Installation Script v1.5 (Updated)


Ex2013 LogoI’m pleased to announce that the Exchange 2013 unattended installation script has been updated and supports fully automated installation of Exchange 2013 on Windows Server 2008 R2 SP1.

The new version contains the following changes:

  • Added support for Windows Server 2008 R2 SP1. To fulfill the requirements, code was added to install .NET Framework 4.5, Windows Management Framework 3, disable/enable Internet Explorer Enhanced Security Configuration (IE-ESC), install required hotfixes KB974405, KB2619234 and KB2758857 (which supersedes KB2533623).
  • Because of the mandatory reboot after installation of the hotfixes, a phase was inserted; this phase will be skipped when installing on Windows Server 2012.
  • Added InstallPath to AutoPilot parameter set (or default path won’t get set).

You can download the updated version of the script via the original Exchange 2013 Unattended Installation Script page (which also contains instructions) or directly from the Technet Gallery.

The script has been tested with Exchange 2013 CU1 but it should work with RTM as well (if you must ..). Your feedback is very much welcomed!

The last version is version 1.53, dated June 15th, 2013; For changes, consult the changelog on the original article or Technet Gallery page.

The UC Architects Podcast Ep23


iTunes-Podcast-logo[1]The 23th episode of The UC Architects podcast is 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 Pat Richard, who’s joined by Johan Veldhuis, John Cook and Tim Harrington. Special guest is Chris Cook, creator of the Lync Environment Report Builder.

Amongst the topics discussed in this episode are:

  • TechEd North America
  • Exchange 2010 SP3 UR1 released
  • Exchange 2010 Mailbox Role Calculator updated to v20.7
  • Lync Networking Guide
  • Lync Server federation with Microsoft.com: Root Certificate Change
  • Blackberry Enterprise IM 3.0 enabled Blackberry 10 users communication with Lync users
  • Chris Cook’s awesome scripts
  • Updating Lync Phone Edition Devices for Lync 2013
  • John’s MaxEndpointsPerUser=1 issue
  • Lync 2013 Database Mirror Manager Tool
  • Snooper shows only TL_Errors in detail pane
  • Jaja Voice Service for Office 365 & Lync to be discontinued
  • Cisco challenges Microsoft buy of Skype in EU court
  • Lync-Skype federation & provisioning guide
  • Lync Jump Start for 70-336 exam – slides available
  • Lync Attendee hotfixes
  • Event: Next Microsoft US User Group London
  • Event: MUCUK UK Lync Tour dates
  • Event: MS UC User Group Norway

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.

Exchange 2013 CU2 Announcements from TechEd


Ex2013 LogoAs most of you probably know, last week was TechEd North America. The sessions on Exchange 2013 did disclose some changes for Cumulative Update 2 (CU2), which – according to the announced CU cadence – should arrive somewhere in the summer, most likely July. For those who didn’t follow my Live Tweeting from the event, here’s a quick summary of the announced or probable changes for CU2.

The return of 100 DB Limit
Exchange 2013 CU2 Enterprise Edition will bump the limit for the number of database per server from 50 to 100. The initial limit to 50 for Exchange 2013 RTM (and CU1) is said to be chosen due to performance reasons, but many customers complained they want to host more databases per server. For CU2, Microsoft made changes which enable increasing this limit to 100 again. Perhaps the customers complaining transitioned from or are currently running Exchange 2010, and are facing having to introduce additional servers to host an equal number of databases. In such cases, be advised that regardless of this increased limit, Exchange 2010 and 2013 are not directly comparable and you should utilize the Exchange 2013 Server Role Requirements Calculator to size your Exchange 2013 environment (an update will follow as soon as CU2 becomes available). An important side note to keep in mind with all this is that adding (or removing) databases in Exchange 2013 requires a restart of the Information Store service, so you might prefer maximizing the number of databases from the start, not when required to, so you’ll avoid having to shut down services or having to move mailboxes around to comply with your SLAs.

Single Sign-On Redirects
Exchange 2013 CU2 will introduce Single Sign-On (SSO) by enabling silent redirects for Outlook Web App (OWA) to downlevel CAS servers when the mailbox is hosted on a downlevel mailbox server when they’re configured with a different ExternalURL (e.g. in a different internet-facing site).

DAG Management Service
The to be introduced MSExchangeDAGMgmt service will offload the Replication service by hosting the Replication Service MonitoringComponent, providing information on health status, logging events in the same location MSExchangeRepl used to, i.e. Application Eventlog using the same Crimson channel, but still using MSExchangeRepl as source.

DAG Witness Server in Azure (possibly!)
When you’re an Azure subscriber, a feature possibly included in CU2 will allow your DAG Witness Server to be located in Azure. This allows for example customers with 2 physical datacenters to utilize automatic site fail-over, as automatic site fail-over normally requires a 3rd well connected datacenter for hosting the Witness Server. From an Azure perspective, the Witness Server will be single File Server on Azure IaaS VM or two File Servers using persistent VMs with XStore shared storage. Note that extending Active Directory permissions to the Public Cloud is required for this option.

Responder Throttling per Group
Responders are part of Exchange 2013’s Managed Availability, and define if and how to act on generated alerts, e.g. restart a service or take a Mailbox server out of service. In CU2, several responders will be throttled per group, e.g. DAG, instead of per server.

ARR Support
Not CU2 related, but it was announced that support for ARR, which stands for IIS Application Request Routing, is coming for Exchange 2013. With the discontinuation of TMG, customers are looking for alternatives to publish their Exchange 2013 (or Lync web services) and ARR is one of them, often used because it utilizes IIS and is free despite it lacking some of TMG’s features. A clue for this could lie in one of the features announced for Windows Server 2012 R2, which will contain a Web Application Proxy, which basically will be an HTTP reverse proxy aimed at publishing corporate resources for access from the public network.