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

Necessity: The 'Windows Media Player Network Sharing Service' (WMPNetworkSvc) allows sharing of media libraries across a network. In most corporate or secure environments, this functionality is non-essential and increases the system's attack surface. Disabling this service adheres to the principle of least functionality, reducing exposure to potential vulnerabilities in network sharing protocols and the service itself. An unnecessary open service can be exploited by attackers for network reconnaissance or lateral movement.

Auditing and Remediation: The audit script checks the startup type of the WMPNetworkSvc service to determine if it is enabled. If the service is not installed, it is considered compliant. The remediation script disables the service by setting its startup type to 'Disabled', which prevents it from being started automatically or manually.

Recommended State Rationale: The recommendation is consistent across all security levels because the risk associated with this service outweighs its utility in a typical business setting. 
- Basic: Recommends ['Disabled', 'Not Installed'] as the baseline for removing unnecessary network services. 
- Moderate: Maintains this recommendation as there is no intermediate secure state; the service should be inactive. 
- Strict: Enforces the same state, as disabling or ensuring the service is not installed is the most secure configuration possible. There is no added security benefit beyond this state.

## 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 check the status of the 'Windows Media Player Network Sharing Service (WMPNetworkSvc)'. The script should first verify if the service exists. If the service is not found, it must return the string 'Not Installed'. If the service exists, it must return its current startup type (e.g., 'Disabled', 'Automatic', 'Manual'). The output must consist only of the value, with no labels or extra text.

## Remediation Script Working

PowerShell script that accepts a single positional command-line argument specifying the desired startup type (e.g., 'Disabled'). The script must configure the 'Windows Media Player Network Sharing Service (WMPNetworkSvc)' to this state. If the service does not exist, the script should consider the operation successful. The script must use `Set-Service` to apply the change. It must return `$true` on success and `$false` on failure.

