Why Office 365 Users Receive MyAnalytics Messages

Wellbeing for All, Unless You Want to Disable the Fitness Tracker for Work

Recently Office 365 users have received email from the MyAnalytics service (Figure 1) apparently out of the blue. Being coached about the steps to achieving wellbeing is all very well, but you’d like to be asked whether you need to use the “fitness tracker for work.”

A MyAnalytics "Wellbeing" Email
Figure 1: A MyAnalytics “Wellbeing” Email

The reason why this is happening is that Microsoft decided in January 2019 to remove MyAnalytics from its previous status of only being available in the Office 365 E5 plan or as a separate add-on and make the service available for everyone with an Exchange Online license (see roadmap item 52276). They are now getting around to rolling out the feature (see Office 365 notification MC186372 of July 23, 2019).

Disabling MyAnalytics

Even though the data is personal and is never shared with others, some people hate the idea of Office 365 analyzing and reporting their activity, let alone sending well-intended messages to help them work smarter, which is why you might need to disable MyAnalytics for the entire tenant (perhaps to prepare users for its introduction) or for individual users (mailboxes).

There are two ways to disable MyAnalytics: for the tenant or for an Exchange Online mailbox. To disable MyAnalytics for a tenant, go to the Services & Add-in section of the Office 365 Admin Center and select MyAnalytics. You can now select the default settings to apply to all mailboxes (Figure 2). You can disable just the weekly message to encourage better work habits by unchecking Weekly insights email.

MyAnalytics Settings for an Office 365 Tenant
Figure 2: MyAnalytics Settings for an Office 365 Tenant

The messages sent by MyAnalytics are interesting. They are submitted direct to user mailboxes and don’t seem to go through the Exchange Online transport service. If they do, the items pick up no message headers and no trace is left in the message tracking logs. Another minor irritation is that tenants have no control when the messages are delivered; they arrive when MyAnalytics is ready.

User Settings

Users can go to the MyAnalytics dashboard (selectable from the Office 365 waffle menu), and disable the service from the Settings menu (Figure 3). Note that it can take up to a week for changes to take effect, which means that a user might receive another email while the setting change is being implemented.

MyAnalytics Settings and Dashboard
Figure 3: MyAnalytics Settings and Dashboard

Changing the MyAnalytics Privacy Setting with PowerShell

Alternatively, you can run the PowerShell Set-UserAnalyticsConfig cmdlet to update the MyAnalytics privacy setting for mailboxes. The Get-UserAnalyticsConfig cmdlet is also available to check the current state of affairs. For example:

The PrivacyMode setting governs whether data for a mailbox is used by MyAnalytics. In this example, we select mailboxes based on their CustomAttribute7 attribute, which we set to “NoMyAnalytics” when a mailbox has been removed from MyAnalytics processing.

Removing the MyAnalytics License from User Accounts

If you need to remove MyAnalytics totally for a mailbox, the best approach is to remove the Insights by MyAnalytics license assigned to the account. You can do this in the Microsoft 365 admin center by selecting the account and editing the Apps section of the license configuration to uncheck Insights by MyAnalytics. It’s also possible to do this with PowerShell. Here’s an example. The code uses a mixture of Microsoft Online Services and Exchange Online cmdlets to remove the MyAnalytics license from users with Office 365 E3 licenses.

  • Define a new license option which excludes MyAnalytics. You must change the definition of the $Office365E3License variable to replace “yourtenantname” with the actual name of your tenant. If you want to remove the MyAnalytics license from users with other Office 365 licenses, you’ll need to add some more code to process these licenses.
  • Read in a set of users for which we want to remove MyAnalytics license. I use a distribution group here. You could also create a list by applying a filter to select a set of Azure Active Directory accounts or Exchange Online mailboxes.
  • For each user, set the new license option with the Set-MsolUserLicense cmdlet.
  • To make sure that we don’t process the user again, set the CustomAttribute8 property of their mailbox with a value to indicate that the license is removed.

Like all PowerShell samples, this code is intended to illustrate a principal. It works, but it might not be what you want to use in production on an ongoing basis.


We cover MyAnalytics in the companion volume of the Office 365 for IT Pros eBook. That doesn’t mean that the information isn’t valuable: it simply means that we have tons of other stuff to discuss in the main book. However, we do cover the topic of removing licenses from Office 365 accounts with PowerShell in Chapter 4…

Advertisements

11 Replies to “Why Office 365 Users Receive MyAnalytics Messages”

  1. I am one of office365 client working in 42+ countries across 480+ domains.
    Question: Why is MS sending ‘My Analytics’ email without internet headers in them?
    Any specific reasons for this?

    1. The messages are injected into mailboxes without going through the Exchange transport system. They are never processed by SMTP.

      1. Our company has a SaaS Training App on a number of Azure instances. We would like to provide analytics emails to our corporate users based on the usage of our App. We were wanting to use the same mail delivery as the MyAnalytics emails, is that possible?
        What would be the best Microsoft solution for distributing 30,000 weekly analytics emails?

      2. Nope. The delivery mechanism used by Microsoft is an internal method that’s not available to third parties.

  2. Hello sir, sorry to bother you – I’ve searched around a bit for a full powershell solution, and the mailbox part is well described by many people, including microsofts own documentation. However, the settings for the myanalytics service set in the admin-center are a bit harder to come by. I don’t suppose you know the cmdlet used to disable the dashboard / weekly mails / outlook insights addin?

    1. Something like this will remove the “Insights by MyAnalytics” license from user accounts. I have used a distribution group to identify the accounts to disable and made sure that I don’t keep on disabling them by using one of the 15 custom attributes available for Exchange Online mailboxes to track what accounts have been disabled. This code uses the Microsoft Online Services module. Feel free to amend/improve.

      $Office365E3License = “yourtenantname:ENTERPRISEPACK”
      $NewE3Options = New-MsolLicenseOptions -AccountSkuId $Office365E3License -DisabledPlans “MYANALYTICS_P2”
      $Users = Get-DistributionGroupMember -Identity NoMyAnalytics
      Foreach ($U in $Users) {
      If ((Get-ExoMailbox -Identity $U.WindowsLiveId).CustomAttribute8 -ne “MyAnalytics disabled”) {
      Write-Host “Disabling MyAnalytics for” $U.DisplayName
      Set-MsolUserLicense -UserPrincipalName $U.WindowsLiveId -LicenseOptions $NewE3Options
      Set-Mailbox -Identity $U.WindowsLiveId -CustomAttribute8 “MyAnalytics disabled” }
      }

      1. I’m sorry, I should have been more specific in my query: I don’t want to disable the licenses, I want to change the tenants to opt-out by default. I can chance all the mailboxes/users via powershell to opt-out and I can change the default settings in admin-center – I was looking for a way to get the settings in admin-center done with powershell, to avoid admin-center. As a company, changing this setting through admin-center for hundreds or thousands of tenants is not desireable.

      2. I don’t think the option to disable a complete tenant by default is available in PowerShell. You could accomplish the same goal by removing the license from all users. I can see how this might be a pain, especially on an ongoing basis, if you’re responsible for managing multiple tenants.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.