Skip to content

Instantly share code, notes, and snippets.

@jhochwald
Created January 31, 2021 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhochwald/ac45f612190a40028a3dc32217dca321 to your computer and use it in GitHub Desktop.
Save jhochwald/ac45f612190a40028a3dc32217dca321 to your computer and use it in GitHub Desktop.
Disable the .NET Telemetry on production servers and critical workstations
# Disable the .NET Telemetry on production servers and critical workstations
[Environment]::SetEnvironmentVariable('DOTNET_CLI_TELEMETRY_OPTOUT', '1', 'Machine')
[Environment]::SetEnvironmentVariable('MLDOTNET_CLI_TELEMETRY_OPTOUT', '1', 'Machine')
# Tweak the 1st run experience
[Environment]::SetEnvironmentVariable('DOTNET_SKIP_FIRST_TIME_EXPERIENCE', '1', 'Machine')
@jhochwald
Copy link
Author

If you don't have admin access (no elevated PowerShell), you might want to use this in you profile and/or Startscript for the .NET Application:

$Env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
$Env:MLDOTNET_CLI_TELEMETRY_OPTOUT = '1'
$Env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'

Both methods work on Windows PowerShell and PowerShell Core (On Windows, MacOS, and Linux)!

@jhochwald
Copy link
Author

I get that Microsoft wants to have some telemetry for .NET! And this is nothing bad, but I don't want to send any telemetry data from production servers or workstations with any critical workloads.

I have it enabled on my development systems! I'm not paranoid ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment