This article explains how to create a custom security template from a workstation machine and then import that template into a group policy object to globally manage the LxssManager service for multiple workstations. In my environment, the option to manage this service via GPO was not natively available. It’s possible that ADMX templates are available for this, but I just manually created a template from my workstation in order to get the policy up and running quickly.
Note: these steps can be followed to create all kinds of security templates and group policies, and are not restricted to just system services.
Before following the steps below, I installed the WSL feature on my workstation by completing the following steps:
- Open Applications and Features (appwiz.cpl)
- Click ‘Turn Windows Features on or off’
- Scroll down in the list and check the box for ‘Windows Subsystem for Linux’
- Click Ok
- Reboot the workstation when prompted
This installs WSL (and more specifically the LxssManager service, which is necessary in order to complete the steps below).
Creating the Security Template
On the machine that is running WSL:
- Open mmc.exe
- Add the Security templates Snap-in
- Expand the Security Templates object and right-click the path to your current user’s security templates directory. Click New Template…
- Provide a name and description for the security template
- The new security template will appear under your current user’s security templates directory. Expand the object and navigate to ‘System Services’.
- In the list, find the service you want to configure (in my case, LxssManager). Right-click the service and click Properties
- Check the ‘Define this policy setting in the template’ check box.
- Select the appropriate service startup mode and assign Security permissions as necessary
- Click Apply/Ok to close out of the Properties window.
- Right-click the security template object in the navigation tree and click Save. Alternatively, you can just close the MMC.exe window, and Windows will prompt you to save your edited security template.
- If necessary, move this file to a location accessible by a machine that has the Remote Server Administration Tools installed.
Importing the Security Template into a Group Policy Object
On a machine that has RSAT installed, open the Group Policy Management Console (gpmc.msc) as a Domain Administrator.
- Create a new Group Policy Object and name it. Or open (edit) an existing policy that you want to use.
- Navigate to: Computer Configuration > Policies > Windows Settings > Security Settings.
- Right-click on Security Settings and click Import Policy…
- Find the security template file that you created in the section above, select it and click Open.
- Open ‘System Services’ and verify that you see the ‘LxssManager’ service.
- If necessary, make any additional edits to the service’s properties.
- Close the GPO editor and if not done already, apply the GPO to the appropriate Organizational Unit (OU).
Testing the GPO
Group Policies update on domain machines every 90-120 minutes, but if you want to speed up the process:
On a machine that resides under the targeted OU, you can quickly update it’s group policies with the following command:
You can also view which polices are currently applied to the machine using the following command. In order to view Computer policies, the shell will have to be opened as a local administrator user.
If all worked as expected, the LxssManager service should have received the settings specified in the group policy (verify in services.msc). If you are unable to view the LxssManager service, you may need to open services.msc as a local administrator user or modify the Security settings for the LxssManager service in the group policy object you created.