Q. How do I create a Group Policy Object (GPO) in PowerShell with Windows 7 and Windows Server 2008 R2?
John Savill
January 24, 2010
1 Min Read
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 GroupPolicyNew-GPO "Sales GPO"
and receive this output:
DisplayName : Sales GPODomainName : savilltech.netOwner : SAVILLTECHDomain AdminsId : d3672844-2875-4b72-a8c4-3df031149bb5GpoStatus : AllSettingsEnabledDescription :CreationTime : 12/28/2009 5:03:22 PMModificationTime : 12/28/2009 5:03:23 PMUserVersion : AD Version: 0, SysVol Version: 0ComputerVersion : AD Version: 0, SysVol Version: 0WmiFilter :
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.
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like