How to Create and Link a Group Policy Object with PowerShell
Applies to: Windows Server 2019, 2022 and 2025 domain environments.
A GPO should have one documented purpose, a defined scope and an owner. Linking it to a test OU allows validation before wider deployment.
Test Group Policy in a controlled OU before production rollout. For managed Windows Server hosting, visit managed Windows VPS hosting.
Prerequisites
- Install Group Policy Management tools.
- Choose the target OU.
- Define security filtering and expected settings.
- Create a backup of related policy.
Procedure
Step 1: Load the module
Use GPMC or RSAT.
Import-Module GroupPolicyStep 2: Create the GPO
Use a descriptive name and comment.
New-GPO -Name 'Server Baseline - Audit Policy' -Comment 'Production server audit baseline'Step 3: Link to a test OU
Start with link enabled and enforced false.
New-GPLink -Name 'Server Baseline - Audit Policy' -Target 'OU=Test Servers,DC=corp,DC=example' -LinkEnabled Yes -Enforced NoStep 4: Configure approved settings
Use GPMC or supported registry-policy cmdlets.
Step 5: Pilot
Update policy on test computers and inspect results.
Verification
Confirm the link and resultant policy.
Get-GPO -Name 'Server Baseline - Audit Policy'
Get-GPInheritance -Target 'OU=Test Servers,DC=corp,DC=example'
gpresult /r /scope computerRollback
Disable or remove the link first. Delete the GPO only after confirming it is not linked elsewhere.
Official references
For a hosted environment with setup and onboarding, explore our managed Windows VPS plans.
How to Back Up and Restore Group Policy Objects
How to Back Up and Restore Group Policy ObjectsApplies to: Windows Server 2019, 2022 and 2025 domain environments.GPO backup protects…
How to Configure Group Policy Loopback Processing for RDS Servers
How to Configure Group Policy Loopback Processing for RDS ServersApplies to: Windows Server 2019, 2022 and 2025 domain…
How to Configure Domain Password and Account Lockout Policy
How to Configure Domain Password and Account Lockout PolicyApplies to: Windows Server 2019, 2022 and 2025 domain environments.Domain…
How to Troubleshoot Group Policy with GPResult and Event Viewer
How to Troubleshoot Group Policy with GPResult and Event ViewerApplies to: Windows Server 2019, 2022 and 2025 domain environments.Group…
Keeping Group Policy editors consistent with a controlled ADMX store
Keep domain policy editors consistent using a coherent ADMX Central Store. Review languages and vendor files, test complete updates and…