You need to start from preparing script which will check whether specific Windows feature is installed. On Windows 7 dism tool must be used, on Windows 8 powershell cmdlet Get-WindowsOptionalFeature can be used. Below is a simple script based on dism for Windows Media Player feature:
$ff = dism /online /get-featureinfo /featurename:WindowsMediaPlayer | findstr State
If ($ff -eq "State : Enabled") {
$Compliance = "Compliant"
}
Else {
$Compliance = "NonCompliant"
}
Return $Compliance
To use this script in configuration item and then in configuration baseline the PowerShell execution policy must be changed from default All signed into Bypass. This is under Client Settings, under Computer Agent, there is an option to configure the PowerShell execution policy
I write some useful information and lessons learnt about SCCM, MDT, SCOM, Exchange, Lync, Windows 7/8, Windows servers, Hyper-V, Vmware