In Active Directory [best] — Editing Group Policy

New-GPLink -Name "Workstation Hardening" -Target "OU=Workstations,DC=contoso,DC=com"

Here is a streamlined guide on how to safely edit Group Policy in Active Directory, along with best practices to keep your environment stable. editing group policy in active directory

For scripting or remote edits, use PowerShell: editing group policy in active directory