SECURITY

Windows Server 2008 and Windows Vista : Controlling GPOs with Scripts and Automation - VBScript Scripting , Windows PowerShell

11/15/2013 6:41:56 PM

VBScript Scripting

If you use VBScript, you may find it difficult to create custom scripts beyond the GPMC scripts for Group Policy management. Although you can create VBScript scripts to control and manage Group Policy, it is not a simple task.

If you want to manage the GPOs, link to GPOs, set permissions on the GPOs, set permissions on the Active Directory nodes, and so on, you would be better off just using the GPMC scripts covered earlier. Those scripts are fully functional and already proven. You can use those scripts in other scripts; just send a function call to them.

If you want to manage the GPO settings, however, the GPMC provides no programming interfaces into the Group Policy settings. To manage those settings with the GPMC, you have to understand how the Group Policy settings for each policy area are configured, stored, and tracked, because each policy uses a different format when being stored.

Solutions are available that apply this level of investigation. These solutions include scripting interfaces that you use to make, change, and delete settings from GPOs.

The most prevalent solution is an SDM Software product for making changes to GPO settings using Windows PowerShell. The GPExpert Scripting Toolkit for PowerShell allows you to automate the modification of Group Policy settings across all GPOs in a domain, not just one at a time manually. It also supports modification of local GPOs. You can register and download an evaluation version of the product at http://www.sdmsoftware.com/products2.php.

Windows PowerShell

Windows PowerShell is one of the hottest topics and technologies for management of Windows today. This new technology was created from the ground up for Microsoft operating systems and it is proving to be a powerful, easy-to-follow, and widely used solution for Windows command-line automation.

Unfortunately, Windows PowerShell does not currently include native support for Group Policy. Although this is a limitation at first glance, it is quickly fixed with some of the other capabilities that it provides for Group Policy management. Windows PowerShell can call on COM objects directly, allowing you to manage Group Policy.

Windows PowerShell allows you to manage the settings in a GPO, as well as leverage better control over the GPOs compared with the GPMC scripts. Windows PowerShell derives its power from the pipeline, or the ability to “pipe” objects between Windows PowerShell cmdlets. This pipeline or piping is the ability of Windows PowerShell to carry out instructions to objects through a sequence of stages between cmdlets. For example, Windows PowerShell allows you to get a list of GPOs, determine which has a certain parameter (for example, the HRAdmins that have Edit permission delegated to them), and then pipe that list to a cmdlet that lets you alter just the GPOs that have this permission with a new set of permissions for the group. You can usually do this with one line of script by using Windows PowerShell.

The foundation has already been laid for you as well. Many example scripts and cmdlets have been generated for Windows PowerShell to control Group Policy. These cmdlets allow you to perform tasks on Group Policy and GPOs in a more efficient automated manner. For a list of Windows PowerShell–enabled scripts and cmdlets, visit the following links:

http://www.microsoft.com/technet/technetmag/issues/2007/05/GroupPolicy/default.aspx

http://www.sdmsoftware.com/freeware.php

As an example of the capabilities and simplicity offered by Windows PowerShell, Figure 1 shows you a Windows PowerShell cmdlet that reports on significant information from a GPO within the domain.
Figure 1. Windows PowerShell cmdlets allow you to gather information regarding GPOs.

In another example, shown in Figure 2, Windows PowerShell is used to control not only the GPO, but also the settings within the GPO. This is a very difficult task using a script, but Figure 2 illustrates how the GPExpert Scripting Toolkit for PowerShell can alter a GPO setting.

Figure 2. The firewall settings in a GPO can be altered by using Windows PowerShell.
Other  
  •  Windows Server 2008 and Windows Vista : GPO Security (part 2)
  •  Windows Server 2008 and Windows Vista : GPO Security (part 1)
  •  Windows Server 2008 and Windows Vista : Advanced Group Policy Management Delegation - Approving, Reviewing
  •  Windows Server 2008 and Windows Vista : Advanced Group Policy Management Delegation - Full Control, Editing
  •  Windows Server 2008 and Windows Vista : Group Policy Management Console Delegation - Modeling GPOs, RSoP of GPOs
  •  Windows Server 2008 and Windows Vista : Group Policy Management Console Delegation - Managing GPOs, Editing GPOs
  •  Windows Server 2008 and Windows Vista : Group Policy Management Console Delegation - Linking GPOs
  •  Windows Server 2008 and Windows Vista : Group Policy Management Console Delegation - Creating GPOs
  •  Windows Server 2008 and Windows Vista : Security Delegation for Administration of GPOs - Default Security Environment
  •  Programming WCF Services : Security - Intranet Application Scenario (part 7) - Identity Management, Callbacks
  •  
    Top 10
    Review : Sigma 24mm f/1.4 DG HSM Art
    Review : Canon EF11-24mm f/4L USM
    Review : Creative Sound Blaster Roar 2
    Review : Philips Fidelio M2L
    Review : Alienware 17 - Dell's Alienware laptops
    Review Smartwatch : Wellograph
    Review : Xiaomi Redmi 2
    Extending LINQ to Objects : Writing a Single Element Operator (part 2) - Building the RandomElement Operator
    Extending LINQ to Objects : Writing a Single Element Operator (part 1) - Building Our Own Last Operator
    3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    VIDEO TUTORIAL
    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
    Popular Tags
    Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8