If you want to configure a computer setting instead, replace “HKCU” with “HKLM” (which expands to HKEY_LOCAL_MACHINE). You can specify either computer configuration or user configuration settings using Set- GPRegistryValue The registry path in the -Key parameter below starts with “HKCU” (which stands for “HKEY_CURRENT_USER”). The following command sets a screensaver timeout of 300 seconds for the logged-in user: Set-GPRegistryValue -Name "Netwrix PCs" -Key "HKCU\Software\Policies\Microsoft\Windows\Control Panel\Desktop" -ValueName ScreenSaveTimeOut -Type DWord -Value 300 For example, if you want to configure registry settings for third-party applications that don’t have an ADMX file for Group Policy, Set-GPRegistryValue is a quick way to configure the settings you need. Set-GPRegistryValue can also be used to set registry values that are not covered by Group Policy settings. Registry-based Group Policy settings are those that appear under Administrative Templates in GPMC. If you know the location for a registry-based Group Policy setting, you can use the Set-GPRegistryValue cmdlet to configure it. HTML report with detailed data about a specific GPO Configuring Group Policy Settings The script below creates an HTML report that gives information about the GPO similar to what you might see in the Group Policy Management Console: Get-GPO -Name "Netwrix PCs" | Get-GPOReport -ReportType HTML -Path c:\temp\report.htmlįigure 2. If you want more information, pipe the object created by Get-GPO to Get-GPOReport.
Once a GPO is created, you can use Get-GPO to return information like GPO status, creation time and last modification time: Get-GPO -Name "Netwrix PCs"
The command creates an empty GPO with no settings. The command below creates a new GPO called ‘Netwrix PCs’ and adds a comment to describe its purpose: New-GPO -Name "Netwrix PCs" -Comment "Client settings for Netwrix PCs" Let’s start by creating a new Group Policy object (GPO).