myTech.Today Consulting and IT Services
📌 Your Location

Step-by-Step PowerShell GPO Example

Step-by-Step PowerShell GPO Example

Open PowerShell as Administrator

in the Start Menu, right-click, and selectRun as Administrator.

Create a New GPO

Use the
New-GPO

cmdlet to create a new GPO. For example:


New-GPO -Name "MyCustomPolicy" -Domain "yourdomain.com"            

Set a Registry Value in the GPO

Use the
Set-GPRegistryValue

cmdlet to configure registry settings within the GPO. For example:


Set-GPRegistryValue -Name "MyCustomPolicy" -Key "HKLM\Software\Policies\MyPolicy" -ValueName "SettingName" -Type DWORD -Value 1            

View the Details of the GPO

Use the
Get-GPO

cmdlet to retrieve details about the GPO. For example:


Get-GPO -Name "MyCustomPolicy"            

Force GPO Updates

Use the
gpupdate /force

command in the terminal to apply the new policy changes immediately.

Additional Notes

  • Ensure you have appropriate permissions to create and link GPOs.
  • Double-check the domain and OU paths to avoid misconfigurations.

Previous Blog Posts:

myTech.Today
My Tech On Wheels
Schedule an appointment today!
Free 15-minute phone call evaluation

Step-by-Step PowerShell GPO Example

Step-by-Step PowerShell GPO Example

Step-by-Step PowerShell GPO Example

Step-by-Step PowerShell GPO Example
Step-by-Step PowerShell GPO Example