# Ensure 'Windows Media Player Network Sharing Service (WMPNetworkSvc)' is set to 'Disabled' or 'Not Installed'

The 'Windows Media Player Network Sharing Service' (WMPNetworkSvc) allows for the sharing of media libraries across a network. Disabling this service is crucial for security as it reduces the system's attack surface. Any active network service, especially one that interacts with media files, can be a potential vector for exploits. If this functionality is not explicitly required, the service should be disabled to adhere to the principle of least functionality, minimizing potential vulnerabilities.

The audit script verifies the current startup type of the WMPNetworkSvc service, returning 'Not Installed' if it's absent. The remediation script uses PowerShell's Set-Service cmdlet to configure the service's startup type to the desired state, typically 'Disabled'.

The recommended state for all security levels (Basic, Moderate, and Strict) is either 'Disabled' or 'Not Installed'. There is no intermediate security posture for this setting; the service is either a potential risk or it is not. Disabling it prevents it from starting automatically or on-demand, effectively neutralizing any threat it might pose without uninstalling the feature entirely.

## 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 that queries the startup type of the 'WMPNetworkSvc' service. If the service is not installed, the script should return the string 'Not Installed'. Otherwise, it should return the service's current startup type (e.g., 'Disabled', 'Automatic'). The output must contain only the value, with no extra text or labels.

## Remediation Script Working

PowerShell script that accepts a single positional command-line argument specifying the desired state (e.g., 'Disabled'). The script must attempt to set the startup type for the 'WMPNetworkSvc' service to this value. If the service does not exist, the script should take no action. The script must return the boolean value '$true' on success (including if the service is not installed) and '$false' on failure.

