# api: multitool
# version: 0.2
# title: Netlogon.log enable
# description: Set NETLOGON debug parameters
# category: beta
# x_cat: registry
# icon: powershell
# type: inline
# key: b51
# doc: https://serverfault.com/questions/65265/finding-why-a-user-is-locked-out-in-active-directory,
# https://support.microsoft.com/de-de/help/109626/enabling-debug-logging-for-the-netlogon-service
# status: beta
#
# Akin to running:
# ❏ Nltest /DBFlag:2080FFFF
# on user machine.
#
# ➜ log should appear in C:\Windows\Debug\netlogon.log
#
# Disable again via
# ❏ Nltest /DBFlag:0
# on client
Param(
$machine = (Read-Host "computer"),
$user = (Read-Host "user")
)
$settings = @(
@("\\$machine\HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\DBFlag", (0x2080FFFF), "DWord"),
@("\\$machine\HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters\MaximumLogFileSize", (2MB), "DWord")
)
#-- registry
ForEach ($tuple in $settings) {
$regkey, $setval, $regtype = $tuple
Write-Host -f Yellow "➜ $regkey := $setval"
Set-RemoteRegistry $regkey $setval $regtype
}
Write-Host -f Gray "➩ Active after next reboot"
Write-Host -f Gray "➩ See C:\windows\Debug\netlogon.log"
Write-Host ""