You can configure MyAnalytics (change its default behavior) for users in your organization by setting the PrivacyMode parameter. For information about the values of PrivacyMode, see PrivacyMode options.

You can set this parameter for one user or for many users:

PrivacyMode options

PrivacyMode Licensed user Unlicensed user
Opt-in (This is the default setting)
  • Office 365 data is used for aggregated information shown to licensed users.
  • Personal dashboard is available.
  • User can opt-out.
  • Office 365 data is used for aggregated information shown to licensed users.
  • Admins can opt-out unlicensed users through the admin PowerShell.
Opt-out
  • Office 365 data is not used for aggregated information shown to licensed users.
  • Personal dashboard is not available.
  • User can opt-in through the Feature settings menu.
  • Office 365 data is not used for aggregated information shown to licensed users.
Excluded
  • Office 365 data is not used for aggregated information shown to licensed users.
  • Dashboard is available.
  • User cannot opt-in through the Feature settings menu.
  • Do not specify Excluded for unlicensed users. Instead, specify Opt-out.

Note

  • Licensed users have MyAnalytics automatically enabled for them after a license is assigned to them.
  • All users in your organization, whether or not they have MyAnalytics licenses issued to them, are opted-in. If you want a licensed user to be opted out by default, which would give them the choice to opt-in, change the value of the PrivacyMode parameter for that user to "Opt-out."

Set PrivacyMode for one user

Configure MyAnalytics settings for a user with the following PowerShell cmdlet:

Set-UserAnalyticsConfig –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
  • Excluded: MyAnalytics will not use the current user's data to compute derived statistics for other users. The current user will not be able to change this from the Feature settings menu in MyAnalytics, but will still be able to see personalized statistics in their MyAnalytics dashboard and the Insights Outlook add-in.
  • Opt-out: MyAnalytics will not use the current user's data to compute derived statistics for other users. The current user will not see statistics in MyAnalytics, but can change this from the Feature settings menu and choose to opt-in.
  • Opt-in: MyAnalytics will use the current user's data to compute derived statistics for other users. The current user will see statistics in MyAnalytics, and can change this from the Feature settings menu to opt out.
Opt-in

Get PrivacyMode for one user

To determine the value of PrivacyMode for one user, use the following cmdlet:

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

Set PrivacyMode for multiple users

You can use PowerShell to change the value of PrivacyMode for multiple users at once. To do this, run a PowerShell script that iterates through the users, changing the value one user at a time. Follow these steps:

  1. Create a comma-separated value (.csv) text file that contains the UserPrincipalName field and the addresses of the users you want to configure. For example:
UserPrincipalName,UsageLocation
ClaudeL@contoso.onmicrosoft.com,FR
LynneB@contoso.onmicrosoft.com,US
ShawnM@contoso.onmicrosoft.com,US
  1. 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-UserAnalyticsConfig –Identity $upn -PrivacyMode $privacyMode
Get-UserAnalyticsConfig –Identity $upn | Export-Csv $outFileName
}
  1. Run the resulting commands at the PowerShell command prompt. For more information about the Exchange Online PowerShell, see Connect to Exchange Online PowerShell.

This PowerShell command block does the following:

  • Displays the user principal name of 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.