Skip navigation

Q. How do I create a Group Policy Object (GPO) in PowerShell with Windows 7 and Windows Server 2008 R2?

A. Windows 7 and Server 2008 R2 include Group Policy cmdlets that let you perform many group policy actions from PowerShell. To use them, start an elevated PowerShell console and import the grouppolicy module. Then use the New-GPO cmdlet with the name of the new GPO, as shown here.

I enter these commands:

Import-Module GroupPolicy
New-GPO "Sales GPO"

and receive this output:

DisplayName : Sales GPO
DomainName : savilltech.net
Owner : SAVILLTECH\Domain Admins
Id : d3672844-2875-4b72-a8c4-3df031149bb5
GpoStatus : AllSettingsEnabled
Description :
CreationTime : 12/28/2009 5:03:22 PM
ModificationTime : 12/28/2009 5:03:23 PM
UserVersion : AD Version: 0, SysVol Version: 0
ComputerVersion : AD Version: 0, SysVol Version: 0
WmiFilter :

You can also pass the name of a starter GPO using the -StarterGPOName switch.

Related Reading:



Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.
TAGS: Windows 7/8
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish