Hi,
I’m working on Powershell for automation of a DC, I need to know 2 things.
How do I add sites into Group Policy Management (image below) with Powershell
https://i.ibb.co/DgWCsZG/1.png
https://i.ibb.co/fvRTdPw/4.png
https://i.ibb.co/5FTG4LQ/5.png
https://i.ibb.co/jkRxVfp/6.png
How do I edit Group policy Management Editor configurations with Powershell
https://i.ibb.co/9NgrRfQ/2.png
https://i.ibb.co/cgjC1gN/3.png
The ADReplicationSite command works for adding sites to the AD Sites and Services window, and there are no other commands to allow working in the GPO window.
Similarly the GPO related commands have nothing related to this as well (yes there are commands that allow the GPO to link to the site, which I have already done, but there are no commands to show the sites in GP window which is what Im looking for).
Thank You
Configuring Group Policy Sites (and more) with Powershell
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
-
- Posts: 7
- Last visit: Tue Nov 09, 2021 5:30 am
Re: Configuring Group Policy Sites (and more) with Powershell
Please review the Group Policy module documentation for instructions on how to use the module.
PowerShell does not automate the GP management applications; it edits AD directly. You will have to learn both the AD technical API and the GP technical API.
There is no simple way to directly edit individual policy rules. There are a few third-party GP policy editors in the PowerShell Gallery which you can review to find the one that suits your needs.
Do not attempt to automate editing of AD or GP without a full understanding of what is happening. You can crash AD easily via direct API edits.
The docs have examples of what can be done. You will have to understand what a GP is and how to use registry settings to manage GP policy rules and settings although the third-party tools can make some of this easier.
https://docs.microsoft.com/en-us/powers ... ver2019-ps
PowerShell does not automate the GP management applications; it edits AD directly. You will have to learn both the AD technical API and the GP technical API.
There is no simple way to directly edit individual policy rules. There are a few third-party GP policy editors in the PowerShell Gallery which you can review to find the one that suits your needs.
Do not attempt to automate editing of AD or GP without a full understanding of what is happening. You can crash AD easily via direct API edits.
The docs have examples of what can be done. You will have to understand what a GP is and how to use registry settings to manage GP policy rules and settings although the third-party tools can make some of this easier.
https://docs.microsoft.com/en-us/powers ... ver2019-ps