ConfigMgr 2012: Service Configuration Baseline

ConfigMgr Configuration Baselines allow administrators to report or enforce particular settings on machines. These settings, with remediation, will allow you ensure that your devices meet a specific configuration. In this post, we look at services and how to configure a baseline that will ensure particular services are started.

Configuration Item

The first part to any baseline is a configuration item. I will use a detection and remediation PowerShell script for this part. To create the item, go to Assets and Compliance > Compliance Settings > Compliance Items and click “Create Configuration Item” in the ribbon. Give your item a name. I am building this item for the ConfigMgr client, to ensure that a user does not turn it off or disabled it.

We can leave all versions of Windows selected on the next screen, or you can exclude Embedded if you want. For the Settings page of the wizard, give the setting a name, change the setting type to Script, and data type to String:

Now click “Add Script” under the “Discovery Script” section. Leave the language as PowerShell, and paste this command:

(get-wmiobject -namespace root\CIMv2 -class Win32_Service | where-object -filterscript {$_.Name -eq “CcmExec”}).started

Change the CcmExec part to your service name and click OK.

Now, click the “Add Script” button under “Remediation script”. Paste this code into the box, changing the service name once again:

$service = get-wmiobject -namespace root\cimv2 -class Win32_Service | where-object -filterscript {$_.Name -eq “CcmExec”}

$service.changestartmode(“automatic”)

$service.startservice()

The first piece of code checks if the service is started. The “started” property of the Win32_Service class returns a value of true. This will be important shortly. Next, the remediation part will change the start mode of the service to automatic, then start the service.

After both scripts are in place, you can click the “Compliance Rules” tab and click New. Configure the wizard like this:

The value of the “started” parameter comes into play here, where we tell the rule what the script will return. You also need to check the remediation box so that the remediation script will run. That’s it for the configuration item.

Configuration Baseline

Now that we have our configuration item, you can either add it to an existing baseline and deploy it, or create a new one. The only key is to remember that when you create the deployment, be sure the remediation boxes are checked:

Share:

Facebook
Twitter
LinkedIn

Contact Us

Name
=
On Key

More Posts

Microsoft EndPoint Management

Sync ConfigMgr Collections to Intune

ConfigMgr collection sync is a feature that has been in ConfigMgr for a few versions. At a high level, it syncs the membership of a collection to a group in Entra ID that can then be

Read More »
WME Microsoft 365 Updates No. 025
Azure

WME Microsoft 365/Azure Updates 22 August 2025

1. Exchange Online: Temporary Mailbox Access Disruption via MAPI Overview Some Exchange Online users experienced mailbox access issues via the Messaging API (MAPI) on August 20, 2025. The disruption occurred after Microsoft reverted a recent service

Read More »