Skip to content

Instantly share code, notes, and snippets.

@Calvindd2f
Created March 7, 2024 12:45
Show Gist options
  • Select an option

  • Save Calvindd2f/33d889958104c14dbf9dcfd9c370b94a to your computer and use it in GitHub Desktop.

Select an option

Save Calvindd2f/33d889958104c14dbf9dcfd9c370b94a to your computer and use it in GitHub Desktop.
Intuneless
  1. Create a new PowerShell script file named script-ps with the following content:
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows Defender\Features" /v TamperProtection /t REG_DWORD /d 5 /f
  1. Create a new configuration file named TamperProtection.cfg with the following content:
[General]
EXEFilename=
CommandLine=(gc script-ps) | iex
StartDirectory=%windir%
WaitProcess=0
PriorityClass=32
WindowState=0
UseWindowPosition=0
WindowPosition=20,20
UseWindowSize=0
WindowSize=640,400
RunAs=8
RunAsProcessName=
EnvironmentVariablesMode=1
OSCompatMode=0
UseSearchPath=0
ParseVarCommandLine=1
UseAffinityMask=0
AffinityMask=0 1
Compat640480=0
CompatDisableVisualThemes=0
CompatDisableDesktopComp=0
CompatDisableFullScreenOpt=0
CompatHighDPI=0
CompatColors=0
RunAsUserName=
RunAsDomain=
RunFromService=0
ComputerName=
RunMode=4
ShellExecuteAction=
CommandWindowMode=2
[EnvironmentVariables]
Lines=0
WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 65 00 00 00 18 00 00 00 9A 03 00 00 A0 02 00 00
  1. Run the following command in an elevated Command Prompt:
AdvancedRun.exe /Run TamperProtection.cfg
  1. Reboot

If step 3 errors or anything - try run it again from the SYSTEM account (psexec -i -s)

  1. Verify To check the state of tamper protection, you can use the Get-MpComputerStatus PowerShell cmdlet. In the list of results, look for IsTamperProtected or RealTimeProtectionEnabled .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment