Introduction to Windows PowerShell Cmdlets in Windows 7

New Year, New…console session? Here’s a quick look at creating a new GPO using the Group Policy cmdlets in Windows 7.

To create a new GPO from scratch using PowerShell cmdlets:

 

1. Open an elevated PowerShell console session (1-2 clicks)

2. Command: Import-Module grouppolicy (typing)

3. Command: New-GPO “Sales GPO” (typing)

 (optional: add parameter –starter “Security Starter” )

       Total: 1-2 clicks, 2 lines of typing

To create a new GPO from scratch using the UI:

1. Open the GPMC (1-2 clicks)

2. Navigate to the domain of your target domain (1-2 clicks)

3. Open the Group Policy Objects Folder (1 click)

b. Right click, and select “New” (2 clicks)

or

c. Alternatively, go to Action-> New from the title bar (2 clicks)

4. Enter a name “Sales GPO” (typing)

(Optional: Select a Starter GPO from the Drop Down)

5. Select OK (1 click)

Total: 6-8 clicks, one line of typing

The PowerShell cmdlet example assumes several things:

· The domain that you are logged onto is where you would like to create your new GPO. Otherwise, you can specify the domain you’d like to create the GPO in with the optional –domain parameter (FQDN) and target the DC of your choice with the server parameter.

· GPMC is installed on the machine (Win7 server or Win7 client with RSAT) you are working from

In general, the cmdlet method requires more typing, but far fewer steps and clicks. The additional benefit is the accuracy and ease of repetition: after the initial start up, creating a second GPO is even faster from the PowerShell console. The click-through UI method requires most of the same steps. However, if you capture the cmdlet commands in a script, re-running that script is one command; running that script 100 times is only marginally more effort and assured to produce the same results.

If you don’t have the beta to play around with the Group Policy cmdlets yet, you should check out Darren Mar-Elia’s cmdlets that his company SDMSoftware released. His site, www.gpoguy.com, has helpful videos, articles, and tools to help you work with Group Policy. Check that site out regardless, beta or not. It’s got a lot of good information for every level of GP knowledge.