The reconstructed evaluation script behind this rule's OVAL check(s) — every module a compound check combines, with this rule's own concrete values and DISA's SCC tool's real per-module mechanism curated from static teardown of SCC releases.
# Windows PowerShell
# Reconstructed from oval:mil.disa.stig.windows:def:1173
# Local users on domain-joined computers must not be enumerated.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# If system is a Member Server
# wmi57_object (wmi57_test)
function test_1 {
return (((Get-CimInstance -Namespace 'root\cimv2' -Query 'SELECT DomainRole FROM win32_computersystem' | Select-Object -First 1) | Select-Object -ExpandProperty 'DomainRole') -eq '3')
}
# Verifies 'Enumerate local users on domain-joined computers' is set to 'Disabled'
# registry_object (registry_test)
function test_2 {
return (((@{String='reg_sz';ExpandString='reg_expand_sz';Binary='reg_binary';DWord='reg_dword';MultiString='reg_multi_sz';QWord='reg_qword';None='reg_none'}[(Get-Item -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System').GetValueKind('EnumerateLocalUsers').ToString()]) -eq 'reg_dword') -and (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System' -Name 'EnumerateLocalUsers' -ErrorAction SilentlyContinue) | Select-Object -ExpandProperty 'EnumerateLocalUsers') -eq 0))
}
if ((-not (test_1) -or test_2)) {
Write-Output "PASS"
} else {
Write-Output "FAIL"
} Assessment Script Powered by AISyntax-verified
A standalone PowerShell script to assess this control automatically. Review before running it in your environment.
Syntax-checked as valid PowerShell. Not executed here — running it for real needs the actual ms_windows_server_2016 target this check assesses.
# OVAL Definition: oval:mil.disa.stig.windows:def:1173
$isMemberServer = (Get-CimInstance -ClassName Win32_ComputerSystem).DomainRole -eq 3
if ($isMemberServer) { exit 0 }
$registryPath = "HKLM:\Software\Policies\Microsoft\Windows\System"
if (-Not (Test-Path -Path $registryPath)) { exit 0 }
$enumValue = (Get-ItemProperty -Path $registryPath -Name EnumerateLocalUsers -ErrorAction SilentlyContinue).EnumerateLocalUsers
if ($enumValue -eq 0) { exit 0 }
exit 1