I want to set local users and groups in the computer configuration of my GPO with PowerShell.

Aim is to create and update the following structure.

enter image description here

Currently I'm using Powershell Version 4 on a Windows Server 2012 R2. The Group Policy Cmdlets Documentation from Technet was not very helpful.


Is there any way to achieve this with PowerShell ?

  • Are you hoping to replace the GPO with a PowerShell startup script, or did you want to attach a PowerShell script to a GPO? Or are you trying to completely create the GPO using only PowerShell cmdlets? What exactly are you trying to achieve? – SturdyErde May 31 '18 at 14:12
  • As a side note, it would be worth upgrading to the Windows Management Framework (WMF) 5, which will upgrade this server to PowerShell 5 at the same time. – SturdyErde May 31 '18 at 14:15
  • Hi. I'm sorry for the late response. A couple of weeks ago I created a script to create and manage the GPO with PowerShell. There are no cmdlets for that. Even in version 5 no cmdlets exist for that task. So I create the "Groups.xml" in SYSVOL folder on the domain controller with PowerShell. It's a lot of code needed to manage the XML file. As soon as I have a reliable version, I will release it. – pdunker Jun 8 '18 at 12:04

To control the members of local groups, suggest you take a look at the Restricted Groups options within the Security branch. enter image description here

  • Agreed. This, or Preferences. – SturdyErde May 31 '18 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.