Skip to content

DSC resources used to apply and manage local group policies by modifying the respective .pol file.

License

Notifications You must be signed in to change notification settings

dsccommunity/GPRegistryPolicyDsc

Repository files navigation

GPRegistryPolicyDsc

Build Status Azure DevOps coverage (branch) codecov Azure DevOps tests PowerShell Gallery (with prereleases) PowerShell Gallery

This resource module contains resources used to apply and manage local group policies by modifying the respective .pol file.

This module is an adaptation from GPRegistryPolicy.

Code of Conduct

This project has adopted this Code of Conduct.

Releases

For each merge to the branch master a preview release will be deployed to PowerShell Gallery. Periodically a release version tag will be pushed which will deploy a full release to PowerShell Gallery.

Contributing

Please check out common DSC Community contributing guidelines.

Installation

GitHub

To manually install the module, download the source code and unzip the contents to the directory '$env:ProgramFiles\WindowsPowerShell\Modules' folder.

PowerShell Gallery

To install from the PowerShell gallery using PowerShellGet (in PowerShell 5.0) run the following command:

Find-Module -Name GPRegistryPolicyDsc -Repository PSGallery | Install-Module

To confirm installation, run the below command and ensure you see the DSC resources available:

Get-DscResource -Module GPRegistryPolicyDsc

Requirements

The minimum Windows Management Framework (PowerShell) version required is 5.0 or higher.

Examples

You can review the Examples directory for some general use scenarios for all of the resources that are in the module.

Change log

A full list of changes in each version can be found in the change log.

Resources

RefreshRegistryPolicy

A resource to detect and invoke a group policy refresh.

Requirements

  • Target machine must be running Windows Server 2008 R2 or later.

Parameters

  • [String] IsSingleInstance (Key): Specifies the resource is a single instance, the value must be 'Yes'

Read-Only Properties from Get-TargetResource

  • [String] RefreshRequiredKey (Read): Returns the value of the GPRegistryPolicy key indicating a group policy refresh is needed.
  • [String] Path (Read): Returns the path of the RefreshRequired property indicating a group policy refresh is needed.

Known issues

All issues are not listed here, see here for all open issues.

RegistryPolicyFile

A resource to manage registry policy entries in a policy (.pol) file.

Requirements

  • Target machine must be running Windows Server 2008 R2 or later.

Parameters

  • [String] Key (Key): Indicates the path of the registry key for which you want to ensure a specific state.
  • [String] ValueName (Key): Indicates the name of the registry value.
  • [String] TargetType (Required): Indicates the target type. This is needed to determine the .pol file path. Supported values are ComputerConfiguration, UserConfiguration, Administrators, NonAdministrators, and Account.
  • [String] AccountName (Write): Specifies the name of the account for an user specific pol file to be managed.
  • [String[]] ValueData (Write): The data for the registry value.
  • [String] ValueType (Write): Indicates the type of the value. Possible values are:"Binary","Dword","ExpandString","MultiString","Qword","String","None"
  • [String] Ensure (Write): Specifies the desired state of the registry policy. When set to 'Present', the registry policy will be created. When set to 'Absent', the registry policy will be removed. Default value is 'Present'.

Read-Only Properties from Get-TargetResource

  • [String] Path (Read): Returns the path to the pol file being managed.

Examples

Known issues

All issues are not listed here, see here for all open issues.