Skip to content

Compliance Check Windows ​

This section describes the checks to be executed before a VM can be changed back to Full Managed state.

Compliance Check Reference ​

Base.AdminAutologon.Tests

Test: Testing if automatic logon for Admins is disabled

Expected result: Automatic logon should be disabled.

How to fix:

powershell
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name "AutoAdminLogon" -Value 0
Base.Administrators.Tests

Test: Testing local Administrators membership

Expected result: Local Administrators should have only Swisscom-allowed accounts as members.

How to fix: Remove any added users from Administrators group and follow the user management procedure.

Base.AdminPrivilege.Tests

Test: Testing Administrators Privileges

Expected result: Local Administrators Group must have the following privileges:

  • Access this computer from the network
  • Allow log on locally
  • Allow log on through Terminal Services

How to fix:

  1. Run secpol.msc
  2. Navigate to Security Settings > Local Policies > User Rights Assignment
  3. Find each privilege above and ensure Administrators is a member of all 3
Base.AuditPolicy.Tests

Test: Testing if Audit Policies are configured to audit Success and Failure

Expected result: The following Audit Policies are configured to audit Success and Failure:

  • Logon, Logoff, Account Lockout
  • IPsec Main Mode, Quick Mode, Extended Mode
  • Special Logon, Other Logon/Logoff Events
  • Network Policy Server, User/Device Claims
  • Non Sensitive Privilege Use, Other Privilege Use Events, Sensitive Privilege Use
  • Authentication Policy Change, Authorization Policy Change
  • MPSSVC Rule-Level Policy Change, Filtering Platform Policy Change
  • Other Policy Change Events, Audit Policy Change
  • User/Computer/Security Group/Distribution Group/Application Group Management
  • Other Account Management Events
  • Kerberos Service Ticket Operations, Authentication Service
  • Credential Validation, Other Account Logon Events

How to fix:

Get all audit policies:

powershell
auditpol.exe /get /category:*

Set a specific failing policy (replace {FAILING_NAME_HERE}):

powershell
auditpol.exe /set /subcategory:{FAILING_NAME_HERE} /success:enable /failure:enable

Example for Logon policy:

powershell
auditpol.exe /set /subcategory:Logon /success:enable /failure:enable
Base.BitLockerDriveEncryption.Tests

Test: Testing if the WindowsFeature Bitlocker is installed

Expected result: BitLocker should not be installed.

How to fix:

Important

First ensure no disks are encrypted:

powershell
manage-bde -status

Only after confirming no encrypted disks, remove BitLocker:

powershell
Uninstall-WindowsFeature -Name Bitlocker
Base.BITSService.Tests

Test: Testing BITS Service StartMode

Expected result: BITS Service should not be disabled.

How to fix:

powershell
Set-Service BITS -StartupType Manual
Base.BuiltInAccountsDisabled.Tests

Test: Testing if Built-in Accounts are disabled

Expected result:

  • Built-in Administrator should be enabled
  • Built-in Guest should be disabled

How to fix:

Enable Built-in Administrator:

powershell
Get-LocalUser | where {$_.sid -like 'S-1-5-*-500'} | Enable-LocalUser

Disable Built-in Guest:

powershell
Get-LocalUser | where {$_.sid -like 'S-1-5-*-501'} | Disable-LocalUser
Base.ComputernameChanged.Tests

Test: Testing if the Computername changed

Expected result: Computer name should not have changed.

How to fix: Reset to original name:

powershell
Rename-Computer

You will be prompted for the original name (as set when VM was created).

Base.CpuUsage.Tests

Test: Testing CPU load average

Expected result: Average CPU usage should be less than 95%.

How to fix:

  • Identify applications overloading the CPU
  • Increase CPU cores via Day 2 action "Reconfigure" (after entering Customer Maintenance Mode)
Base.DeviceManager.Tests

Test: Testing Device Manager for errors

Expected result: Device Manager should not return any errors.

How to fix: Open Device Manager and resolve any failing devices. Ensure VMware Tools are installed correctly.

Base.DomainJoin.Tests

Test: Testing the computer's domain membership

Expected result: Computer should be part of a Swisscom resource domain.

How to fix: Contact support to re-join the domain.

Base.DriveFull.Tests

Test: Testing Drive capacity

Expected result:

  • System Drive: minimum 20 GB free space
  • Data Drive: minimum 5 GB free space

How to fix:

  • Run disk cleanup: cleanmgr.exe (select Windows Update Cleanup to free space)
  • Extend the disk if needed
Base.EventlogProperties.Tests

Test: Testing if event log maximum size and log mode are configured correctly

Expected result:

  • Log mode: Circular for Application, System, and Security logs
  • Minimum size: System/Application ≥ 262,144 KB, Security ≥ 524,288 KB

How to fix:

powershell
Limit-EventLog -LogName System -MaximumSize 262144KB -OverflowAction OverwriteAsNeeded
Limit-EventLog -LogName Application -MaximumSize 262144KB -OverflowAction OverwriteAsNeeded
Limit-EventLog -LogName Security -MaximumSize 524288KB -OverflowAction OverwriteAsNeeded
Base.IISLogLocation.Tests

Test: Testing if the IIS logs are at the correct location

Expected result: IIS logs should be on the data volume, not C:.

How to fix: Move logs via IIS Manager console by configuring Logging for each site.

Base.LocalAccountTokenFilterPolicy.Tests

Test: Testing Remote UAC LocalAccountTokenFilterPolicy

Expected result: LocalAccountTokenFilterPolicy should be activated to allow local Administrators (except built-in) to remotely manage the server.

How to fix:

powershell
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system' -Name "LocalAccountTokenFilterPolicy" -Value 1
Base.LoggedOnUsers.Tests

Test: Testing Logged on Users

Expected result: No local users with admin rights should be logged on.

How to fix: Log off all users and try again.

Base.LogMgmtInstallation.Tests

Test: Testing installed Log Management software

Expected result:

  • Log Management Agent Service should be running
  • Service startup type should be Automatic
  • Connectivity to Log Management server should work
Base.MalwareProtectionInstallation.Tests

Test: Testing Malware Protection availability and installation

Expected result: Trend Micro Deep Security Agent must be installed, running, and in good state.

How to fix:

Set service to Automatic:

powershell
Set-Service ds_agent -StartupType Automatic

Start the service:

powershell
Start-Service ds_agent

Check agent status:

powershell
"C:\Program Files\Trend Micro\Deep Security Agent\dsa_query.cmd" -c "GetAgentStatus"

Test connectivity to management point (replace hostname):

powershell
Test-NetConnection -ComputerName '{Management point hostname}' -Port '4120'
Base.MonitoringInstallation.Tests

Test: Testing installed Monitoring software

Expected result:

  • Monitoring Agent Service should be Automatic and running
  • Network connectivity to endpoint should be good (<200ms)

How to fix:

Set service startup type:

powershell
Set-Service 'End Point Operations Management Agent' -StartupType Automatic

Start service:

powershell
Start-Service 'End Point Operations Management Agent'

Find endpoint details:

powershell
Select-String -Path "$($env:ProgramFiles)\VMware\ep-agent\conf\agent.properties" -Pattern 'agent.setup.serverIP=*'
Select-String -Path "$($env:ProgramFiles)\VMware\ep-agent\conf\agent.properties" -Pattern 'agent.setup.serverSSLPort=*'

Test connectivity:

powershell
Test-NetConnection -ComputerName '{Management point hostname}' -Port '443'
Base.NicPowerSaving.Tests

Test: Testing Network Adapter Power Management

Expected result: Power saving should be disabled on all network interfaces.

How to fix:

powershell
Get-NetAdapter -Physical | Get-NetAdapterPowerManagement | foreach {$_.AllowComputerToTurnOffDevice = 'Disabled'; $_ | Set-NetAdapterPowerManagement}
Base.OSLanguage.Tests

Test: Testing OS Language

Expected result: OS Language should be English, United States (en-US).

How to fix:

Confirm current language:

powershell
Dism /online /Get-Intl

Change to en-US:

powershell
Dism /online /set-allIntl:en-US

TIP

This only affects the OS User Interface. Keyboard layouts can be any language.

Base.OSLicenceState.Tests

Test: Testing the Windows License activation

Expected result:

  • KMS Server should be registered and accessible
  • OS should be licensed and activated

How to fix:

Check KMS configuration:

powershell
slmgr.vbs /dli

Reactivate the machine:

powershell
slmgr.vbs /ato
Base.OSVersion.Tests

Test: Testing OS Version

Expected result: Server must run a Swisscom-supported OS version:

  • Windows Server 2025
  • Windows Server 2022
  • Windows Server 2019
Base.PageFileSettings.Tests

Test: Testing PageFile Configuration

Expected result:

  • PageFile should be manually managed
  • Initial and Maximum size: ≥ 4,096 MB

How to fix:

powershell
wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=4096,MaximumSize=4096
Base.RegistryRunKeys.Tests

Test: Testing entries in Run and RunOnce

Expected result: Only allowed entries should exist in registry run keys.

Allowed entries:

  • Deep Security Notifier
  • InstallWindowsUpdates
  • VMware VM3DService Process
  • VMware User Process

Registry keys to check:

  • HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run
  • HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServices
  • HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunServicesOnce
  • HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  • HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
Base.RemoteDesktopProtocol.Tests

Test: Testing Remote Desktop Protocol Settings

Expected result: RDP should be enabled with proper firewall rules.

How to fix:

Enable RDP:

powershell
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0

Enable firewall rules:

powershell
Enable-NetFirewallRule -Name RemoteDesktop-UserMode-In-TCP
Enable-NetFirewallRule -Name RemoteDesktop-UserMode-In-UDP
Base.Services.Tests

Test: Testing if unnecessary services are disabled

Expected result: The following services should be disabled: AudioEndpointBuilder, Audiosrv, Browser, FontCache, iphlpsvc, NcaSvc, NetTcpPortSharing, RemoteAccess, SCardSvr, seclogon, SharedAccess, ShellHWDetection, SSDPSRV, Themes, upnphost, WcsPlugInService

How to fix:

powershell
@('AudioEndpointBuilder', 'Audiosrv', 'Browser', 'FontCache', 'iphlpsvc', 'NcaSvc', 'NetTcpPortSharing', 'RemoteAccess', 'SCardSvr','seclogon','SharedAccess', 'ShellHWDetection', 'SSDPSRV', 'Themes', 'upnphost', 'WcsPlugInService') | foreach {Set-Service -Name $_ -Status stopped -StartupType disabled}
Base.VMTools.Tests

Test: Testing VMware Tools

Expected result: VMware Tools should be installed, running, Automatic, and up to date.

How to fix:

Start service:

powershell
Start-Service 'VMTools'

Set to Automatic:

powershell
Set-Service 'VMTools' -StartupType Automatic
Base.WindowsFirewall.Tests

Test: Testing Windows Firewall

Expected result: Windows Firewall should be enabled with all profiles active.

How to fix:

Start service:

powershell
Start-Service 'MpsSvc'

Set to Automatic:

powershell
Set-Service 'MpsSvc' -StartupType Automatic

Enable File and Printer Sharing:

powershell
Enable-NetFirewallRule -DisplayName 'File and Printer Sharing (SMB-In)'
Base.WindowsManagementFramework.Tests

Test: Testing installed Windows Management Framework

Expected result: Windows Management Framework version 5.1 should be installed.

Base.WindowsPatching.Tests

Test: Testing Windows Patching

Expected result: The difference between the last Windows updates should not be more than 45 days.

Base.WindowsRemoteManagement.Tests

Test: Testing Windows Remote Management

Expected result: WinRM should be running, Automatic, and properly configured.

How to fix:

Start service:

powershell
Start-Service 'WinRM'

Set to Automatic:

powershell
Set-Service 'WinRM' -StartupType Automatic

Enable firewall rule:

powershell
Enable-NetFirewallRule -Name WINRM-HTTP-In-TCP
Base.WindowsUpdate.Tests

Test: Testing Windows Update

Expected result: wuauserv service should not be disabled.

How to fix:

powershell
sc.exe config wuauserv start= delayed-auto

Run Compliance Checks manually ​

Managed Windows ​

The compliance checks for Managed Windows OS on Swisscoms ESC are run using a custom build framework called PccComplianceChecks or PCC for short.

Each time a compliance check is run, the PCC is called behind the curtains and it triggers a so called PccRun.

A PCCRun is the operation that runs when an Exit Temp Admin is launched in the Portal or system is returned to Full Managed mode for instance.

A PccRun executes a number of infrastructure related tests to validate the OS running in the VM is compliant with Swisscoms Managed OS standards. The module has been made publicly available so that compliance checks can be run locally on the Swisscom Windows OS.

PCC is locally available to ESC customers starting with version 1.0.0 of the PccComplianceChecks package.

Why use PCC manually ​

Executing an ExitTempAdmin or Return to Full Managed mode via the regular Day 2 Action can last a few minutes and potentially result in failing checks that need to be corrected. To simplify and to speed up this process, it is now possible to call the same tests that run during the Return to Full Managed mode but directly on your VM.

The main benefit of doing so is the gain in time in validating that the OS is Swisscom standards conform before executing the Return to Full Managed action.

With PCC, it is also possible to get a history of the past runs.

Compliance Check Exceptions ​

A successful compliance check is a prerequisite for using Managed Windows. If one of the tests fails, the Full Managed service cannot be offered. You are informed and can resolve (recommended solution) the issue or apply to Swisscom for an exception. This can either be approved or rejected. The approval needs to be requested via ESC Service Request.

Verify the local PCC version ​

IMPORTANT NOTE: To download and install the latest versions of the PCC Framework and the required module "PCC.CHK.ESC.WIN.MOS" locally, we recommend to execute first an "Exit Temp Admin" or "Return To Full Managed" Day 2 Action in the ESC Portal.

Open a PowerShell prompt and execute the following PowerShell command(s):

Step 1 - Identify the current version of PCC

This request is used to get the current version of PCC working on your Managed Windows OS.

Request

powershell
Get-Module PccComplianceChecks -ListAvailable

Note: One or more different PCC versions can co-exist on the same machine. The one with the highest version number is the latest version available.

Execute a PCCRun ​

Open a PowerShell prompt and execute the following PowerShell command(s):

Step 1 - Execute a PCCRun

Only messages of the failed checks will be displayed on screen. If none are shown, it means that the Managed Windows OS is compliant.

Request

powershell
Test-TempAdmin
Step 2 - Optional

Alternatively, it is possible to output directly the run using the following snippet.

Request

powershell
Test-TempAdmin -ShowRun

Get all past PCC run results ​

NOTE: Results can only be retrieved from compliance checks that have run using the PccComplianceChecks version 1.2.0 or above. Any run done with a previous version will not generate the needed PccRunDocument.

Open a PowerShell prompt and execute the following PowerShell command(s):

Step 1 - Retrieve all past PCC run results

Request

powershell
Get-PccRundocument

Note: The 'ErrorCount' property indicates how many compliance checks have failed during that specific run.

Step 2 - Retrieve the last PCC run result

Results will look similar to the screen shot below but will vary according to the VM and its current compliance.

Request

powershell
Get-PccrunDocument -Latest
Step 3 - Get failed checks from the last pcc run results

To get the list of the failed checks from the last PCC run (or failed Return to FullAdmin) execute the following code. Results will look similar to the screen shot below but will vary according to the VM and its current compliance.

Request

powershell
(Get-PCCRunDocument -Latest).GetFailedChecksConcise()