We’re pleased to inform that four new Visual C# samples have been published to the MSDN Library that demonstrate using the Group Policy Management Console (GPMC) Class Library to perform some basic GP tasks. Note that all samples include step-by-step instructions as well as complete code-listings for standalone Visual C# console applications that can be modified to fit your specific needs.
- How to Back Up All GPOs in a Domain – Illustrates how to back up all GPOs in the current domain using the GPDomain, GpoCollection, and Gpo classes.
- How to Restore a Domain’s GPOs – Shows how to restore a domain’s GPOs that have been backed up previously using the GPDomain, BackupDirectory, GpoBackupCollection, and GPSearchCriteria classes.
- How to Import GPOs from a Backup – Illustrates how to import a GPO’s settings from a backed-up GPO to an existing or new GPO.
- How to List Unlinked GPOs in a Domain – A Group Policy object (GPO) can be associated with one or more Active Directory containers, such as a site, domain, or organizational unit (OU). This association is referred to as the GPO’s link. For a GPO’s settings to be applied at a given level, the GPO must be linked to the level. Therefore, it’s critical to track what GPOs are linked and to what level, and to know which GPOs are not linked at all. This article illustrates how to list all unlinked GPOs for a specified domain.
If you would like to see a specific GPMC Class Library API sample, please feel free to ping me directly or post a comment on the blog!
Tom Archer, Programming Writer