Configure MyAnalytics

Role - Global admin, Exchange Online admin, or Insights admin

  • Prerequisite - Users have access to MyAnalytics only if they have licenses that include the MyAnalytics service plan, as described in plans and environments for MyAnalytics.

  • Data privacy - See the MyAnalytics privacy guide to understand how privacy is built into MyAnalytics and to learn what you can configure to address specific privacy requirements.

To configure MyAnalytics

Important

You must have a Global admin, an Exchange Online (EXO) admin, or an Insights admin role to configure users for MyAnalytics in PowerShell.

Note

When you set the defaults (at either the tenant or user level), users can individually override these settings. For example, if you keep the dashboard tenant setting as opt in, users can open the dashboard and opt themselves out. Similarly, if you opt out users with a user-level setting, those users can choose to opt back in. The exception is if a user's license with a MyAnalytics service plan expires, that user cannot opt in.

Assign licenses with a MyAnalytics service plan

MyAnalytics is available to users who are assigned a license with a MyAnalytics service plan. For more details about which licenses have MyAnalytics service plans and when users get access to MyAnalytics elements after license assignment, see plans and environments for MyAnalytics.

For information on how to assign a license, see Assign licenses to users in Microsoft 365 for business.

Note

If you want to notify your organization before you assign licenses with a MyAnalytics service plan, you can use this email template. You can download it, customize it with your company's information, and then email it to the new MyAnalytics participants. To learn more about adopting MyAnalytics, see Adopt MyAnalytics.

Configure access at the tenant level

You can configure access to MyAnalytics elements for all users in your organization.

Important

You must have a Global admin or an Exchange Online admin role to configure tenant level settings in the admin center.

To enable access to the dashboard and digests

  1. Sign in as a Global admin or an Exchange Online admin to the Microsoft 365 admin center.

  2. Make sure you're using the new admin center. To do this, if the switch in the upper right of the page reads Try the new admin center, select it so that it reads The new admin center:

    New admin center

  3. In the left pane, expand Settings and then select Org settings.

  4. In the main pane, under Services, select MyAnalytics:

    Select MyAnalytics

    This opens a page where you can configure access to MyAnalytics elements:

    Select visibility

  5. Select Insights dashboard to keep all MyAnalytics users in your organization opted in for access to the MyAnalytics dashboard. Deselect Insights dashboard to opt users out of access to the dashboard.

  6. Select Weekly insights to keep all MyAnalytics users in your organization opted in for access to the weekly digest (and the MyAnalytics welcome email). Deselect Weekly insights email to opt users out of the digest email (and the MyAnalytics welcome email).

  7. Select Insights Outlook add-in to keep all MyAnalytics users in your organization opted in for access to the Insights Outlook add-in. Deselect it to opt users out of access to the Insights Outlook add-in.

Note

After a new tenant is established, it might take up to 48 hours for this functionality to become available.

Configure access at the user level

You can configure MyAnalytics access for individual users in your organization. For example, you could opt-out the user completely, which would turn off all MyAnalytics functionality for that user. However, the user can choose to opt back in.

You configure MyAnalytics by setting the PrivacyMode parameter. For information about the values of PrivacyMode, see User configuration settings. Before you can make this setting, you must take preparatory steps; see Command sequence.

Important

The PowerShell cmdlets Get-UserAnalyticsConfig and Set-UserAnalyticsConfig, which you might have used to configure access to MyAnalytics, are no longer available. Instead, please use the following new cmdlets: Get-MyAnalyticsFeatureConfig and Set-MyAnalyticsFeatureConfig, which offer the same functionality along with some additional granular control.

User configuration settings

PrivacyMode parameter Licensed user Unlicensed user
Opt-in (default setting)
  • Microsoft 365 data is used for aggregated information shown to licensed users
  • Dashboard is available
  • User can opt out
  • Microsoft 365 data is used for aggregated information shown to licensed users
  • Admins can opt out unlicensed users through the admin PowerShell
Opt-out
  • Microsoft 365 data is not used for aggregated information shown to licensed users
  • Dashboard is not available
  • User can opt in through the Feature settings menu
  • Microsoft 365 data is not used for aggregated information shown to licensed users.

Command sequence

You will use the Set-MyAnalyticsFeatureConfig and Get-MyAnalyticsFeatureConfig cmdlets to work with user configuration settings. Before you can use them, you need to install a module and sign in to be authenticated. This is the sequence of steps:

  1. Connect to Exchange Online and, when prompted, sign in with your admin credentials.
  2. After you've signed in, you are ready to work with user-configuration settings:

Connect to Exchange Online

In this procedure, you install prerequisites and then you install the Exchange Online PowerShell V2 module.

  1. Open PowerShell.

  2. Prerequisite #1: Installing packages from the PowerShell Gallery requires the latest version of the PowerShellGet module. Run these commands to install it:

    Install-Module PowerShellGet –Repository PSGallery –Force
    

    For more information, see Installing PowerShellGet.

  3. Prerequisite #2: Install the Exchange Online PowerShell V2 module:

    Install-Module -Name ExchangeOnlineManagement -RequiredVersion 2.0.4
    

    For more information, see Install-Module.

  1. Connect to Exchange Online. In PowerShell, run the command Connect-ExchangeOnline.

    Connect-ExchangeOnline
    

    This will prompt you to authenticate, which you do by entering your admin credentials.

Set MyAnalytics access for one user

Configure MyAnalytics access settings for a user with the PowerShell cmdlet Set-MyAnalyticsFeatureConfig:

Set-MyAnalyticsFeatureConfig –Identity <string> [-PrivacyMode <string[]>]
Parameter Required Description Default value
Identity Yes User ID for the current user as stored in Azure Active Directory (AAD) --
PrivacyMode Yes
  • Opt-out: MyAnalytics won't use the user's data to compute derived statistics for other users. The user won't see statistics in MyAnalytics, but can choose to opt in from the Feature settings menu.
  • Opt-in: MyAnalytics uses the user's data to compute derived statistics for other users. The user can see statistics in MyAnalytics, but can choose to opt out from the Feature settings menu.
Opt-in

Use Set-MyAnalyticsFeatureConfig to change the configuration settings of the user who is identified by the -Identity parameter. The following is a sample output of this cmdlet. It indicates that the user was opted in and that all of that user's MyAnalytics features were turned on except the digest email:

 UserId : <username>@<domain>
 PrivacyMode : opt-in
 IsDashboardEnabled : true
 IsAddInEnabled  : true
 IsDigestEmailEnabled : false

Also see Command reference: Set-MyAnalyticsFeatureConfig.

Confirm MyAnalytics access for a user

Use the following to confirm whether a user has access to MyAnalytics (the value for PrivacyMode):

Get-MyAnalyticsFeatureConfig –Identity <string>
Parameter Required Description Default value
Identity Yes User ID for the current user as stored in AAD -

Get-MyAnalyticsFeatureConfig reveals the current configuration settings of the user who is identified by the -Identity parameter. The following is a sample output of this cmdlet. It indicates that the user is currently opted in and that they have all MyAnalytics features turned on except the digest email:

 UserId : <username>@<domain>
 PrivacyMode : opt-in
 IsDashboardEnabled : true
 IsAddInEnabled  : true
 IsDigestEmailEnabled : false

Set MyAnalytics access for multiple users

Use the following steps in the Exchange Online PowerShell V2 module to change access to MyAnalytics (the value of PrivacyMode) for multiple users by running a PowerShell script that iterates through the users, changing the value one user at a time.

  1. Create a comma-separated value (.csv) text file that contains the UserPrincipalName field of the users you want to configure. For example:

    UserPrincipalName
    ClaudeL@contoso.onmicrosoft.com
    LynneB@contoso.onmicrosoft.com
    ShawnM@contoso.onmicrosoft.com
    
  2. Specify the location of the input .csv file, the output .csv file, and the value of PrivacyMode that you want to set for each user:

    $inFileName="<path and file name of the input .csv file that contains the users, example: C:\admin\Users2License..csv>"
    $outFileName="<path and file name of the output .csv file that records the results, example: C:\admin\Users2License-Done..csv>"
    $privacyMode = "Opt-in"
    
    $users=Import-Csv $inFileName
    ForEach ($user in $users)
    {
    $user.Userprincipalname
    $upn=$user.UserPrincipalName
    
    Set-MyAnalyticsFeatureConfig –Identity $upn -PrivacyMode $privacyMode
    Get-MyAnalyticsFeatureConfig –Identity $upn | Export-Csv $outFileName
    }
    

    Also see Command reference: Set-MyAnalyticsFeatureConfig.

  3. Run the resulting commands at the Exchange Online PowerShell V2 module command prompt. For more information about the module, see Exchange Online PowerShell V2 module.

This PowerShell script:

  • Displays the user principal name for each user.
  • Sets the specified privacy mode for each user.
  • Creates a .csv file with all the users that were processed and shows their status.

Command reference: Set-MyAnalyticsFeatureConfig

The PowerShell command Set-MyAnalyticsFeatureConfig can be used in three different ways:

Set the PrivacyMode parameter

For more information about PrivacyMode, see Configure access at the user level.

Command syntax - PrivacyMode

Set-MyAnalyticsFeatureConfig -Identity <string> -PrivacyMode <opt-in/opt-out>

Example - PrivacyMode

Running the following command sets the privacy mode to "opt-in" and enables all the features of MyAnalytics for the user:

Set-MyAnalyticsFeatureConfig -Identity <string> -PrivacyMode opt-in   

Enable or disable MyAnalytics features

Command syntax - features on or off

Set-MyAnalyticsFeatureConfig -Identity <string> -Feature <dashboard/add-in/digest-email/all> -isEnabled <$true/$false>

Example - features on or off

Running the following command disables the digest email for the user:

Set-MyAnalyticsFeatureConfig -Identity <string> -Feature digest-email -isEnabled $false

Set PrivacyMode and enable or disable features

Command syntax - PrivacyMode and features

Set-MyAnalyticsFeatureConfig -Identity <string> -PrivacyMode <opt-in/opt-out> -Feature <dashboard/add-in/digest-email/all> -isEnabled <$true/$false>

Example - PrivacyMode and features

Running the following command opts the user in (by setting PrivacyMode to 'opt-in') and enables all the features of MyAnalytics except the digest email:

Set-MyAnalyticsFeatureConfig -Identity <string> -PrivacyMode opt-in -Feature digest-email -isEnabled $false