Turn off API Sampling
View on the Group Policy page ›
- Policy ID
- TurnOffAPISamping
- Scope
- Computer Configuration
- Supported on
- At least Windows 11 Version 24H2
- Source
- Administrative Templates (.admx) for Windows 11 2025 Update (25H2) (version 1)
- Category
- Windows Components › App and Device Inventory
Description
This policy controls the state of API Sampling. API Sampling monitors the sampled collection of application programming interfaces used during system runtime to help diagnose compatibility problems.
If you enable this policy, API Sampling will not be run.
If you disable or do not configure this policy, API Sampling will be turned on.
Registry
DisableAPISamping
REG_DWORDComputer- Enabled value
- 1
- Disabled value
- 0
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\AppCompat] ; Options (use only one) ; Enabled "DisableAPISamping"=dword:00000001 ; Disabled "DisableAPISamping"=dword:00000000
CMD
:: Options (use only one) :: Enabled reg add "HKLM\Software\Policies\Microsoft\Windows\AppCompat" /v "DisableAPISamping" /t REG_DWORD /d 1 /f :: Disabled reg add "HKLM\Software\Policies\Microsoft\Windows\AppCompat" /v "DisableAPISamping" /t REG_DWORD /d 0 /f
PowerShell
# Common: create the key New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\AppCompat' -Force | Out-Null # Options (use only one) # Enabled New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\AppCompat' -Name 'DisableAPISamping' -PropertyType DWord -Value 1 -Force | Out-Null # Disabled New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\AppCompat' -Name 'DisableAPISamping' -PropertyType DWord -Value 0 -Force | Out-Null