简体   繁体   中英

How to add user/ADGroup to a policy in GPO using Powershell script

I had search around the internet and only found how to use Carbon module to edit Local Policy. But I need to edit Group Policy actually

Picture Want to do the same thing as the picture but using script (GPO)

GPO name and ID

Unfortunately, the short answer is still you can't .

Group policy objects are kind of a mess with:

  • The policy objects: \\domain.com\sysvol\policies\{GPO-GUID}\
  • Each require PolicyDefinition files, which can be custom-created: \\domain.com\sysvol\policies\PolicyDefinitions\*.admx
  • Which in turn each require a matching localized language definition: \\domain.com\sysvol\policies\PolicyDefinitions\en-US\*.adml

Either use the group policy management mmc tool, or find the registry keys that correspond to the gpo settings you want, and change them via powershell.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM