# Ensure 'Web Management Service (WMSvc)' is set to 'Disabled' or 'Not Installed'

The Web Management Service (WMSvc) is used for remote management of Internet Information Services (IIS). If this service is not required for administrative purposes, it should be disabled to reduce the system's attack surface. An enabled but unused management service presents a potential vector for attackers to exploit vulnerabilities, potentially leading to unauthorized access or control over the web server.

The audit script verifies the current start type of the 'WMSvc' service, returning 'Not Installed' if it is not present on the system. The remediation script configures the service's start type to the desired state (typically 'Disabled'), ensuring the service does not automatically start and stopping it if it is currently running.

The recommended state for all security levels (Basic, Moderate, and Strict) is 'Disabled' or 'Not Installed'. This is a binary security measure; the service is either necessary and explicitly enabled, or it is unnecessary and should be disabled to adhere to the principle of least functionality. There is no intermediate state that provides a security benefit over simply disabling the service when it is not in use.

## Recommended State Configuration

| Security Level | Value |
|----------------|-------|
| **Basic** | `['Disabled', 'Not Installed']` |
| **Moderate** | `['Disabled', 'Not Installed']` |
| **Strict** | `['Disabled', 'Not Installed']` |
| **Type** | `ENUM` |

## Audit Script Working

PowerShell script to query the status of the 'Web Management Service (WMSvc)'. If the service is not installed, the script must return the string 'Not Installed'. If the service is installed, it must return its current start type (e.g., 'Disabled', 'Automatic'). The script should output only the resulting value without any labels or extra text.

## Remediation Script Working

PowerShell script that accepts a single positional command-line argument specifying the desired state for the 'Web Management Service (WMSvc)' (e.g., 'Disabled'). The script must attempt to set the service's start type to the provided value. If the service does not exist, the script should consider the operation successful. Before disabling the service, the script must ensure it is stopped. The script must return `$true` on success and `$false` on failure.

