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.fso.windows:def:4733
# The Peer Networking Identity Manager service must be disabled if installed.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# Verifies the Peer Networking Identity Manager service startup type is Disabled
# wmi_object (wmi_test)
function test_1 {
return (((Get-CimInstance -Namespace 'root\cimv2' -Query 'SELECT startmode FROM Win32_Service WHERE name=''p2pimsvc''' | Select-Object -First 1) | Select-Object -ExpandProperty 'startmode') -eq 'Disabled')
}
# Verifies the Peer Networking Identity Manager service is not installed
# wmi_object (wmi_test)
function test_2 {
return (-not ($null -ne (Get-CimInstance -Namespace 'root\cimv2' -Query 'SELECT startmode FROM Win32_Service WHERE name='p2pimsvc'')))
}
if ((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_2012_and_2012_r2_ms target this check assesses.
# OVAL Definition: oval:mil.disa.fso.windows:def:4733
$service = Get-CimInstance -ClassName Win32_Service -Filter "Name='p2pimsvc'" -ErrorAction SilentlyContinue
if ($service -eq $null) { exit 0 }
if ($service.StartMode -eq 'Disabled') { exit 0 }
exit 1