Why Office 365 Users Receive MyAnalytics Messages and How to Stop the Messages

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

Updated 4 September 2021

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 Settings section of the Microsoft 365 Admin Center, then Org settings, and finally select MyAnalytics from the list. 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 weekly digest 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

Users can also opt out of receiving the weekly email using the unsubscribe link in the message.

Updating the Analytics Mailbox Settings with PowerShell

Alternatively, you can run the PowerShell Set-MyAnalyticsFeatureConfig cmdlet to update the MyAnalytics privacy setting for mailboxes . The Get-MyAnalyticsFeatureConfig cmdlet is also available to check the current state of affairs. Previous to the introduction of the V2.0.4 of the Exchange Online Management module (or later), the cmdlets were Set-UserAnalyticsConfig and Get-UserAnalyticsConfig. Both sets of cmdlets use the same syntax. For example:

# Report what mailboxes are enabled for MyAnalytics
$Mbx = Get-ExoMailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | Select DisplayName, UserPrincipalName
$MyAnalyticsCount = 0
ForEach ($M in $Mbx) {
   $MyAnalytics = Get-MyAnalyticsFeatureConfig -Identity $M.UserPrincipalName | Select PrivacyMode
   If ($MyAnalytics.PrivacyMode -eq "opt-in") { 
       Write-Host "MyAnalytics is enabled for" $M.DisplayName }
   Else { Write-Host "MyAnalytics is not enabled for" $M.DisplayName}
Write-Host "MyAnalytics is enabled for" $MyAnalyticsCount "of" $Mbx.Count "mailboxes"

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.

# Disable Selected Mailboxes for MyAnalytics
$Mbx = Get-ExoMailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited -Filter {CustomAttribute7 -eq "NoMyAnalytics"} | Select DisplayName, UserPrincipalName
ForEach ($M in $Mbx) {
     Write-Host "Disabling MyAnalytics for" $M.DisplayName
     Set-MyAnalyticsFeatureConfig -Identity $M.UserPrincipalName -PrivacyMode "opt-out" }

The Set-MyAnalyticsFeatureConfig cmdlet can control individual mailbox feature settings for analytics. Three feature settings are currently available:

  • Dashboard: Access to the MyAnalytics dashboard.
  • Add-in: Access to the Outlook Insights add-in.
  • Digest-email: Access to the email digest.

You can opt-in mailboxes for analytics but block individual features. For instance, here’s how to block the digest email while allowing users to access the dashboard and Outlook add-in:

$Mbx = Get-ExoMailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | Select DisplayName, UserPrincipalName
ForEach ($M in $Mbx) {
     Write-Host "Disabling the monthly analytics digest email for" $M.DisplayName
     Set-MyAnalyticsFeatureConfig -Identity $M.UserPrincipalName -PrivacyMode "opt-in" -Feature digest-email -IsEnabled $False}

If you examine mailbox details afterwards, you should find that the account is enabled for analytics but won’t receive the mail digest:

Get-MyAnalyticsFeatureConfig -Identity Stale.Hansen@office365itpros.com | ft UserId, PrivacyMode, IsDigestEmailEnabled

UserId                           PrivacyMode IsDigestEmailEnabled
------                           ----------- --------------------
Stale.Hansen@office365itpros.com opt-in                     False

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.
# Remove MyAnalytics licenses from Office 365 accounts
$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"  }

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. A more developed version of code which can handle the removal of any individual service plan from an Office 365 SKU is described here.

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…

25 Replies to “Why Office 365 Users Receive MyAnalytics Messages and How to Stop the 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.

  3. Hey Tony,

    Do you know if MyAnalytics stores any data in a SharePoint Site? or a is it all stored in the users mailbox? I realize that MyAnalytics does query SharePoint sites for documents and i am sure other data. But i was just curious as to where it stores the metadata it gathers.



    1. The data is stored in a hidden folder in the non-IPM part of the user’s mailbox.

  4. I’m a home user, I’m retired, I don’t want/need/care for the “MyAnalytics/Well-being” crap … and yet when I try to “unsubscribe” (or even make an effort to get to the MyAnalytics user settings described above, I keep getting this error message:

    Request Id: f503c94b-a9f3-4416-9df0-72c9f5767300
    Correlation Id: 39c6ed13-0ca1-44eb-abbc-3c5ba4e9961a
    Timestamp: 2020-06-16T00:15:54Z
    Message: AADSTS50020: User account ‘torreycat@vcnet.com’ from identity provider ‘live.com’ does not exist in tenant ‘Microsoft Services’ and cannot access the application ’71a7c376-13e6-4100-968e-92ce98c5d3d2′(Weve) in that tenant. The account needs to be added as an external user in the tenant first. Sign out and sign in again with a different Azure Active Directory user account.

    I have NO IDEA what any of this means! (And truly, I don’t know want to know, I just want to eliminate the annoying spam messages in my mailbox every week!) Can anyone help me? Before I lose my mind ….

    1. Can you run PowerShell? If so, you might be able to remove the settings with PowerShell.

      1. Ummm…I don’t even know what it is, but I saw your references to it earlier in this thread, so let me check it out. Thanks, I do appreciate your response! 👍

      2. Update: No, this is way beyond my skillset (I have the Powershell app open and c:\ prompt but no idea where/how to go from there, and don’t want to do damage trying to figure this out, so guess I’ll just have the local “computer whiz” guy come by some day after CV-19 is really in the rear-view and fix it for me. In the meantime, I’ll just continue dumping the MyAnalytics email as I have been. Thanks, anyway, Tony!

      3. Playing safe with PowerShell is a very good idea. I don’t think you would do much damage, but it’s better to be safe than sorry.

  5. I’m with enraptored, above: retired, no need or use for this intrusion microsoft has forced on me. I’m linux based, no microsoft software of any kind on any devices in my house, but because my mail account comes through my ex-employer, and their server uses office365, you get to dump spam into my linux inbox. I don’t have PowerShell. Or a dos prompt. Or access to the office365 server my ex-employer uses. I’ve explicitly eliminated microsoft from my devices because of exactly this kind of intrusion on my privacy. It should be illegal for microsoft to do this without explicit up-front permission from the end user. Is there a way for me to eliminate this? Or a federal agency where complaints can be filed? Thanks.

    1. I’m puzzled why you would keep an email account on the Office 365 tenant belonging to your ex-employer. You’re receiving a free service from that tenant, which is nice, but the downside is that you’ve got to accept the policies set by your ex-employer for the operation of that tenant. One of those policies is that you get MyAnalytics messages. Complaints to the government will be useless because the control in this instance rests with your ex-employer. Either have them update your account so you don’t receive messages or move your mailbox to a platform where you’re more comfortable with the service.

  6. I for one do not want Mr XYZ to even know that I also know Mr ABC but there they both are in my network because they are both listed in my Outlook? What is wrong with this? It could be that XYZ is a vendor and ABC is a customer.

    1. The data shown to you by MyAnalytics is personal to you and isn’t shared with anyone else. Thus, does it matter?

Leave a Reply

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