Create a compliance baseline to remove a folder

compliant

In this example we are killing the Silverlight start menu folder enabling us to use the Windows Updates while keeping the start menu clean.

Create the Configuration Item

1. In the console click Create Configuration Item

2. Name your configuration item, click 'This configuration item contains application settings' and click Next

Screenshot 2014-11-14 10.03.58

3. Select 'Always assume application is installed' and click Next

Screenshot 2014-11-14 10.05.15

4. Click New, Change the Setting type to 'Script'. Change the Data type to 'String'. Also name your Setting.

Screenshot 2014-11-14 10.29.17

5. Under Discovery Script click 'Add Script'

6. Ensure Script language is 'Windows Powershell' and paste the following

$false -eq (Test-Path "C:ProgramDataMicrosoftWindowsStart MenuProgramsMicrosoft Silverlight")

Screenshot 2014-11-14 10.32.38

7. Under Remediation Script click 'Add Script'

8. Ensure Script language is 'Windows Powershell' and paste the following

remove-item "C:ProgramDataMicrosoftWindowsStart MenuProgramsMicrosoft Silverlight" -recurse

Screenshot 2014-11-14 10.42.37

9. Click 'Ok',  then click the 'Compliance Rules' tab

10. Click 'New'

Screenshot 2014-11-14 10.47.35

11. Configure the Compliance rule: Set 'Rule type' to Value. Set the Value returned to equal 0. Click 'Run the specified remediation script when this setting is non complaint'.

Screenshot 2014-11-14 10.52.10

12. Click 'OK' then 'Next', 'Next' on the Wizard Screen.

13. Choose the OS Environments for compliance

Screenshot 2014-11-14 10.54.33

14. Click 'Next' until you finish the Wizard.

15. Under Configuration Baselines click 'Create Configuration Baseline' and add the configuration item we just created, then click 'OK'

Screenshot 2014-11-14 10.57.31

 

16. The Baseline is now ready to be deployed to your test collection!

Right click and select Deploy, Enable the remediation options and change the Schedule if needed.

Screenshot 2014-11-14 11.00.15

 

 

17. On your test machine, request a new machine policy, then click on the Components tab. Clicking Refresh should show the new baseline which you can then evaluate.

baselines

18. Within a minute the remediation runs and the folder disappears!

baselinesComp

There are no comments yet, add one below.

Leave a Comment

Your email address will not be published. Required fields are marked *

*