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:1185
# Windows Server 2016 built-in administrator account must be renamed.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
#
# MANUAL REVIEW REQUIRED -- the module(s) below could not be reconstructed
# into working code from curated SCC reference data, and are excluded from
# the automated result:
# - sid_sid_object (sid_sid_test) -- Verifies 'Accounts: Rename administrator account' is not set to 'localdomain\Administrator': field "trustee_name" has an unresolved variable reference
# Verifies 'Accounts: Rename administrator account' is not set to 'Administrator'
# sid_sid_object (sid_sid_test)
function test_1 {
return (((Get-LocalUser | Where-Object {$_.SID.Value -match '^S-1-5-[0-9-]+-500$'}).Name) -eq 'Administrator')
}
if (test_1) {
Write-Output "PASS (automated portion only -- MANUAL REVIEW still required, see notes above)"
} else {
Write-Output "FAIL (or see MANUAL REVIEW note above)"
} 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:1185
$adminSID = "S-1-5-21-"; (Get-CimInstance -ClassName Win32_ComputerSystem).DomainSID.Value -join "-"
$adminAccount = Get-CimInstance -ClassName Win32_Trustee -Filter "SID='$adminSID'" | Select-Object -ExpandProperty Name
if ($adminAccount -notin @("Administrator", "localdomain\Administrator")) { Write-Output "PASS"; Exit 0 } else { Write-Output "FAIL"; Exit 1 }