Chapter 7: Scripting GPMC Operations

This chapter was written by Bill Boswell.

Overview

The GPMC makes it simple to manage individual GPOs, but if you routinely handle large numbers of GPOs or if you want a convenient way to protect your investment in Group Policy by backing up GPOs and GPO link information on a regular schedule, you might want to automate Group Policy operations with scripts. Using GPMC scripts, you can perform just about any task you can do in the GPMC interface, including the following:

  • Creating and deleting GPOs

  • Linking and unlinking GPOs with containers

  • Reporting on the status of GPOs and GPO links

  • Searching for GPOs

  • Modifying GPO permissions

  • Generating Resultant Set of Policy (RSoP) reports

  • Backing up and restoring GPOs

  • Importing and exporting GPOs

And we're going to perform these scripting magic tricks right in this chapter.

To get the most out of this chapter, you'll need to be fairly well versed in VBScript, as all the scripts use VBScript.

Note 

I've included only minimal error checking to keep the scripts as uncluttered as possible for instruction purposes. For the same reason, I don't declare variables before using them, but best practice for scripting dictates that you do this.

Warning 

Don't run the scripts in a production environment without first testing them to your satisfaction in a lab. These scripts are for example only, and neither Sybex, nor Jeremy Moskowitz, nor Bill Boswell will be held liable for any damage used when running scripts. Not that they are expected to run amok or harm your Active Directory, but please use at your own risk.



Group Policy, Profiles, and IntelliMirror for Windows 2003, Windows XP, and Windows 2000
Group Policy, Profiles, and IntelliMirror for Windows2003, WindowsXP, and Windows 2000 (Mark Minasi Windows Administrator Library)
ISBN: 0782144470
EAN: 2147483647
Year: 2005
Pages: 110

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net