Configure Network Options preference logging and tracing
Vérifié avec Windows 11 25H2 — mis à jour le 12 juillet 2026
Pris en charge sur : Au minimum Windows Server 2003 ou Windows XP Professionnel avec SP2
Chemin dans la console GPO
Configuration ordinateur\Modèles d'administration\Système\Stratégie de groupe\Logging and tracing Description
This policy setting allows you to configure the level of detail recorded by event logging for the Network Options preference extension, and to turn on tracing for the Network Options extension. Logging and tracing provide diagnostic information for troubleshooting. If you enable this policy setting, you can configure event logging and turn on tracing for the Network Options extension for client computers. If you disable or do not configure this policy setting, by default event logging for this extension includes only warnings and errors, and tracing for this extension is turned off. Notes: 1. User Configuration tracing: To perform tracing for items in this preference extension listed under User Configuration, you must provide a path in the "User trace" box to the location where a user trace file can be created on the client computer, and you must turn on the "Tracing" option. If there are no preference items under User Configuration in this extension, no user trace file is created. 2. Computer Configuration tracing: This preference extension is available under User Configuration only, so computer configuration tracing is not applicable. 3. Group Policy Modeling query tracing: To perform tracing for items in this preference extension when you perform a Group Policy Modeling query, you must provide a path in the "Planning trace" box to the location where a planning trace file can be created on the computer where you run modeling, and you must turn on the "Tracing" option. If you are not performing Group Policy Modeling or there are no preference items in this extension, no planning trace file is created.
Registre
Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F} Générateur d'exports
BETAConfigurez l'état, la portée et les options, puis générez les sorties .reg, PowerShell, Intune et SCCM — ou ajoutez le paramètre à une collection multi-paramètres.
Ces exports écrivent le registre — ce n'est pas une GPO managée. ⓘ
Fichier .reg
Windows Registry Editor Version 5.00
; Exported from gporais.com
; Policy: Configure Network Options preference logging and tracing
; State: Enabled
; Supported on: Au minimum Windows Server 2003 ou Windows XP Professionnel avec SP2
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}]
"LogLevel"=dword:00000002
"TraceLevel"=dword:00000000
"TraceFilePathUser"=""
"TraceFilePathMachine"=""
"TraceFilePathPlanning"=""
"TraceFileMaxSize"=dword:00000400 Autres formats (PowerShell, Intune, SCCM)
PowerShell
# Exported from gporais.com
# Policy: Configure Network Options preference logging and tracing
# State: Enabled
# Supported on: Au minimum Windows Server 2003 ou Windows XP Professionnel avec SP2
$path = 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'LogLevel' -Value 2 -Type DWord
Set-ItemProperty -Path $path -Name 'TraceLevel' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'TraceFilePathUser' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'TraceFilePathMachine' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'TraceFilePathPlanning' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'TraceFileMaxSize' -Value 1024 -Type DWord Intune XML
Aucune correspondance directe Policy CSP / OMA-URI pour cette stratégie. Utilisez l'onglet Intune Remediation, ou importez l'ADMX dans Intune. Intune Remediation
# === Detection script ===
# Exported from gporais.com
# Policy: Configure Network Options preference logging and tracing
# State: Enabled
# Supported on: Au minimum Windows Server 2003 ou Windows XP Professionnel avec SP2
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'LogLevel' -Expected 2 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceLevel' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceFilePathUser' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceFilePathMachine' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceFilePathPlanning' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceFileMaxSize' -Expected 1024 -Kind DWord)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Configure Network Options preference logging and tracing
# State: Enabled
# Supported on: Au minimum Windows Server 2003 ou Windows XP Professionnel avec SP2
$path = 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'LogLevel' -Value 2 -Type DWord
Set-ItemProperty -Path $path -Name 'TraceLevel' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'TraceFilePathUser' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'TraceFilePathMachine' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'TraceFilePathPlanning' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'TraceFileMaxSize' -Value 1024 -Type DWord Scripts SCCM
# Exported from gporais.com
# Policy: Configure Network Options preference logging and tracing
# State: Enabled
# Supported on: Au minimum Windows Server 2003 ou Windows XP Professionnel avec SP2
# SCCM Configuration Item guidance:
# Create a Configuration Item of type "Setting: Script".
# Discovery script: use the Detection script below.
# Remediation script: use the Remediation script below.
# Compliance rule: the Discovery script output equals 'Compliant'.
# === Detection script ===
# Exported from gporais.com
# Policy: Configure Network Options preference logging and tracing
# State: Enabled
# Supported on: Au minimum Windows Server 2003 ou Windows XP Professionnel avec SP2
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'LogLevel' -Expected 2 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceLevel' -Expected 0 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceFilePathUser' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceFilePathMachine' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceFilePathPlanning' -Expected '' -Kind String)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}' -Name 'TraceFileMaxSize' -Expected 1024 -Kind DWord)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Configure Network Options preference logging and tracing
# State: Enabled
# Supported on: Au minimum Windows Server 2003 ou Windows XP Professionnel avec SP2
$path = 'HKLM:\Software\Policies\Microsoft\Windows\Group Policy\{3A0DBA37-F8B2-4356-83DE-3E90BD5C261F}'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'LogLevel' -Value 2 -Type DWord
Set-ItemProperty -Path $path -Name 'TraceLevel' -Value 0 -Type DWord
Set-ItemProperty -Path $path -Name 'TraceFilePathUser' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'TraceFilePathMachine' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'TraceFilePathPlanning' -Value '' -Type String
Set-ItemProperty -Path $path -Name 'TraceFileMaxSize' -Value 1024 -Type DWord Vous construisez une collection multi-paramètres ? Ajoutez ce paramètre et générez des exports combinés (.reg, PowerShell, GPO).