I just discovered I have to enable a local group policy setting (Computer Configuration -> Administrative Templates -> System -> UserProfiles) on a server running a specific application. I have a PowerShell installation script I use to install the application and configure the server. I'd like to be able to enable this group policy in my installation script. Is there a way to do this in PowerShell? If not, any other technology? I'm comfortable using the Win32 API, if that is my only option.
Powershell – How to enable a local group policy setting with PowerShell and/or an API
automationgroup-policypowershell
Related Topic
- Powershell – use Powershell to configure Local group policy settings in windows server 2008 r2
- Editing local group policy for all domain computers
- Use Script To Edit Local Group Policy Windows Server 2012
- How to enable PIN login for domain-joined Windows 10 Pro via Group Policy
- Windows – Unable to Set local group policy using powershell
Best Answer
Most group policy settings are just registry keys under HKLM\Software\Policies. If your PowerShell script runs as Adminstrator, you can just set the corresponding registry value and achieve the same effect without touching Group Policy.
The mappings between registry values and GPO settings is documented by Microsoft. https://www.microsoft.com/en-us/download/details.aspx?id=25250